Home > Enterprise >  unable to resolve dot net core version - visual studio
unable to resolve dot net core version - visual studio

Time:10-25

I am facing this error since I restarted the system. I am not sure what went wrong. I have restarted my system many times. Please help.

enter image description here

CodePudding user response:

Is this happening when you open a solution / project or when you just open visual studio with a blank solution ?

You could try deleting your global.json file (or rename it so you have a backup), that should ensure you use the latest sdk installed.

If that does not work, try running

dotnet --list-sdks 

and

dotnet --list-runtimes

and update your question with the info.

If you want to run a specific SDK version, post your global.json as well.

CodePudding user response:

Either your dot net core installation has a problem, or the project settings are messed up.

Based on my experience, you should do the following (in order, in case one step doesn't work, go to the next one).

  1. Create an empty dot net core project and print something. If it works, then your dot net core installation is correct.
  2. Check the project settings (right click on the project, properties). Check that it has the correct dot net version. Are you sure it was originally a dot net core project and not a dot net framework? Change it to the correct version if necessary.
  3. If nothing works, create a new project with the same dot net core version as the one you did in Step 1, and copy your files. Sometimes Visual Studio settings get messed up inside a project.

Hope this helps!

  • Related