dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.51k stars 10.04k forks source link

Building ASP.NET Core from source fails with an error (MissingMethodException System.Text.Json.JsonDocument System.Text.Json.JsonDocument.Parse) #50479

Closed 0xced closed 1 year ago

0xced commented 1 year ago

Is there an existing issue for this?

Describe the bug

Building ASP.NET Core from source on Windows, following the instructions, fails with this error:

MSB4018: The "InstallDotNetCore" task failed unexpectedly. System.MissingMethodException: Method not found: 'System.Text.Json.JsonDocument System.Text.Json.JsonDocument.Parse(System.ReadOnlyMemory`1, System.Text.Json.JsonDocumentOptions)'. [C:\Users\me.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj]

Expected Behavior

The build should succeed without any error.

Steps To Reproduce

  1. Ensure repository is in a clean state
git rev-parse HEAD ``` 21c81d317c543b74c0974297cfdf0abf0c95b6d2 ```
git submodule status ``` ecc4e18ad7a0c7db51cd7e3d2997a291ed01444d src/submodules/MessagePack-CSharp (v1.7.3-1392-gecc4e18a) 460ae98267b83db4ca2730d368d53f8aee3b636e src/submodules/googletest (release-1.8.0-3367-g460ae982) ```
git status --ignored ``` On branch main Your branch is up to date with 'origin/main'. nothing to commit, working tree clean ```
  1. Restore
