Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2022 is unable to start application on docker

Visual studio 2022 is unable to start a ASP.NET Core project on docker, here is what I did:

  • Started VS 2022
  • Created a new project based on template "ASP.NET Core Web App"
  • On the template config, I had defined dotnet 6 and "Enable Docker" to true (Linux, I'm using Win 11 WSL)
  • I have waited the container tools of vs to finish and then, hitted F5 to start the application on docker
  • The error Unable to resolve dotnet core version puped: enter image description here

If I try to browse the URL on browser, I got ERR_EMPTY_RESPONSE

Does the VS2022 template needs some modifications to work? Any help?

What I tried:

  • Troubleshooting https://learn.microsoft.com/en-us/visualstudio/containers/troubleshooting-docker-errors?view=vs-2022
  • Reinstall VS2022
like image 913
Alexandre Avatar asked Dec 08 '25 18:12

Alexandre


1 Answers

I also found this today. For me the solution was to edit my PATH environment variable, re-ordering it so that the 64-bit version of dotnet executable's folder was above the 32-bit one, and then restart VS.

C:\Program Files\dotnet\ needs to be before C:\Program Files (x86)\dotnet\

My understanding is that the first match is used, and the dotnet sdks are not reachable from the alternative architecture.
A symptom of the problem is that calling dotnet --list-sdks returns nothing. By swapping the paths as above, my list command was returning stuff again, (and I could run apps!)

like image 178
ne1410s Avatar answered Dec 11 '25 13:12

ne1410s