Daniel L. VanDenBosch
Daniel L. VanDenBosch

Reputation: 2725

Visual Studio Solution shows (0 projects)

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

Answers (13)

codelone
codelone

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

Ahmed Alaa
Ahmed Alaa

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

Linda Belebesi
Linda Belebesi

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

Ramzi Allia
Ramzi Allia

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

bnoor
bnoor

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

amol
amol

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

Rizwan Ali Sabir
Rizwan Ali Sabir

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

Shayan Razavi
Shayan Razavi

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

D.L.MAN
D.L.MAN

Reputation: 1093

try this:

  • right click on the solution name
  • select 'Add'
  • select 'Existing Project'
  • in browser window go to your project folder and select 'YourProjectName.csproj' file (.csproj file of project)
  • and the project will be added! so Done!

Best Regard.

Upvotes: 9

Mehmet Kahraman
Mehmet Kahraman

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

Abdelah
Abdelah

Reputation: 9

What I've done that solved my issue was simply right click on the project name then select undo changes

Upvotes: 0

Roshna Omer
Roshna Omer

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

Daniel L. VanDenBosch
Daniel L. VanDenBosch

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

Related Questions