Fody/Costura

An Unhandled Exception Occurred: Failed To Execute Weaver

leszekm1 opened this issue · 4 comments

Reason: FIPS policy disallows MD5.

Repro:

  1. Turn on FIPS security policy in Windows (using LocalSecurityPolicy control panel)
  2. Try to weave anything

result:
3>MSBUILD : error : Fody: An unhandled exception occurred:
3>MSBUILD : error : Exception:
3>MSBUILD : error : Failed to execute weaver C:\Costura.Fody.2.0.1\netclassicweaver\Costura.Fody.dll
3>MSBUILD : error : Type:
3>MSBUILD : error : System.Exception
3>MSBUILD : error : StackTrace:
3>MSBUILD : error : at InnerWeaver.ExecuteWeavers()
3>MSBUILD : error : at InnerWeaver.Execute()
3>MSBUILD : error : Source:
3>MSBUILD : error : FodyIsolated
3>MSBUILD : error : TargetSite:
3>MSBUILD : error : Void ExecuteWeavers()
3>MSBUILD : error : Exception has been thrown by the target of an invocation.
3>MSBUILD : error : Type:
3>MSBUILD : error : System.Reflection.TargetInvocationException
3>MSBUILD : error : StackTrace:
3>MSBUILD : error : at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
3>MSBUILD : error : at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
3>MSBUILD : error : at System.Security.Cryptography.CryptoConfig.CreateFromName(String name, Object[] args)
3>MSBUILD : error : at System.Security.Cryptography.MD5.Create()
3>MSBUILD : error : at ModuleWeaver.CalculateHash()
3>MSBUILD : error : at ModuleWeaver.Execute()
3>MSBUILD : error : at InnerWeaver.ExecuteWeavers()
3>MSBUILD : error : Source:
3>MSBUILD : error : mscorlib
3>MSBUILD : error : TargetSite:
3>MSBUILD : error : System.Object InvokeMethod(System.Object, System.Object[], System.Signature, Boolean)
3>MSBUILD : error : This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms.
3>MSBUILD : error : Type:
3>MSBUILD : error : System.InvalidOperationException
3>MSBUILD : error : StackTrace:
3>MSBUILD : error : at System.Security.Cryptography.MD5CryptoServiceProvider..ctor()
3>MSBUILD : error : Source:
3>MSBUILD : error : mscorlib
3>MSBUILD : error : TargetSite:
3>MSBUILD : error : Void .ctor()
3>MSBUILD : error :
3> Fody: Finished Fody 82ms.

To be raising issues you should be a patron of Fody. Any issues raised by non Patrons may not be actively triaged, and eventually closed as stale.

I assume that since u are asking about FIPS you are working for a company that has defence clients. If that is the case then all developers at your company (who are using fody) should be patrons
https://github.com/Fody/Home/blob/master/pages/licensing-patron-faq.md#organization-licensing

assuming the lack of response means u went a different way. will reopen if u want to proceed

I had to reinstall realm in all projects where uses, and works again!