No project found when I opened file .sln in ASP.NET core

106 Views Asked by At

I have created a solution and a project in dotnet cli. When I open the solution, I do not find the project in side the solution.

Following image indicates 0 project in solution in Visual Studio: when I open that file

Following image shows folder structure: Folder constant my project

Here is my creation steps using dotnet cli:

dotnet new globaljson --sdk-version 6.0.100 --output LanguageFeatures
dotnet new web --no-https --output LanguageFeatures --framework net6.0
dotnet new sln -o LanguageFeatures
dotnet sln LanguageFeatures add LanguageFeatures
1

There are 1 best solutions below

2
On

You have created empty solution, and you can create one to more projects and associate them with the solution.

In your situation, you are missing adding the project to the solution.

The solution in your case, you need to use dotnet cli to add project to solution like this:

cd LanguageFeatures
dotnet sln LanguageFeatures.sln add LanguageFeatures.csproj

This answer in inspired by this answer.