Closed 0xced closed 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.
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.
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.
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. 🙁
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
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.
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.
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.)
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?
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?
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.
@markwilkie any other leads / pointers to the issue being tracked?
Sorry.....I was conflating with the vc tools problem.
Ok, I am closing this as there are no more pending actions from our side.
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:
Expected Behavior
The build should succeed without any error.
Steps To Reproduce
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 ```.\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`1Exceptions (if any)
.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.