Cache a dll in Application_Start?

  • Thread starter Thread starter Adam Smith
  • Start date Start date
A

Adam Smith

As long as my code is reentrant, can I cache a dll with assembly.load in
my application_start and then access it from the application cache, then
invoke one of the methods inside it from multiple web service calls?

Thanks in advance.

Adam Smith
 
Adam Smith said:
As long as my code is reentrant, can I cache a dll with assembly.load in
my application_start and then access it from the application cache, then
invoke one of the methods inside it from multiple web service calls?

Well, yes. But this is what happens if you just set a reference to the
assembly, and start using it in your code.

David
 
The reason I want to do an assembly.load at runtime is that I want to
pick up the dll name and location from a database setting entry at
startup, rather than hard coding the name.

Adam Smith
 
Adam Smith said:
The reason I want to do an assembly.load at runtime is that I want to
pick up the dll name and location from a database setting entry at
startup, rather than hard coding the name.

That's fine. The same thing will happen. The assembly, once loaded, will
stay loaded, and you can use the assembly reference to create types defined
in that assembly.

David
 
Back
Top