RandomProgrammer
RandomProgrammer

Reputation: 21

ASP.Net Core WebApi Project creates an empty solution

I am trying to create a ASP.Net Core WebAPI application, i installed every sdk and runtime i was told to.

I then go into Visual Studio and create the Project from the ProjectCreator. What I end up with is an empty solution and a project in the specified directory that i cannot open, with the error message the Project cannot be opened because it couldnt find a fitting sdk (btw, creating it with .netCore3.1)

Heres a list of my installed sdks/runtimes:

This is what my solution explorer looks like tho the csproj is correctly placed

Whats seems to be the problem? Too many runtimes/sdk? Are they overriding each other? Visual Studio cannot choose? I am baffled, this should work :/

[Edit1] This is the guide I am following: https://learn.microsoft.com/de-de/aspnet/core/tutorials/first-web-api?view=aspnetcore-5.0&tabs=visual-studio

[Edit2] I found a command that lets you see every sdk and runtime the dotnet/cli can access/see

(dotnet --info) Looks like dotnet doesnt seem to find an sdk i installed

[Edit3] I tried to manually install the .net core SDK 3.1 binaries into the C:\ProgramFiles\dotnet folder, but to no avail, dotnet --info still doesnt recognize the SDK

[Edit4] I got it working, I will post the solution as an answer.

Upvotes: 0

Views: 746

Answers (1)

RandomProgrammer
RandomProgrammer

Reputation: 21

Heres what I did:

  1. I uninstalled my Visual Studio IDE with the Visual Studio Installer
  2. I uninstalled every .NET (Core) SDK and .NET (Core) Runtime
  3. I did a fresh Visual Studio install with only the components i really need

    After that I checked the dotnet --info command and there was it, 2 SDKs were installed. When I create the WebAPI Project now, the Solution Explorer has a project and I can finally see all files. This was weird. Thanks everyone tho!

Upvotes: 2

Related Questions