c# - 升级到 .Net 4.5 会导致程序集失败?

标签 c# .net visual-studio-2012

我有一个针对 .Net 4.0 的项目,引用的程序集之一是 .Net 4.5。

在我安装 .Net 4.5 之前它工作正常,但是在安装之后我收到五个关于目标 .Net 版本的警告:

*The primary reference "xxxx.Library, Version=1.0.0.1, Culture=neutral, processorArchitecture=MSIL" could not be resolved because it was built against the ".NETFramework,Version=v4.5" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.0"

还有这个:

The primary reference "Microsoft.TeamFoundation.Build.Workflow, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the framework assembly "System.IO.Compression, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "Microsoft.TeamFoundation.Build.Workflow, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" or retarget your application to a framework version which contains "System.IO.Compression, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089". Tests

为什么 Visual Studio 讨厌我?如果它可以在更新到 4.5 之前编译,目标框架没有改变并且它仍然适用于 VS2010 的同事和 .Net 4 为什么我被塞满了?

最佳答案

错误消息解释了问题 - .NET 4 应用程序无法引用 .NET 4.5 dll。将您的应用也更改为 .NET 4.5,或将 dll 更改回 .NET 4。

关于c# - 升级到 .Net 4.5 会导致程序集失败?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16856474/

相关文章:

c# - 如何在 Google Drive API 中取消上传?

c# - 使用 C# 从服务器端访问 javascript 中的动态变量

c# - 用于远程调用 Windows 服务方法的体系结构

c# - XmlInclude 以(反)序列化单独程序集中的继承类型

c# - 等待/异步奇怪的行为

c# - Azure 模拟器使用 MVC 应用程序时速度缓慢,可能需要 120 秒才能注册点击或 JSON 调用

sdk - Visual Studio 2012 命令行构建

c# - 如何设置 web.config 文件以显示完整的错误消息

c# - 如何获取程序集的命名空间?

c# - Windows.UI.Xaml 命名空间在 visual studio 2012 中不支持用于 windows phone 开发