DNX:当前的运行时目标框架与项目不兼容 [英] DNX: The current runtime target framework is not compatible with project

查看:146
本文介绍了DNX:当前的运行时目标框架与项目不兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到以下运行时错误:

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]

项目设置DNX SDK版本:

project.json目标框架:

project.json target frameworks:

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

DNVM列表:

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

可能是什么问题?

我尝试使用

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

推荐答案

查看project.json中的dependencies部分.如果您的ASP.NET软件包不在beta6上,则会出现此错误.

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-*", ...

"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-*", ...

昨天我将两个项目从beta4升级到beta6.偶然将一个依赖项留在beta4,但是将global.json sdk设置为beta6,运行它时我得到了确切的错误.

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.

这篇关于DNX:当前的运行时目标框架与项目不兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