gpt4 book ai didi

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

转载 作者:可可西里 更新时间:2023-11-01 08:39:41 25 4
gpt4 key购买 nike

我有一个针对 .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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com