3

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:

Alexandre
  • 7,004
  • 5
  • 54
  • 72

1 Answers1

5

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!)

Peter Morris
  • 20,174
  • 9
  • 81
  • 146
ne1410s
  • 6,864
  • 6
  • 55
  • 61
  • 1
    It worked :) Tku. More info about the problem: https://stackoverflow.com/questions/63746838/net-sdks-not-installing-correctly – Alexandre Nov 09 '21 at 21:30