By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,734 Members | 880 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,734 IT Pros & Developers. It's quick & easy.

I am confused with load assembly in AppDomain

P: n/a
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(assmblyRef)’ 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.
Jul 10 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi,,,

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

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

www.munna.shatkotha.com/blog
www.munna.shatkotha.com
www.shatkotha.com
Jul 12 '08 #2

P: n/a
Hi,
Seems it managed code one looks like:
protected Assembly CreateAssembly(string filename)
{
System.IO.FileStream fs = new System.IO.FileStream(filename,
System.IO.FileMode.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

www.munna.shatkotha.com/blog
www.munna.shatkotha.com
www.shatkotha.com
Jul 14 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.