本文介绍了ASP.NET 5(vNext)Web项目:库冲突升级,从BETA4到beta6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我升级DNVM与 dnvm升级-Unstable 。运行 dnvm列表显示这是积极的:1.0.0-beta6-12120

I upgraded DNVM with dnvm upgrade -Unstable. Running dnvm list shows this to be active: 1.0.0-beta6-12120.

我创建使用网站上的ASP.NET 5 preVIEW模板创建一个新项目,并证实它会建立。

I created a new project using the ASP.NET 5 Preview Template for Web Site and verified that it would build.

我改变了project.json参考​​beta6:

I changed the project.json to reference beta6:

"dependencies": {
  "EntityFramework.SqlServer": "7.0.0-beta6",
  "EntityFramework.Commands": "7.0.0-beta6",
  "Microsoft.AspNet.Mvc": "6.0.0-beta6",
  "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta6",
  "Microsoft.AspNet.Authentication.Cookies": "1.0.0-beta6",
  "Microsoft.AspNet.Authentication.Facebook": "1.0.0-beta6",
  "Microsoft.AspNet.Authentication.Google": "1.0.0-beta6",
  "Microsoft.AspNet.Authentication.MicrosoftAccount": "1.0.0-beta6",
  "Microsoft.AspNet.Authentication.Twitter": "1.0.0-beta6",
  "Microsoft.AspNet.Diagnostics": "1.0.0-beta6",
  "Microsoft.AspNet.Diagnostics.Entity": "7.0.0-beta6",
  "Microsoft.AspNet.Identity.EntityFramework": "3.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.Tooling.Razor": "1.0.0-beta6",
  "Microsoft.Framework.Configuration.Json": "1.0.0-beta6",
  "Microsoft.Framework.Configuration.UserSecrets": "1.0.0-beta6",
  "Microsoft.Framework.CodeGenerators.Mvc": "1.0.0-beta6",
  "Microsoft.Framework.Logging": "1.0.0-beta6",
  "Microsoft.Framework.Logging.Console": "1.0.0-beta6"
}

但构建失败,运行时库冲突:

But the build fails with runtime library conflicts:


1> MSBUILD:DNX 4.5.1错误CS0433:类型'AssemblyFileVersionAttribute存在于两个'mscorlib程序,版本= 4.0.0.0,文化=中性公钥= b77a5c561934e089'和'System.Runtime,版本= 4.0.20.0,文化=中性公钥= b03f5f7f11d50a3a
1> MSBUILD:DNX 4.5.1错误CS0433:类型'AssemblyVersionAttribute存在于两个'mscorlib程序,版本= 4.0.0.0,文化=中性公钥= b77a5c561934e089'和'System.Runtime,版本= 4.0.20.0,文化=中性公钥= b03f5f7f11d50a3a
1> MSBUILD:DNX 4.5.1错误CS0433:类型'AssemblyInformationalVersionAttribute存在于两个'mscorlib程序,版本= 4.0.0.0,文化=中性公钥= b77a5c561934e089'和'System.Runtime,版本= 4.0.20.0,文化=中性公钥= b03f5f7f11d50a3a
1> MSBUILD:DNX 4.5.1错误CS0518:predefined类型'System.String'未定义或导入
1> MSBUILD:DNX 4.5.1错误CS0518:predefined类型'System.String'未定义或导入
1> MSBUILD:DNX 4.5.1错误CS0518:predefined类型'System.String'未定义或导入
1> MSBUILD:DNX 4.5.1错误CS0518:predefined型'System.Void没有定义或导入
1> MSBUILD:DNX 4.5.1错误CS0518:predefined型'System.Void没有定义或导入
1> MSBUILD:DNX 4.5.1错误CS0518:predefined型'System.Boolean'未定义或导入

这怎么解决?

推荐答案

在您project.json文件(S),请尝试使用 beta6 - * ,而不是仅仅 beta6 。这意味着它会引用这些文件的最新版本是

beta6-*

In your project.json file(s), try using beta6-* instead of just beta6. That means it will reference the most recent build of it.

检查哪些运行目录在 C:\\用户\\ MYUSER \\ .dnx \\运行时间。矿山包括以下内容:

Check what runtime directories are in C:\Users\MyUser\.dnx\runtimes. Mine include the following:

dnx-clr-win-x86.1.0.0-beta6          <-- I made this one via a rename.
dnx-clr-win-x86.1.0.0-beta6-12085
dnx-clr-win-x86.1.0.0-beta6-12120

在我的 global.json 文件,该文件在同一目录 *。SLN ,我做一定要引用运行时的一个是这样的:

In my global.json file, which is in the same directory as the *.sln, I make sure to reference one of the runtimes like this:

{
    "projects": [ "src", "test" ],
    "sdk": {
        "version": "1.0.0-beta6-12120"
    }
}

这篇关于ASP.NET 5(vNext)Web项目:库冲突升级,从BETA4到beta6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 06:34