Cannot build solution in Visual Studio 2019
See original GitHub issueI cannot build the StyleCopAnalyzers
solution using my installation of Visual Studio 2019 Community.
I downloaded the (now) latest commit (b15704e), opened StyleCopAnalyzers.sln
, and all projects failed to load.
When I try to manually reload the StyleCop.Analyzers
project, an error messagebox appears with the message “The operation could not be completed” and meanwhile I see the following errors in Solution tab of Output window:
e:\prog\repos\StyleCopAnalyzers\StyleCop.Analyzers\StyleCop.Analyzers\StyleCop.Analyzers.csproj : error : The project file cannot be opened by the project system, because it is missing some critical imports or the referenced SDK cannot be found.
Detailed Information:
Unable to locate the .NET Core SDK. Check that it is installed and that the version specified in global.json (if any) matches the installed version.
I have tried to fix the problem by looking at the targeted frameworks for projects, e.g. netstandard1.1;net452
in case of StyleCop.Analyzers
, but I did not find any .NET Core references that would be missing.
I have most components installed in VS19 installer, click for images
So I don’t understand what could be missing that is related to .NET Core. I did not want to blindly install all legacy .NET Core versions so I am writing this issue.
Also, a “Building” part for the README would be really useful to avoid problems like this.
- VS version: Microsoft Visual Studio Community 2019 Version 16.4.3
- Result of
dotnet --list-sdks
:
2.1.801 [C:\Program Files\dotnet\sdk]
2.1.802 [C:\Program Files\dotnet\sdk]
2.2.402 [C:\Program Files\dotnet\sdk]
3.1.101 [C:\Program Files\dotnet\sdk]
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
After I installed the
.NET Core 2.1.504 x64
package, I could build the solution. Thank you so much for your help!@sharwell There’s finally documentation: https://docs.microsoft.com/en-us/dotnet/core/tools/global-json?tabs=netcore3x#rollforward
I’ve been seeing
"rollForward": "feature"
the most.