DNX: The current runtime target framework is not compatible with project
Asked Answered
S

1

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.

Swarey answered 31/7, 2015 at 11:6 Comment(1)
Same problem if I change to dnx451. I've tried setting the DNX_IIS_RUNTIME_FRAMEWORK environmental variable as suggest.Swarey
C
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.

Candace answered 31/7, 2015 at 13:6 Comment(3)
This was the problem. Thanks :)Swarey
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?Messier
@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 hereCandace

© 2022 - 2024 — McMap. All rights reserved.