.\restore.cmd ``` Building of C# project is enabled and has dependencies on NodeJS projects. Building of NodeJS projects is enabled since node is detected in C:\Users\me\scoop\apps\nodejs-lts. Detected JDK in C:\Users\me\scoop\apps\corretto19-jdk\current (via JAVA_HOME) GET https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.ps1 Attempting to install 'sdk v9.0.100-alpha.1.23421.9' from public location. dotnet-install: Remote file https://dotnetbuilds.azureedge.net/public/Sdk/9.0.100-alpha.1.23421.9/dotnet-sdk-9.0.100-alpha.1.23421.9-win-x64.zip size is 269750497 bytes. dotnet-install: Downloaded file https://dotnetbuilds.azureedge.net/public/Sdk/9.0.100-alpha.1.23421.9/dotnet-sdk-9.0.100-alpha.1.23421.9-win-x64.zip size is 269750497 bytes. dotnet-install: The remote and local file sizes are equal. dotnet-install: Extracting the archive. dotnet-install: Adding to current process PATH: "C:\Projects\dotnet\aspnetcore\.dotnet\". Note: This change will not be visible if PowerShell was run as a child process. dotnet-install: Note that the script does not resolve dependencies during installation. dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install/windows#dependencies dotnet-install: Installed version is 9.0.100-alpha.1.23421.9 dotnet-install: Installation finished Determining projects to restore... Restored C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj (in 243 ms). Determining projects to restore... Restored C:\Projects\dotnet\aspnetcore\eng\tools\GenerateFiles\GenerateFiles.csproj (in 5.08 sec). GenerateFiles -> C:\Projects\dotnet\aspnetcore\artifacts\bin\GenerateFiles\Directory.Build.props GenerateFiles -> C:\Projects\dotnet\aspnetcore\artifacts\bin\GenerateFiles\Directory.Build.targets GenerateFiles -> C:\Projects\dotnet\aspnetcore\.config\dotnet-tools.json GET https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.ps1 Attempting to install runtime toolset 'dotnet/x86 v8.0.0-rc.1.23421.3' from public location. dotnet-install: Remote file https://dotnetbuilds.azureedge.net/public/Runtime/8.0.0-rc.1.23421.3/dotnet-runtime-8.0.0-rc.1.23421.3-win-x86.zip size is 28988343 bytes. dotnet-install: Downloaded file https://dotnetbuilds.azureedge.net/public/Runtime/8.0.0-rc.1.23421.3/dotnet-runtime-8.0.0-rc.1.23421.3-win-x86.zip size is 28988343 bytes. dotnet-install: The remote and local file sizes are equal. dotnet-install: Extracting the archive. dotnet-install: Adding to current process PATH: "C:\Projects\dotnet\aspnetcore\.dotnet\x86\". Note: This change will not be visible if PowerShell was run as a child process. dotnet-install: Note that the script does not resolve dependencies during installation. dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install/windows#dependencies dotnet-install: Installed version is 8.0.0-rc.1.23421.3 dotnet-install: Installation finished Attempting to install runtime toolset 'dotnet/x64 v8.0.0-rc.1.23421.3' from public location. dotnet-install: Remote file https://dotnetbuilds.azureedge.net/public/Runtime/8.0.0-rc.1.23421.3/dotnet-runtime-8.0.0-rc.1.23421.3-win-x64.zip size is 31720133 bytes. dotnet-install: Downloaded file https://dotnetbuilds.azureedge.net/public/Runtime/8.0.0-rc.1.23421.3/dotnet-runtime-8.0.0-rc.1.23421.3-win-x64.zip size is 31720133 bytes. dotnet-install: The remote and local file sizes are equal. dotnet-install: Extracting the archive. dotnet-install: Note that the script does not resolve dependencies during installation. dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install/windows#dependencies dotnet-install: Installed version is 8.0.0-rc.1.23421.3 dotnet-install: Installation finished Determining projects to restore... Restored C:\Projects\dotnet\aspnetcore\eng\tools\RepoTasks\RepoTasks.csproj (in 521 ms). RepoTasks -> C:\Projects\dotnet\aspnetcore\artifacts\bin\RepoTasks\Release\net472\RepoTasks.dll RepoTasks -> C:\Projects\dotnet\aspnetcore\artifacts\bin\RepoTasks\Release\net8.0\RepoTasks.dll Downloading vswhere Downloading RoslynTools.MSBuild 17.1.0 Determining projects to restore... Tool 'dotnet-dump' (version '6.0.322601') was restored. Available commands: dotnet-dump Tool 'dotnet-ef' (version '9.0.0-alpha.1.23421.9') was restored. Available commands: dotnet-ef Tool 'dotnet-serve' (version '1.10.93') was restored. Available commands: dotnet-serve Tool 'microsoft.playwright.cli' (version '1.2.3') was restored. Available commands: playwright Restore was successful. All projects are up-to-date for restore. C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: The "InstallDotNetCore" task failed unexpectedly. [C:\Users\me\.nuget\packages\microsoft.dotnet.arc ade.sdk\8.0.0-beta.23425.2\tools\Tools.proj] C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: System.MissingMethodException: Method not found: 'System.Text.Json.JsonDocument System.Text.Json.JsonDoc ument.Parse(System.ReadOnlyMemory`1, System.Text.Json.JsonDocumentOptions)'. [C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj] C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: [C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj] C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: Server stack trace: [C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\to ols\Tools.proj] C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: at Microsoft.DotNet.Arcade.Sdk.InstallDotNetCore.Execute() [C:\Users\me\.nuget\packages\microsof t.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj] C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args , Object server, Object[]& outArgs) [C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj] C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg) [C:\Users\chlu thc\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj] C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: [C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj] C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: Exception rethrown at [0]: [C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.234 25.2\tools\Tools.proj] C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) [C :\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj] C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) [C:\User s\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj] C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: at Microsoft.Build.Framework.ITask.Execute() [C:\Users\me\.nuget\packages\microsoft.dotnet.arcad e.sdk\8.0.0-beta.23425.2\tools\Tools.proj] C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C: \Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj] C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() [C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj] Build FAILED. C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: The "InstallDotNetCore" task failed unexpectedly. [C:\Users\me\.nuget\packages\microsoft.dotnet.arc ade.sdk\8.0.0-beta.23425.2\tools\Tools.proj] C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: System.MissingMethodException: Method not found: 'System.Text.Json.JsonDocument System.Text.Json.JsonDoc ument.Parse(System.ReadOnlyMemory`1, System.Text.Json.JsonDocumentOptions)'. [C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj] C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: [C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj] C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: Server stack trace: [C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\to ols\Tools.proj] C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: at Microsoft.DotNet.Arcade.Sdk.InstallDotNetCore.Execute() [C:\Users\me\.nuget\packages\microsof t.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj] C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args , Object server, Object[]& outArgs) [C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj] C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg) [C:\Users\chlu thc\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj] C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: [C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj] C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: Exception rethrown at [0]: [C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.234 25.2\tools\Tools.proj] C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) [C :\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj] C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) [C:\User s\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj] C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: at Microsoft.Build.Framework.ITask.Execute() [C:\Users\me\.nuget\packages\microsoft.dotnet.arcad e.sdk\8.0.0-beta.23425.2\tools\Tools.proj] C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C: \Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj] C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() [C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj] 0 Warning(s) 1 Error(s) Time Elapsed 00:00:02.74 Build failed with exit code 1. Check errors above. ```

Exceptions (if any)

C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: The "InstallDotNetCore" task failed unexpectedly. [C:\Users\me\.nuget\packages\microsoft.dotnet.arc ade.sdk\8.0.0-beta.23425.2\tools\Tools.proj]
C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: System.MissingMethodException: Method not found: 'System.Text.Json.JsonDocument System.Text.Json.JsonDoc ument.Parse(System.ReadOnlyMemory`1<Byte>, System.Text.Json.JsonDocumentOptions)'. [C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj]
C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018:  [C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj]
C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: Server stack trace:  [C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\to ols\Tools.proj]
C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018:    at Microsoft.DotNet.Arcade.Sdk.InstallDotNetCore.Execute() [C:\Users\me\.nuget\packages\microsof t.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj]
C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018:    at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args , Object server, Object[]& outArgs) [C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj]
C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018:    at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg) [C:\Users\chlu thc\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj]
C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018:  [C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj]
C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018: Exception rethrown at [0]:  [C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.234 25.2\tools\Tools.proj]
C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018:    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) [C :\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj]
C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018:    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) [C:\User s\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj]
C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018:    at Microsoft.Build.Framework.ITask.Execute() [C:\Users\me\.nuget\packages\microsoft.dotnet.arcad e.sdk\8.0.0-beta.23425.2\tools\Tools.proj]
C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [C: \Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj]
C:\Users\me\.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets(15,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() [C:\Users\me\.n uget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\Tools.proj]

.NET Version

9.0.100-alpha.1.23421.9 (downloaded by the restore script)

Anything else?

Note that this issue only happens on Windows (22H2 OS Build 19045.3324). On macOS, I was able to successfully run the restore.sh command.

dotnet --info

Host:
  Version:      8.0.0-preview.7.23375.6
  Architecture: x64
  Commit:       65b696cf5e
  RID:          win-x64

.NET SDKs installed:
  3.1.426 [C:\Program Files\dotnet\sdk]
  5.0.408 [C:\Program Files\dotnet\sdk]
  6.0.413 [C:\Program Files\dotnet\sdk]
  7.0.400 [C:\Program Files\dotnet\sdk]
  8.0.100-preview.7.23376.3 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.0-preview.7.23375.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0-preview.2.23128.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0-preview.7.23375.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.0-preview.7.23376.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  C:\Projects\dotnet\aspnetcore\global.json

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download
BrennanConroy commented 1 year ago

This is likely because you're using a version of VS that doesn't support the SDK. Use 17.7 GA or 17.8 previews.

0xced commented 1 year ago

I tried with VS 2022 17.7.0, then upgraded to 17.7.3 but it did not make a difference. It failed with the same error. I'm not really surprised since the restore script downloads its own versions of the SDKs. The error seems to be coming from the Arcade SDK (.nuget\packages\microsoft.dotnet.arcade.sdk\8.0.0-beta.23425.2\tools\InstallDotNetCore.targets) so maybe I should file an issue there.

martincostello commented 1 year ago

Have you built it from source previously in this release cycle in the same repo clone? Sometimes stuff gets left over in the .dotnet folder from previous SDK versions that creates conflicts. If so, try nuking that folder and resyncing the source.

I also find that sometimes VS will error when trying to build unless you've built the .slnf you want to open on the CLI first.

0xced commented 1 year ago

I have performed git clean -fdx to make sure that the repository is in the same state as if I had done a fresh clone.

(This is why I have reported the output of git status --ignored in my original report but I could have been more clear about this!)

I also find that sometimes VS will error when trying to build unless you've built the .slnf you want to open on the CLI first.

I haven't even tried to open a .slnf file yet since the restore script failed. 🙁

wtgodbe commented 1 year ago

We see this error sometimes when you have missing VS Components (It sounds like you have the right version of VS, but maybe not all the required components). Did you follow the instructions in https://github.com/dotnet/aspnetcore/blob/main/docs/BuildFromSource.md? Particularly the portion about running InstallVisualStudio.ps1

ghost commented 1 year ago

Hi @0xced. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

ghost commented 1 year ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

See our Issue Management Policies for more information.

0xced commented 1 year ago

An issue was already filed in the Arcade repository: https://github.com/dotnet/arcade/issues/13874 It suggests to reinstall Visual Studio. I first tried to repair my installation but it did not work. Then I fully uninstalled and re-installed Visual Studio but it did not work either. Finally, I tried to use a Developer Command Prompt for VS 2022 instead of a standard command prompt and it worked! (Well, until I got issues building the NodeJS part because of network proxy issues.)

mkArtakMSFT commented 1 year ago

Glad that you were able to find a solution, @0xced. @dotnet/dnceng do you know why building from command prompt wouldn't find needed build tools while VS Command Prompt will?

markwilkie commented 1 year ago

I believe this is a known issue with the VS install that we're trying to track down with VS. @garath - do you have an update by any chance?

garath commented 1 year ago

I believe this is a known issue with the VS install that we're trying to track down with VS.

Sorry, I'm not familiar with any issue like this.

mkArtakMSFT commented 1 year ago

@markwilkie any other leads / pointers to the issue being tracked?

markwilkie commented 1 year ago

Sorry.....I was conflating with the vc tools problem.

wtgodbe commented 1 year ago

Ok, I am closing this as there are no more pending actions from our side.