Reputation: 2725
How do I get my project to work when it says in the solution explorer Solution 'solution name' (0 projects) and below that it says 'project name' (unavailable)?
Upvotes: 11
Views: 20847
Reputation: 752
Basically, the solution (in my case) was the following:
Windows => Edit Environmental Variables => System Variables => Path
And there, for some reason, I had two path to donet. C:\Program Files\dotnet and C:\Porgram Files (x86)\dotnet. I deleted the later and now everything works!
Now close the Visual studio and open the project, it will now load the project.
WHAT TO MODFY: https://imgur.com/YnsXDKY
Upvotes: 0
Reputation: 1
17- May - 2024 I had the same issue, none of the above solutions fixed the problem, so I tried repairing Visual Studio from the installer , then a restart for the PC was required. reopen a project on Visual Studio then right click on the solution , add existing project , Then right click on the project , properties , Single Start up project menu , then select your project name , then click ok.
Upvotes: 0
Reputation: 11
The solution was looking for the project under C:\Users<username>\source\repos and the project was saved in a different folder from the solution.
I solved the problem by right clicking on the solution in the "Solution Explorer" and then selecting "Add -> Existing Project..." and browsed to where my .csproj file was saved.
Upvotes: 1
Reputation: 1
go to
C:\Program Files (x86)\dotnet
and check if sdk is installed if is not installed, copy sdk file from C:\Program Files\dotnet
and Paste it to directory C:\Program Files (x86)\dotnet
Upvotes: 0
Reputation: 31
its all about PATH Right click on This PC -> Properties -> Advanced System Settings -> Advanced -> Environment Variables -> System Variables
Check you install path , most probably it will be as follow Variable value >> C:\Program Files\dotnet and remove "C:\Program Files (x86)\dotnet" and all is good
Upvotes: 3
Reputation: 21
In my case path is present over thier and i just move it upward Right click on This PC -> Properties -> Advanced System Settings -> Advanced -> Environment Variables -> System Variables
in my case their are two path available , one is of program file and another one is program file(86) and i just move program file path up.
Upvotes: -1
Reputation: 478
In my case there was a system variable missed, adding that worked for me.
Right click on This PC -> Properties -> Advanced System Settings -> Advanced -> Environment Variables -> System Variables
Check you install path , most probably it will be as follow
Variable value >> C:\Program Files\dotnet
Variable name >> path
Upvotes: 0
Reputation: 103
I thought it would be worth mentioning my case, there wasn't an option to reload based on the current correct answer probably because you somewhat had a project and also considering the age of this forum. So apparently visual studio didn't download the .net core sdk, which is quiet odd and caused me to have 0 projects, so if you add an existing project you'll get an error, so what i had to do was just download the files from here: https://dotnet.microsoft.com/download/dotnet But of course depending on which project you make, you might require different files the error you get will give you information on what files you need.
Upvotes: 1
Reputation: 1093
try this:
Best Regard.
Upvotes: 9
Reputation: 1
I had right click the solution and selected "go back git" option and then it canceled the last changes and the project reloaded suddenly. So it seems ok for now.
Upvotes: -1
Reputation: 9
What I've done that solved my issue was simply right click on the project name then select undo changes
Upvotes: 0
Reputation: 721
for me the Accepted Answer did not fix it, I went back through my commit history
and got the last ver. that was working,
That fixed it. Hope this helps others that have this problem.
Upvotes: 1
Reputation: 2725
All I had to do to get this working is I had to right click the project
and click reload project
. Somehow my project got unloaded. When your circumstances look like this, it is possible that this happened.
Upvotes: 6