Initializing and terminating a dll in ASP.NET

H

Hiren Patel

Hi there,

I have a third party dll that I need to initialize and terminate once
and only once per application. By application I mean a physical exe and not
the HTTP application. This is fine when I am creating a windows application
as I can use the static void main function to do the initialization and
termination. But my question is where would I do this in an ASP.NET web app.
I tried the application_start and application_end events. The initialization
worked fine but the termination causes a memory access violation. If I
terminate the dll earlier on lets say page unload, everything works fine.
But this is not feasiable , since I need to keep using the dll till the
application is running.

The only workaround I see to this problem is the make a exe that consumes
this dll and then shell is from the web application.

Any other Ideas or suggestions???

Thanks
 
B

bruce barker

if your using 2000 and not 2003 with app pools, there are several asp.net
applications hosted under the same exe (aspnet_wp.exe). if you access a dll
in more than 1 app domain, the dll will get loaded again.

the easiest approach is to write a com wrapper and host it in com+.

-- bruce (sqlwork.com)


| Hi there,
|
| I have a third party dll that I need to initialize and terminate once
| and only once per application. By application I mean a physical exe and
not
| the HTTP application. This is fine when I am creating a windows
application
| as I can use the static void main function to do the initialization and
| termination. But my question is where would I do this in an ASP.NET web
app.
| I tried the application_start and application_end events. The
initialization
| worked fine but the termination causes a memory access violation. If I
| terminate the dll earlier on lets say page unload, everything works fine.
| But this is not feasiable , since I need to keep using the dll till the
| application is running.
|
| The only workaround I see to this problem is the make a exe that consumes
| this dll and then shell is from the web application.
|
| Any other Ideas or suggestions???
|
| Thanks
|
|
 
H

Hiren Patel

Thanks for the suggestion. Lets say if I am always going to be on Win2003,
what are the other options.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top