Jus*_*tin 10 c# fody fody-propertychanged
**这是Visual Studio 2013中的一个问题.
我得到的错误是巨大的,而且大多无用,但其关键在于
Error 130 Fody: Could not load 'ModuleWeaver' from 'PropertyChanged.Fody, Version=1.50.3.0, Culture=neutral, PublicKeyToken=null' due to ReflectionTypeLoadException.
It is possible you need to update the package.
exception.LoaderExceptions:
System.IO.FileLoadException: Could not load file or assembly 'Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756'
Run Code Online (Sandbox Code Playgroud)
再一次,因为没有变化,我一般不知道它的问题是什么.它正在寻找的DLL坐在它一直坐的同一个地方.
编辑:显然在这一点上它已经厌倦了吐出那个错误所以它捏造了一个新错误
Error 42 The "Fody.WeavingTask" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly 'Mono.Cecil, Version=0.9.5.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies. The system cannot find the file specified.
File name: 'Mono.Cecil, Version=0.9.5.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756'
at ExceptionExtensions.LogException(ILogger logger, Exception exception)
at Processor.Execute() in c:\TeamCity\buildAgent\work\7495521761d392b9\Fody\Processor.cs:line 56
at Fody.WeavingTask.Execute() in c:\TeamCity\buildAgent\work\7495521761d392b9\Fody\WeavingTask.cs:line 44
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()
Run Code Online (Sandbox Code Playgroud)
编辑2:
此外,该错误据称发生在第50行的"Fody.targets"内部
<Fody.WeavingTask
AssemblyPath="@(IntermediateAssembly)"
IntermediateDir="$(IntermediateDir)"
KeyFilePath="$(FodyKeyFilePath)"
ProjectDirectory="$(ProjectDir)"
SolutionDir="$(FodySolutionDir)"
References="@(ReferencePath)"
SignAssembly="$(FodySignAssembly)"
ReferenceCopyLocalPaths="@(ReferenceCopyLocalPaths)"
DefineConstants="$(DefineConstants)"
/>
Run Code Online (Sandbox Code Playgroud)
编辑3:
我在构建过程中删除了与Fody和Nuget相关联的所有文件.之后的错误与第二个错误相同:
"Error 42 The "Fody.WeavingTask" task failed unexpectedly."
Run Code Online (Sandbox Code Playgroud)
编辑4:
我真的希望Fody的开发者看到这一点,因为我们处于绝对停滞状态,直到这个问题得到解决.我们不能"恢复"回到工作时,因为当前的配置是在工作时.
Jim*_*Jim 14
看起来你的错误实际上是找到一个叫做的类ModuleWeaver.这个类是Fody包的一部分.
只需使用以下命令更新nuget包管理器中的包:
update-package Fody -reinstall
Run Code Online (Sandbox Code Playgroud)
可能会解决它.
失败:确保您的app.config文件没有错误的重定向.删除此部分,删除所有重定向.Visual Studio通常会添加必要的内容.
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
Run Code Online (Sandbox Code Playgroud)
再试一次,如果失败,尝试找出哪个依赖程序集失败.您可以编写一行命令行应用程序,或使用LinqPad.
您可以尝试使用LinqPad,如果您还没有使用它,请粘贴它.
Assembly.LoadFile("path to Fody");
Assembly.LoadFile("path to Mono.Cecil");
Run Code Online (Sandbox Code Playgroud)
您应该获得一个详细说明缺失库的异常.
要调试此类问题,您可以使用SysInternals Process Monitor。
一般的做法是:
查找丢失的 DLL。这部分有点棘手,因为
所以你需要找到一个从未找到过的DLL。并且您不希望出现未找到但在后续尝试中找到的 DLL。
嗯,这个过程可能非常耗时,所以我开发了Process Monitor Log Analyzer工具。有了它,您应该能够在更短的时间内找到罪魁祸首。
免责声明:如果文中没有明确说明,我是该免费工具的作者。
| 归档时间: |
|
| 查看次数: |
10740 次 |
| 最近记录: |