18

I am getting the following run-time error:

[InvalidOperationException: The current runtime target framework is not compatible with 'TestDeployProject'.

Current runtime Target Framework: 'DNX,Version=v4.5 (dnx45)'
  Type: CLR
  Architecture: x86
  Version: 1.0.0-beta6-12256

Please make sure the runtime matches a framework specified in project.json]

Project settings DNX SDK version:

Solution DNX SDK version

project.json target frameworks:

"frameworks": {
  "dnx46": { }
},

DNVM list:

Active Version     Runtime Architecture OperatingSystem Alias
------ -------     ------- ------------ --------------- -----
       1.0.0-beta6 clr     x64          win
  *    1.0.0-beta6 clr     x86          win             latest
       1.0.0-beta6 coreclr x64          win             default

What could be the problem?

EDIT:

I have tried to use dnx451 as specified in this post. Same problem. The environmental variable also did not help.

Community
  • 1
  • 1
Dave New
  • 38,496
  • 59
  • 215
  • 394
  • Same problem if I change to `dnx451`. I've tried setting the `DNX_IIS_RUNTIME_FRAMEWORK` environmental variable as suggest. – Dave New Jul 31 '15 at 11:38

1 Answers1

15

Look at the dependencies section in your project.json. You will get this error if your ASP.NET packages are not at beta6.

"dependencies": { "Microsoft.AspNet.Mvc": "6.0.0-beta6", "Microsoft.AspNet.Server.IIS": "1.0.0-beta6", "Microsoft.AspNet.Server.WebListener": "1.0.0-beta6", "Microsoft.AspNet.StaticFiles": "1.0.0-beta6", "Microsoft.AspNet.Mvc.Core": "6.0.0-beta6", "Microsoft.AspNet.Cors": "1.0.0-beta6", "Microsoft.Framework.Configuration": "1.0.0-beta6", "Microsoft.Framework.Configuration.Json": "1.0.0-*", ...

Yesterday I upgraded two projects from beta4 to beta6. Accidentally left the dependencies of one at beta4, but with global.json sdk set to beta6, and I got this exact error when running it.

jltrem
  • 12,124
  • 4
  • 40
  • 50
  • This was the problem. Thanks :) – Dave New Aug 02 '15 at 08:27
  • I used File new project, after running dnvm upgrade. I had 75 build errors in the migrations folder when I did a replace all "beta5" with "beta6". Did you run into that? – AlignedDev Aug 25 '15 at 14:44
  • 1
    @Aligned there are many api changes to ASP.NET5 MVC6 as it progresses. Migrating code from one beta version to the next will require addressing these issues. You can find a [list of breaking changes here](https://github.com/aspnet/announcements/issues?utf8=%E2%9C%93&q=) – jltrem Aug 25 '15 at 15:15