0

I am using below mentioned code snippet. but the codebase property in null, so from where can we get the path ?

  public partial class App : Application
{
    public App()z
    { 
        AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
    }

    private Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
    {
      // how to return the assembly ? 
      // how to get the path of referred/missing assembly ?
        return Assembly;
    }
}
FullStack
  • 665
  • 11
  • 26
sumit
  • 21
  • 2
  • Can you add some code for that for how you are getting the codebase & assembly location. – Nikita Shrivastava Sep 02 '15 at 07:21
  • You have this backwards, it is *your* job to know the path. If you have no idea where the assembly is stored then you should not be using this event at all. Instead move file(s) so the CLR can find them. – Hans Passant Sep 02 '15 at 08:33

0 Answers0