Visual Studio 2022 - Debugging 'The requested operation is not supported' scenarios with Docker Containers
Hey everyone, I'm running into an issue that's driving me crazy. I'm having trouble with I'm following best practices but I'm working on a personal project and I'm currently working with an scenario while trying to debug a .NET 6 application that runs within a Docker container in Visual Studio 2022... After setting everything up and running the container, I encounter the behavior message 'The requested operation is not supported' when I attempt to attach the debugger to the running container. I've verified that my Docker setup is correct and that the container is running without issues. Here's the relevant part of my `Dockerfile`: ```dockerfile FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base WORKDIR /app EXPOSE 80 FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build WORKDIR /src COPY [YourProject].csproj . RUN dotnet restore COPY . . WORKDIR /src/. RUN dotnet build -c Release -o /app/build FROM build AS publish RUN dotnet publish -c Release -o /app/publish FROM base AS final WORKDIR /app COPY --from=publish /app/publish . ENTRYPOINT ["dotnet", "[YourProject].dll"] ``` I also made sure to enable Docker Support in the project properties. When I try to debug, Visual Studio appears to start the container successfully, but once I hit the Debug button, it fails with the specified behavior. I've tried restarting Docker, re-creating the container, and even adjusting the launch settings. The `launchSettings.json` file looks like this: ```json { "profiles": { "Docker": { "commandName": "Docker", "launchBrowser": true, "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } } } } ``` Additionally, I checked the Docker logs, and there doesnβt seem to be anything relevant pointing to the source of the behavior. Is there a specific configuration I might be missing, or any known issues regarding debugging with Docker in Visual Studio 2022? Any help would be greatly appreciated! I'm coming from a different tech stack and learning C#. I'm using C# latest in this project. My team is using C# for this desktop app. What would be the recommended way to handle this?