.Net Devil

<December 2008>
SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910


Navigation

Personal

Subscriptions



Tuesday, February 14, 2006 - Posts

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 Tuesday, February 14, 2006 11:39 AM by sandeep with 0 Comments




Powered by Dot Net Junkies, by Telligent Systems