Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Initializing and terminating a dll in ASP.NET

Reply
Thread Tools

Initializing and terminating a dll in ASP.NET

 
 
Hiren Patel
Guest
Posts: n/a
 
      02-01-2005
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


 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      02-01-2005
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)


"Hiren Patel" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
| 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
|
|


 
Reply With Quote
 
 
 
 
Hiren Patel
Guest
Posts: n/a
 
      02-01-2005
Thanks for the suggestion. Lets say if I am always going to be on Win2003,
what are the other options.


"bruce barker" <(E-Mail Removed)> wrote in message
news:O%(E-Mail Removed)...
> 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)
>
>
> "Hiren Patel" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> | 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
> |
> |
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Terminating processes on Windows (handles and IDs) geoffbache Python 4 06-25-2008 08:49 AM
How to determine if a DLL is a COM DLL or .NET DLL Anushi ASP .Net 5 10-28-2004 01:59 PM
Why does Ruby use both tcl83.dll and tk83.dll (instead of just tk83.dll)? H. Simpson Ruby 4 08-03-2004 04:45 PM
mprapi.dll --> samlib.dll --> ntdll.dll issue. Some1 Computer Support 4 04-05-2004 02:02 AM
msvcrt.dll, msvcirt.dll, msvcrt20.dll and msvcrt40.dll, explanation please! Snoopy NZ Computing 16 08-25-2003 12:34 PM



Advertisments