1

I am trying to get an MVC 6 web application up and running using the .NET 4.6 CLR, but I get the following kind of errors:

The dependency Microsoft.AspNet.Loader.IIS 1.0.0-beta5 in project TestDeployProject does not support framework .NETFramework,Version=v4.6.

project.json:

{
  "dependencies": {
    "Microsoft.AspNet.Server.IIS": "1.0.0-beta5",
    "Microsoft.AspNet.Server.WebListener": "1.0.0-beta5",
    "Microsoft.AspNet.Diagnostics": "1.0.0-beta5",
    "Microsoft.Framework.DependencyInjection.Abstractions": "1.0.0-beta5",
    "Microsoft.AspNet.Mvc": "6.0.0-beta5"
  },
  "frameworks": {
    "net46": { }
  },
}

Reference issues .NET Framework 4.6

According to this blog post, the .NET 4.6 target framework does work with ASP.NET 5.

What am I doing wrong?

Dave New
  • 38,496
  • 59
  • 215
  • 394

1 Answers1

5

Unlike most Microsoft.Framework.* projects (like Caching for instance: https://github.com/aspnet/Caching/blob/dev/src/Microsoft.Framework.Caching.Abstractions/project.json#L7), Microsoft.AspNet.* packages only work with the "dnx-flavored" .NET Framework: if you want to use these packages in your own project, remove net46 and add a new dnx46 TFM and it should work.

Note that you'll need a recent DNX runtime version to use dnx46: don't hesitate to migrate to the latest nightly versions.

Kévin Chalet
  • 39,509
  • 7
  • 121
  • 131