recently I've tried to make Visual Studio 2022 work with Docker containers on WSL2.
My idea was to do a docker-compose up in my project's folder from WSL2. It runs well. Then I use d the WSL profile from VS to debug my project (by modifying the launchUrl and the ASPNETCORE_URLS properties in the WSL profile from launchSettings.json, in order to reach the running container from WSL2.
Currently I'm able to reach and debug my container but at the app.Run() instruction I get a System.Net.Sockets.SocketException: 'Permission denied'.
What could it be?
Did anyone try to make Visual Studio (not VSCode) work (=debug) with Docker and WSL2?
I didn't find any information on this case except from this good post: https://medium.com/@frcs6b/docker-engine-on-wsl-visual-studio-2019-without-docker-desktop-dfdbef353350
So any help is very welcome! :-)