views:

64

answers:

1

Within asp.net, if I call a dll using DLLImport, does anyone know the scope of that instance? Is it at application level, so any subsequent calls go to the same instance of the dll until the application ends?

I've got a dll where I need to pre-load some data into the dll and was wondering wether I should do this in application start, and if the data would then be available for all session access.

A: 

Since it's a native DLL, you get one instance per Windows process (i.e. w3wp.exe). It will stay loaded until you recycle the worker process.

Mattias S