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

霸气de小男生 提交于 2019-12-08 14:39:47

问题


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:

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.


回答1:


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.



来源:https://stackoverflow.com/questions/31744682/dnx-the-current-runtime-target-framework-is-not-compatible-with-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!