Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Configure Vs like VScode #290

Open
giulioungaretti opened this issue Feb 23, 2020 · 4 comments
Open

Configure Vs like VScode #290

giulioungaretti opened this issue Feb 23, 2020 · 4 comments

Comments

@giulioungaretti
Copy link

Is your feature request related to a problem? Please describe.
Hi folks,
I have an ok complex project (fsharp and orleans) that I managed to run with devspaces using vscode! It just needs a bit more effort than the usual due to the non standard location of some things! I would want to replicate the config in vs ! I can't figure out how tho!

The structure of the project is:
root:

  • azds.yaml

  • charts/etc

  • secrets.dev.yaml

  • dockerfile

  • dockerfile.develop

  • src

    • data/ this contains domaindata.fs and fsproj
    • server/ this contains the webapp (netcore web host)

The docker container knows how to deal with this
and azds.yaml has the following:

configurations:
  develop:
    build:
      dockerfile: Dockerfile.develop
      useGitIgnore: true
      args:
        BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug}
    container:
      sync:
        - "!**/*.{sln,fsproj}"
      command:
        [
          dotnet,
          run,
          --no-restore,
          --no-build,
          --no-launch-profile,
          -c,
          "${BUILD_CONFIGURATION:-Debug}",
          "--project",
          "./src/Server",
        ]
      iterate:
        processesToKill: [dotnet, vsdbg, Server]
        buildCommands:
          - [
              dotnet,
              build,
              --no-restore,
              -c,
              "${BUILD_CONFIGURATION:-Debug}",
              "./src/Server",
            ]

Then I configured vscode like this:

        {
            "name": ".NET Core Launch (AZDS)",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "azds: prelaunch",
            "pipeTransport": {
                "pipeCwd": "${workspaceFolder}",
                "pipeProgram": "azds",
                "pipeArgs": [
                    "exec",
                    "--interactive",
                    "--on-exit-resume-up",
                    "--verbose",
                    "--"
                ],
                "debuggerPath": "/vsdbg/vsdbg",
                "quoteArgs": false
            },
            "cwd": "/src/src/Server",
            "program": "/src/src/Server/bin/Debug/netcoreapp3.0/Server.dll",
            "sourceFileMap": {
                "/src": "${workspaceFolder}"
          }}

Now I just need to
azds daemon --import azds/azds-vsdbg:15.3@/vsdbg:/vsdbg in the workspace root and hit f5 in vscode and all is nice!

Is there a way to get to the same config in vs?

Thank you

@amsoedal
Copy link
Collaborator

Hi @giulioungaretti, is there a reason you'd prefer to use VS to VSCode?

@giulioungaretti
Copy link
Author

@amsoedal a few reasons 🐱‍👤

  • A minor one is that is the vim emulation in VS works better than VSCode
  • VS can handle mixed Lang solutions (f# and c#) where as VSCode can't
  • And in my team some folks use VS because they are more familiar

:D

@dbreshears
Copy link

@giulioungaretti. Do you happen to have a minimal project structured this way and we could investigate what issues the VS tooling might have with the custom layout. I know by default with a new FS web project in VS we scaffold .csproj in Dockefile.develop as we have only supported c# until now.

@giulioungaretti
Copy link
Author

@dbreshears I'll try to compile one!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants