aspnet / Tooling

Issue tracker and info on Visual Studio tooling for ASP.NET
Other
256 stars 124 forks source link

launch profiles with command name "Project" crash / don't work in VS 2017 #943

Closed EricBourland closed 7 years ago

EricBourland commented 7 years ago

Given this in launchsettings.json

"profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "launchUrl": "http://localhost:49731",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "console": {
      "commandName": "Project",
      "launchUrl": "http://localhost:5000",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }

The first profile will work correctly, the second one will crash when you try to debug the project and give this error in VS2017: image

It also fails to attach the javascript debugger.

EricBourland commented 7 years ago

I figured out that this is happening because in the project properties window if you set the launch Url, it adds the launchUrl property to the profile, but this is incorrect. Instead it should add an "applicationUrl" property, so your launchsettings.json should look like this:

"profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "launchUrl": "http://localhost:49731",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "console": {
      "commandName": "Project",
      "applicationUrl": "http://localhost:5432",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
mlorbetske commented 7 years ago

TFS Bug#369165

barrytang commented 7 years ago

This is fixed in the upcoming update to the VS 2017 RC.