Error on start after ASP.NET Core project upgraded from Visual Studio 2015 to Visual Studio 2017 RC

After upgraded an ASP.NET Core Web Application project from Visual Studio 2015 to the new Visual Studio 2017 RC, I've got an error in every start before Program.Main gets hit, with a dialog show the error message :

Object reference not set to an instance of an object.

Once I've clicked on the OK button, the execution continues and Program.Main was call normally.

The problem is a bug in the upgrade tools of Visual Studio 2017 RC, who doesn't handle a modification in the format of the Properties/launchSettings.json file.

In Visual Studio 2015, this file looks like :


{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:15174/",
      "sslPort": 0
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "WebApplication2": {
      "commandName": "Project",
      "launchBrowser": true,
      "launchUrl": "http://localhost:5000/home",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}

In Visual Studio 2017 RC, you have to add the node applicationUrl in your profile. It's become :


    "WebApplication2": {
      "commandName": "Project",
      "launchBrowser": true,
      "launchUrl": "home",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
      "applicationUrl": "http://localhost:15174"
    }
16/12/2016
  • ASP.NET Core
  • launchSettings.json
  • Visual Studio 2017 RC