7

I am using dotnet core version 2.1.200.

For my asp.net core application I have following launchSettings.json file:

{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iis": {
      "applicationUrl": "http://localhost/Contoso.Web.Manager",
      "sslPort": 0
    },
    "iisExpress": {
      "applicationUrl": "http://localhost:64802/",
      "sslPort": 44337
    }
  },
  "profiles": {
    "dev": {
      "commandName": "Project",
      "launchBrowser": true,
      "launchUrl": "http://localhost.manager.contoso.com:5000/",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}

when I run dotnet run --launch-profile dev this runs application fine in console, but does not open new browser window.

Am I missing something here?

Docs (Use multiple environments in ASP.NET Core): https://learn.microsoft.com/en-us/aspnet/core/fundamentals/environments?view=aspnetcore-2.1

2
  • 1
    github.com/dotnet/cli/issues/8487 - I think this is an open issue. Commented May 11, 2018 at 7:16
  • @AseemGautam thanks for the reference. Commented May 11, 2018 at 13:53

2 Answers 2

3

You need applicationUrl and launchUrl, eg:

    "dev": {
      "commandName": "Project",
      "launchBrowser": true,
      "launchUrl": "/swagger/",
      "applicationUrl": "http://localhost.manager.contoso.com:5000/",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
Sign up to request clarification or add additional context in comments.

Comments

1

Seems like you should use "applicationUrl" instead of "launchUrl" in your dev profile.

"applicationUrl": "http://localhost.manager.contoso.com:5000/",

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.