Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fody: An Unhandled Exception Occured

I am suddenly getting an exception when trying to build the project. Seems to have something todo with Mono.Cecil. But I am not using Mono in my project.

Fehler 13 Fody: An unhandled exception occurred: Exception: Die Datei oder Assembly "Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" oder eine Abhängigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinition der Assembly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040) StackTrace: bei System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType) bei System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters() bei System.Reflection.RuntimeMethodInfo.GetParametersNoCopy() bei System.Reflection.RuntimePropertyInfo.GetIndexParametersNoCopy()
bei System.Reflection.RuntimePropertyInfo.GetIndexParameters() bei System.RuntimeType.GetPropertyCandidates(String name, BindingFlags bindingAttr, Type[] types, Boolean allowPrefixLookup) bei System.RuntimeType.GetPropertyImpl(String name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) bei System.Type.GetProperty(String name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) bei PropertyDelegateBuilder.BuildPropertySetDelegate[T](Type type, String propertyName) in c:\TeamCity\buildAgent\work\7495521761d392b9\FodyIsolated\DelegateBuilders\PropertyDelegateBuilder.cs:Zeile 9. bei DelegateBuilder.BuildDelegateHolder(Type weaverType) in c:\TeamCity\buildAgent\work\7495521761d392b9\FodyIsolated\DelegateBuilders\DelegateBuilder.cs:Zeile 25. bei DelegateBuilder.GetDelegateHolderFromCache(Type weaverType) in c:\TeamCity\buildAgent\work\7495521761d392b9\FodyIsolated\DelegateBuilders\DelegateBuilder.cs:Zeile 16. bei InnerWeaver.InitialiseWeavers(List`1 weaverInstances) in c:\TeamCity\buildAgent\work\7495521761d392b9\FodyIsolated\InnerWeaver.cs:Zeile 65. bei InnerWeaver.Execute() in c:\TeamCity\buildAgent\work\7495521761d392b9\FodyIsolated\InnerWeaver.cs:Zeile 30. Source: mscorlib TargetSite: Void GetSignature(Void*, Int32, System.RuntimeFieldHandleInternal, System.IRuntimeMethodInfo, System.RuntimeType)

Any ideas? I already tried to reinstall the Costura.Fody package.

like image 354
Thomas Hahn Avatar asked Sep 01 '15 13:09

Thomas Hahn


3 Answers

I solved this problem by downgrading from Version 1.3.4 to 1.3.3 by executing

Install-Package Costura.Fody -Version 1.3.3.0

in Package-Manager-Console.

like image 116
Thomas Hahn Avatar answered Nov 05 '22 07:11

Thomas Hahn


Try to update Costura.Fody packages for your project. For me it was enough.

like image 2
Den Zuk Avatar answered Nov 05 '22 07:11

Den Zuk


Having the exact same issue here.

It used to work last week, we did not change anything and now Costura.Fody seems to look for Mono.Cecil 0.9.6.0, but I can only find 0.9.5.0 in the packages folder...

I tried downgrading Costura.Fody to 1.3.3.0 and Fody to 1.26.1 but i'm still having the exact same problem.

You can see that other people are having this issue too here: https://github.com/Fody/Costura/issues/118

like image 1
KavenG Avatar answered Nov 05 '22 07:11

KavenG