Search code examples
visual-studiodocker.net-framework-version

Command line arguments to dockerized lagacy NET framework project while debugging with Visual Studio 2019


I'm trying to debug a dockerized VS2019 .NET framework solution with two console apps.

The problem is that both projects require startup arguments but neither the ENTRYPOINT of Dockerfile, or entrypoint in docker-compose.yml seem to have effect on starting debugged projects.

This is a sample of my docker-compose.yml:

version: '3.4'

services:
  ejossrv:
    image: ${DOCKER_REGISTRY-}ejossrv
    build:
      context: .\ejossrv
      dockerfile: Dockerfile
    entrypoint: ["C:\\app\\bin\\Debug\\ejossrv.exe","-p","1954"]
  proksi:
    image: ${DOCKER_REGISTRY-}proksi
    build:
      context: .\proksi
      dockerfile: Dockerfile
    entrypoint: ["C:\\app\\bin\\Debug\\proksi.exe","-p","1954"]
  #rabbit1:

Any clues?


Solution

  • The answer is in com.microsoft.visualstudio.debuggee.arguments property. This is a working sample:

    version: '3.4'
    
    services:
      ejossrv:
        image: ${DOCKER_REGISTRY-}ejossrv
        build:
          context: .\ejossrv
          dockerfile: Dockerfile
        labels:      
          com.microsoft.visualstudio.debuggee.arguments: " -p 1954"
        platform: windows
        depends_on:
          - rabbit1
      proksi:
        image: ${DOCKER_REGISTRY-}proksi
        build:
          context: .\proksi
          dockerfile: Dockerfile
        labels:      
          com.microsoft.visualstudio.debuggee.arguments: " -p 1954"
        platform: windows
        depends_on:
          - rabbit1