【问题标题】:Could not load file or assembly 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'无法加载文件或程序集“Microsoft.Build.Framework,版本=15.1.0.0,文化=中性,PublicKeyToken=b03f5f7f11d50a3a”
【发布时间】:2020-11-06 00:37:34
【问题描述】:

我正在尝试运行控制台应用程序 VS 2017,以前的应用程序是在 VS2015 上构建并于 2017 年打开的,它开始出现构建错误。

我尝试了来自谷歌的不同解决方案。什么都没有。请帮帮我。

    Severity    Code    Description Project File    Line    Suppression State
Error       Fody: An unhandled exception occurred:
Exception:
Could not load file or assembly 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
StackTrace:

Server stack trace: 
   at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
   at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()
   at System.Reflection.RuntimeMethodInfo.GetParameters()
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at IInnerWeaver.set_Logger(ILogger value)
   at Processor.ExecuteInOwnAppDomain() in c:\ConsoleBuildAgent\work\ed448661dbb30d2e\Fody\Processor.cs:line 146
   at Processor.Inner() in c:\ConsoleBuildAgent\work\ed448661dbb30d2e\Fody\Processor.cs:line 93
   at Processor.Execute() in c:\ConsoleBuildAgent\work\ed448661dbb30d2e\Fody\Processor.cs:line 45
Source:
mscorlib
TargetSite:
Void GetSignature(Void*, Int32, System.RuntimeFieldHandleInternal, System.IRuntimeMethodInfo, System.RuntimeType)
Could not load file or assembly 'Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

【问题讨论】:

标签: c# visual-studio visual-studio-2017


【解决方案1】:

这个解决方案对我有用。 Microsoft 依赖项中似乎存在版本冲突。问题消失了,现在构建成功。

Azure Build Pipeline > NuGet tool installer 步骤中,将Version of NuGet.exe to install 更改为较新的版本,例如5.4.0

https://dist.nuget.org/tools.json 上查看 Nuget 的 ReleasedAndBlessed 版本。

【讨论】:

  • 为我工作,需要去新版本。
【解决方案2】:

我遇到了同样的错误。问题在于这两个包:Fody 和 Costura.Fody。 几个小时后对我的修复是删除文件夹“packages”并在此之后进行恢复并更新 nuget 包。

【讨论】:

    猜你喜欢
    • 2018-02-05
    • 2021-01-22
    • 2016-11-19
    • 2018-06-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多