.Net Devil

<July 2008>
SuMoTuWeThFrSa
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789


Navigation

Personal

Subscriptions



FileLoadException : Cannot specify assembly evidence under MultiDomain after non-GAC assemblies with default evidence have been loaded in appdomain

One of the very few example where you just can't search MSDN or Google or MSN and hope to find the answer. For me it was the following exception when calling

Assembly.Load(aseemblyName, evidence);

System.IO.FileLoadException occurred
 Message="Could not load file or assembly AssemblyName, Version=1.1.0.0' or one of its dependencies. Cannot specify assembly evidence under MultiDomain after non-GAC assemblies with default evidence have been loaded in appdomain. (Exception from HRESULT: 0x8013101D)"
Source="mscorlib"
FileName="AssemblyName, Version=1.1.0.0"
FusionLog=""
StackTrace:
       at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
       at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
       at System.Reflection.Assembly.Load(AssemblyName assemblyRef, Evidence assemblySecurity)
       at Microsoft.InformationBridge.Framework.ExecutionEngine.Utility.LoadAssembly(AssemblyName assemblyName)

Now after spending lots of time with installting uninstalling several things with no result. I decided to go into the details. After reading the exception message once again it was all clear. Clearly some Non-Gac assembly was loaded in my host application (in my case it was outlook) with the default evidences. So all I need to do was to look for such assemblies not loading from gac. Fortuanately it was only one for me and I knew it was some addin which was quite useful for us. With a little hope I disabled it and restart outlook. Wow it worked now with no exception.

Lession: If you encounter above exception just check which idiot extensions are enabled which are preventing you from loading your assemblies (.Net ones) and disable them.(Of course this is just a workaround but if you dont have any other way till then....)

If you find out the solution to this problem please let me know.

posted on Tuesday, February 14, 2006 11:39 AM by sandeep





Powered by Dot Net Junkies, by Telligent Systems