question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot build solution in Visual Studio 2019

See original GitHub issue

I 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

installimg1 installimg2

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:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
arphoxcommented, Jan 23, 2020

After I installed the .NET Core 2.1.504 x64 package, I could build the solution. Thank you so much for your help!

0reactions
jnm2commented, Jan 23, 2020

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Doesn't My Visual Studio Solution Build? A ...
By all means try it but don't be surprised when the solution still stubbornly refuses to build.
Read more >
VS2019 can't build any project
I have just installed VS2019 Version 16.7.4. I can't compile any c# project (WinForms, WPF and Console application ).
Read more >
Visual Studio 2019 Cannot build solutions that are in ...
Provided VS was properly installed you can put your solution folder anywhere. Open VS and open the solution, then do a build. The...
Read more >
Can't build solution with Visual Studio (2019 version 16.8)
Check out master · Open in Visual Studio 2019 16.8+ · (optional) Clean Solution · (Re)Build complete solution ...
Read more >
Visual Studio 2019 build doesn't complete
I am using Visual Studio Professional 2019 Version 16.9.4. Suddenly I am not able to build a particular WPF .NET Framework project anymore....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found