C# 无法加载文件或程序集';Microsoft.Build.Framework,版本=15.1.0.0,区域性=中性,PublicKeyToken=b03f5f7f11d50a3a';

C# 无法加载文件或程序集';Microsoft.Build.Framework,版本=15.1.0.0,区域性=中性,PublicKeyToken=b03f5f7f11d50a3a';,c#,visual-studio,visual-studio-2017,C#,Visual Studio,Visual Studio 2017,我正在尝试运行控制台应用程序VS 2017以前的应用程序是在VS2015上构建的,并在2017年打开,它开始给出构建错误 我尝试了谷歌的不同解决方案。没有结果。请帮帮我 Severity Code Description Project File Line Suppression State Error Fody: An unhandled exception occurred: Exception: Could not load file or as

我正在尝试运行控制台应用程序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.

我也犯了同样的错误。问题在于这两个软件包:Fody和Costura.Fody。
几个小时后,我的解决方案是删除文件夹“packages”,然后恢复和更新nuget软件包。

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

Azure构建管道
NuGet工具安装程序
步骤中,更改NuGet.exe的
版本以将其安装到较新版本,如
5.4.0


查看Nuget的
发布版本和受祝福的
版本。

可能会有所帮助-这对我来说同样有效,需要转到新版本。