I am confused with load assembly in AppDomain

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?UGFi?=

    I am confused with load assembly in AppDomain

    Hello,

    I am confused with load assembly in AppDomain. I created ASP Web
    application, same business logic is realized in custom DLLs, and I need to
    load ones in my application. If I use ‘Load(assmbly Ref)’ method of AppDomain
    class, assembly is loaded but DLL file locked. I try to read DLL in byte[]
    array and load assembly calling Load(byte[]) method. All are pretty, but in
    contrast to calling Load(assmblyRef )’ method, calling Load(byte[]) method
    results in assembly is loaded in domain each time (GetAssymles() method
    brings assembly array which contains same versions of loading assembly). Can
    anybody suggest approach how I can load custom dlls in application not
    blocking DLL file.
  • Munna

    #2
    Re: I am confused with load assembly in AppDomain

    Hi,,,

    Is the dll is a managed code dll or unmanaged code dll...?


    Thanks

    -----------
    Munna




    Comment

    • =?Utf-8?B?UGFi?=

      #3
      Re: I am confused with load assembly in AppDomain

      Hi,
      Seems it managed code one looks like:
      protected Assembly CreateAssembly( string filename)
      {
      System.IO.FileS tream fs = new System.IO.FileS tream(filename,
      System.IO.FileM ode.Open);
      byte[] buffer = new byte[(int)fs.Length];
      fs.Read(buffer, 0, buffer.Length);
      fs.Close();
      Assembly asm = this.AppDomain. Load(buffer);
      return asm;
      }

      "Munna" wrote:
      Hi,,,
      >
      Is the dll is a managed code dll or unmanaged code dll...?
      >
      >
      Thanks
      >
      -----------
      Munna
      >



      >

      Comment

      Working...