Search code examples
asp.net-corednxkestrel-http-server

How does web server chooses framework (dnx451 vs dnxcore50)


I have this setup in project.json:

"frameworks": {
    "dnx451": { },
    "dnxcore50": { }
},

When I run the application either in Kestrel ("web" command) or in the IIS Express, how do they know which framework to use out of those 2, how does it chose .net framework or the dnx.


Solution

  • For IISExpress it will use the settings in launchSettings.json in the Properties folder of the web app.

    If you launch the web command using VS (ie debugging) I think it will also use settings from that file.

    But if you use the web command from the command line without VS I think it will use the default runtime from your user profile as shown by the dnvm list command.

    Example launchSettings.json from my project:

    {
      "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:54671/",
      "sslPort": 0
    }
      },
      "profiles": {
        "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNET_ENV": "Development"
      },
      "sdkVersion": "dnx-coreclr-win-x86.1.0.0-rc1-update1"
    },
    "web": {
      "commandName": "web",
      "environmentVariables": {
        "Hosting:Environment": "Development"
      },
      "sdkVersion": "dnx-coreclr-win-x86.1.0.0-rc1-update1"
    }
    }
    }