Skip to content

.NET 7 RC1 dotnet build fails without errors on MAC M1 #7840

Open

Description

@esskar

Description

I was switching from .NET 7 Preview 7 to .NET 7 RC1 yesterday. Everything runs ok, but after some builds and runs, dotnet stops building my project.

╰─ dotnet build                                                        ─╯
MSBuild version 17.4.0-preview-22428-01+14c24b2d3 for .NET

Build FAILED.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:00.00

It's the second time this happens. I need to restart the machine to get it working again.
Deleting obj and/or bin folder does not help.

Configuration

MSBuild version 17.4.0-preview-22428-01+14c24b2d3 for .NET
Tye version 0.11.0-alpha.22111.1+3edef5428949c518c078844d6438e5ba86fce600

.NET SDK:
Version: 7.0.100-rc.1.22431.12
Commit: f1cf61e1c0

Runtime Environment:
OS Name: Mac OS X
OS Version: 12.6
OS Platform: Darwin
RID: osx.12-arm64
Base Path: /usr/local/share/dotnet/sdk/7.0.100-rc.1.22431.12/

Host:
Version: 7.0.0-rc.1.22426.10
Architecture: arm64
Commit: 06aceb7015

.NET SDKs installed:
6.0.400 [/usr/local/share/dotnet/sdk]
7.0.100-preview.7.22377.5 [/usr/local/share/dotnet/sdk]
7.0.100-rc.1.22431.12 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.8 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.0-preview.7.22376.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.0-rc.1.22427.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.8 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.0-preview.7.22375.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.0-rc.1.22426.10 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
None

Environment variables:
Not set

global.json file:
Not found

Information

When this happens, vs code is not finding any references. Everything is signaled as red and unknown in vs code.

Activity

  1. wickedw commented on Oct 1, 2022

    @wickedw

    This is also happening on 4.2 GHz Quad-Core Intel Core i7 iMAC.

  2. livehop commented on Oct 2, 2022

    @livehop

    Can you please let us know how I can remove the .Net 7 version ? the dotnet-core-uninstall does not work and VS preivew automtically installed this version

  3. GabrielCappelli commented on Oct 2, 2022

    @GabrielCappelli

    I'm having the same issue, passing --disable-build-servers to dotnet build seems to get it to build again.

  4. livehop commented on Oct 3, 2022

    @livehop

    Thanks! -- for now I just ran :

    dotnet new globaljson

    and then changd the globaljson of my project to

    {
    "sdk": {
    "version": "6.0.401"
    }
    }


    Good to know you have the option you provided as well!

  5. jburnett commented on Oct 4, 2022

    @jburnett

    We're experiencing w/Intel CPUs like @wickedw. May be helpful to correct the title.

    Is there an env var for disabling build servers? Would be helpful for cross compile.

  6. michaelgsharp commented on Oct 10, 2022

    @michaelgsharp
    Contributor

    @rainersigwald is this related to msbuild?

  7. rainersigwald commented on Oct 10, 2022

    @rainersigwald
    Member

    Very plausibly. dotnet/sdk#28369 disables MSBuild Server for GA. Please try setting the environment variable DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER=1--if that resolves the issue the GA change will also take care of it.

    cc @rokonec

  8. agocke commented on Oct 11, 2022

    @agocke
    Member

    Reproed consistently for me in Ubuntu. After setting the env variable and building once, it seems like things are working again, even after unsetting the environment variable. This might involve some sort of state corruption.

  9. rokonec commented on Oct 11, 2022

    @rokonec
    Member

    @agocke Can you please share with me repro steps?
    I would like to verify that it is known bug to us.

  10. agocke commented on Oct 11, 2022

    @agocke
    Member

    I downloaded the rc-1 tar.gz, extracted it to a local directory (over my preview 5 copy), then simply went to a directory and did dotnet build. Every invocation of MSBuild failed in the same way. I tried deleting a bunch of files -- I even wiped the files I extracted and re-extracted them. That didn't help.

    Interestingly enough, if I extracted the files to a different directory, and tried again, that worked.

    After I found this thread, I then set the environment variable and rebuilt and the problem went away immediately. I then removed the environment variable and tried building again. That also worked.

    There must be some sort of cached information that causes this issue.

  11. mairaw commented on Oct 12, 2022

    @mairaw
    Contributor

    And just to confirm, did you download the Arm64 version since you mentioned you're on Mac M1?

  12. sep2 commented on Oct 12, 2022

    @sep2

    I use the DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER=1 and it works, then I removed the env it failed again. The env is mandatory for a successful build. I'm on archlinux x64.

  13. rainersigwald commented on Oct 12, 2022

    @rainersigwald
    Member

    @sep2 Great. That workaround will no longer be required with the final 7.0.100 SDK (but is still needed for RC2). Sorry for the inconvenience!

  14. agocke commented on Oct 12, 2022

    @agocke
    Member

    Yup I downloaded arm64

  15. devmobasa commented on Nov 2, 2023

    @devmobasa

    Just an FYI— I've been working with .NET Core since its 1.0 days and haven't encountered this issue until now. However, with .NET 8 RC2, the problem surfaced for the first time. Fortunately, setting the DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER environment variable did the trick and resolved the issue.

  16. rainersigwald commented on Nov 2, 2023

    @rainersigwald
    Member

    @rokonec is @ibro's experience expected? I thought server was off by default still.

  17. devmobasa commented on Nov 9, 2023

    @devmobasa

    I'm uncertain whether the DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER environment variable is still relevant to my issue. It seemed to resolve the issue temporarily, but the fix has been hit-or-miss lately.

  18. rokonec commented on Nov 9, 2023

    @rokonec
    Member

    @ibro This is highly unexpected, env var DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER has been deprecated in net8 see https://github.com/dotnet/sdk/blob/62aa4b7c6c2f6fcf673ec2d9aacc8ca07f51913b/src/Cli/Microsoft.DotNet.Cli.Utils/MSBuildForwardingAppWithoutLogging.cs#L19 and is no longer in our codebase at all.
    Please verify that given build is configured for net8 rc2 and if so please provide us with aka.ms/binlog
    I have tested it on net8 rc2 Windows and msbuild server is still off by default - as designed.

  19. devmobasa commented on Nov 20, 2023

    @devmobasa

    Seems to be fine with .NET 8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions