0

I'm working on a team where some people use VisualStudio, and others use Rider. We've recently dockerized our application, and we're able to run the app just fine in VisualStudio with the following launchsettings.json.

{
  "profiles": {
    "MyApp - Project: {
      "commandName": "Project",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "testing"
      },
      "applicationUrl": "https://localhost:57787;http://localhost:57788"
    },
    "MyApp - Docker": {
      "commandName": "Docker",
      "launchBrowser": true,
      "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "testing"
      },
      "sslPort": 5003,
      "httpPort": 5002
    }
  }
}

When we run this in VisualStudio, we end up successfully getting the environment variable set to testing.

However, when we're trying to get our Rider users setup, we get an incorrect environment variable - Development.

I know that I could drop the Environment Variables into the configuration itself, like below, but we have a number of other environment variables on our launchSettings.json that get automatically generated each morning, so I really need this to work like it does in VS, where the Environment Variables come in on the LaunchSettings.json and get read from there into the Docker container.

enter image description here

I also know that if I run it under my other PR using the .NET Launch Settings Profile, it DOES read from the launch settings...

Is there any way to make Rider work where it uses the LaunchSettings to both run the Docker image AND attach the associated Environment Variables?

2 Answers 2

1

Rider is not fully compatible with the Docker configuration in launchSettings.json at the moment. See this ticket for details:

RIDER-104672 Docker run launch profile showing as incorrect

Manage your Docker configurations in .run could be the best solution here.

Sign up to request clarification or add additional context in comments.

Comments

0

I just hit a similar issue, so I duplicated the settings. If you click "Store as project file". it will save the rider launch settings in a .run folder, In here, you can edit the Environment variables to match launchsettings.json

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.