How to load assemblies outside the appbase(more information)

后端 未结 4 1695
悲&欢浪女
悲&欢浪女 2021-01-19 06:13

I want to know how to load assemblies which are outside the Appbase and Appdomain.

My problem is that I have a list of assemblies that are on a shared directory. My

4条回答
  •  囚心锁ツ
    2021-01-19 06:18

    There is an event that is fired if it can't find an assembly or one of its references:

    AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
    
    Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
            {
    
            }
    

    Add it before you're loading your assemblies. Put a breakpoint in it and in args there should be some info about the assembly you're missing

提交回复
热议问题