0

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:

  • .NET Core Runtime 2.1
  • .NET Core Runtime 3.1
  • .NET Core SDK 3.1.1
  • .NET Core SDK 3.1.4
  • .NET Runtime 5.0
  • .NET SDK 5.0.2
  • .NET SDK 5.0.3
  • ASP.NET Core 3.1.17
  • ASP.NET Core 5.0.8

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.

2
  • Can you link to the guide that you are following? Commented Aug 5, 2021 at 8:33
  • Yes sure, i edited the question with the link, its the official microsoft docs Commented Aug 5, 2021 at 8:37

1 Answer 1

2

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!
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for returning with a solution. You should be able to accept it as the correct answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.