2
votes

I am creating an ASP.NET 5 Web API application that I want to host in Azure as a Web App. I want to target only dnxcore50 framework, but it seems that Azure Web App uses full DNX CLR when running ASP.NET 5 applications:

enter image description here

Because of that my application has to target both dnxcore50 and dnx451 frameworks. When I target only dnxcore50 I get an deployment error saying that my app doesn't support full DNX CLR:

The project being published does not support the runtime dnx-CLR-win-x86.1.0.0-rc1-final

I found a post from 2014 that suggests that there is an *.ini file in the approot folder that can be modified to change the CLR version, but I can't find it.

Is there a way to run an ASP.NET 5 app as Azure Web App using CoreCLR?

2

2 Answers

4
votes

When you publish using dnu publish, pass the argument --runtime <name of runtime> to specify what runtime to use or --framework <name of framework> to specify a framework.

The difference between the two is that --framework doesn't include the runtime in the output package folder.

0
votes

To make this work with GitHub deploy (and presumably other deployment mechanisms) add a global.json to the root of your repository with the following (update the version as appropriate)

{
  "sdk": {
    "version": "1.0.0-rc1-update2",
    "runtime": "coreclr"
  }
}