microsoft / DockerTools

Tools For Docker, including Visual Studio Provisioning and Publishing
Other
175 stars 26 forks source link

Compose debugging does not start when app path contains special characters (like umlauts) #338

Closed codekoenig closed 2 years ago

codekoenig commented 2 years ago

I use compose in Visual Studio to start & debug my app. Unfortunately, while the build and compose process seems to succeed without error, debugging was simply not starting without any errors.

After a lot of trial & error I tracked down the issue: my last name contains an Umlaut (ö) and my Windows user profile therefor has an Umlaut in it (..\users\bernhardkönig\).

Here is my docker-compose.yml for my small demo app:

version: '3.4'

services:
  webapplication1:
    image: ${DOCKER_REGISTRY-}webapplication1
    build:
      context: .
      dockerfile: WebApplication1/Dockerfile

Here is the generated docker-compose.vs.debug.g.yml that will contain full paths with the Umlauts in it:

version: '3.4'

services:
  webapplication1:
    image: webapplication1:dev
    container_name: WebApplication1_1
    build:
      target: base
      labels:
        com.microsoft.created-by: "visual-studio"
        com.microsoft.visual-studio.project-name: "WebApplication1"
    environment:
      - DOTNET_USE_POLLING_FILE_WATCHER=1
      - ASPNETCORE_LOGGING__CONSOLE__DISABLECOLORS=true
      - NUGET_FALLBACK_PACKAGES=/root/.nuget/fallbackpackages
    volumes:
      - C:\Users\bernhardkönig\source\repos\WebApplication1\WebApplication1:/app
      - C:\Users\bernhardkönig\source\repos\WebApplication1:/src
      - C:\Users\bernhardkönig\vsdbg\vs2017u5:/remote_debugger:rw
      - C:\Users\bernhardkönig\.nuget\packages\:/root/.nuget/packages:ro
      - C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages:/root/.nuget/fallbackpackages:ro
      - ${APPDATA}/ASP.NET/Https:/root/.aspnet/https:ro
      - ${APPDATA}/Microsoft/UserSecrets:/root/.microsoft/usersecrets:ro

    entrypoint: tail -f /dev/null
    labels:
      com.microsoft.visualstudio.debuggee.program: "dotnet"
      com.microsoft.visualstudio.debuggee.arguments: " --additionalProbingPath /root/.nuget/packages --additionalProbingPath /root/.nuget/fallbackpackages  \"/app/bin/Release/net6.0/WebApplication1.dll\""
      com.microsoft.visualstudio.debuggee.workingdirectory: "/app"
      com.microsoft.visualstudio.debuggee.killprogram: "/bin/sh -c \"if PID=$$(pidof dotnet); then kill $$PID; fi\""
    tty: true

To reproduce:

Due to no errors or warnings or logs I could find, I have no idea where the issue is coming from. But this clue might help: a folder is created for a file named CanonicalServiceNames that clearly has encoding issues (my folder name of choice was tmpsöurce):

image

So it might be related to this file that can't be found at a later point due to the ill encoded path name. But just a guess from my side.

dbreshears commented 2 years ago

Thanks for the repro. Will need to investigate this to see why we are not maintaining the correct encoding

dbreshears commented 2 years ago

@codekoenig . This is fixed and should go out with 17.3 Preview 2 release.

codekoenig commented 2 years ago

@dbreshears wow that was quick, thanks very much, will make sure to test this when it arrives

dbreshears commented 2 years ago

Should be fixed now