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:
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://docs.microsoft.com/en-us/visualstudio/containers/troubleshooting-docker-errors?view=vs-2022
- Reinstall VS2022
CodePudding user response:
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.
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!)