3

I have an ASP.NET Core 2 project that uses the UseWebpackDevMiddleware from Microsoft.AspNetCore.SpaServices.Webpack. Unfortunately the aspnet webpack node plugin is complaining about Error: ENOENT: no such file or directory, lstat 'c:\ContainerMappedDirectories'. See NodeJS Issue for details.

There's a workaround, but I can't try it out because I cannot change the docker compose file that Visual Studio is generating. The file they generate under obj\Docker\docker-compose.vs.debug.g.yml, always creates a volume from my project to C:\app, but for the workaround I need it to point to G:\.

Any idea how I can force Visual Studio to use different values when it generates these debugger compose files?

This is what the generated file looks like:

version: '3.6'

services:
  employeemap.app:
    image: employeemapapp:dev
    environment:
      - DOTNET_USE_POLLING_FILE_WATCHER=1
      - NUGET_PACKAGES=C:\.nuget\packages
      - NUGET_FALLBACK_PACKAGES=c:\.nuget\fallbackpackages
    volumes:
      - C:\Users\nswimberghe\projects\EmployeeMap\EmployeeMap.App:C:\app
      - C:\Users\nswimberghe\onecoremsvsmon\15.0.27428.1:C:\remote_debugger:ro
      - C:\Users\nswimberghe\.nuget\packages\:c:\.nuget\packages:ro
      - C:\Program Files\dotnet\sdk\NuGetFallbackFolder:c:\.nuget\fallbackpackages:ro
    entrypoint: C:\\remote_debugger\\x64\\msvsmon.exe /noauth /anyuser /silent /nostatus /noclrwarn /nosecuritywarn /nofirewallwarn /nowowwarn /timeout:2147483646
    labels:
      com.microsoft.visualstudio.debuggee.program: "\"C:\\Program Files\\dotnet\\dotnet.exe\""
      com.microsoft.visualstudio.debuggee.arguments: " --additionalProbingPath c:\\.nuget\\packages --additionalProbingPath c:\\.nuget\\fallbackpackages  bin\\Debug\\netcoreapp2.0\\EmployeeMap.App.dll"
      com.microsoft.visualstudio.debuggee.workingdirectory: "C:\\app"
      com.microsoft.visualstudio.debuggee.killprogram: "C:\\remote_debugger\\x64\\utils\\KillProcess.exe dotnet.exe"

There are other containers in the composer file which I removed for simplicity. Only the employeemap.app should use G:\.

Swimburger
  • 6,681
  • 6
  • 36
  • 63
  • The reason I don't just use my own composer files, is because I want to retain the capability that VS automatically attaches to the debugger after building the composed infrastructure. – Swimburger Apr 04 '18 at 20:34
  • The only workaround I have is to completely recreate the Docker experience myself using PowerShell and a blank Command Line Project to "Run". Check out the following SO post on how to do it: https://stackoverflow.com/a/49803333/2919731 – Swimburger Apr 12 '18 at 18:56

1 Answers1

0

Add new file "docker-compose.vs.debug.yml" to your docker-compose project.

Fill it like this

version: '3.6'

services:
  employeemap.app:
    volumes:
      - .\EmployeeMap.App:G:\
    labels:
      com.microsoft.visualstudio.debuggee.workingdirectory: "G:\\"
rodpl
  • 826
  • 8
  • 12