473,398 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Initializing and terminating a dll in ASP.NET

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
Nov 19 '05 #1
2 1185
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" <ab*@abc.com> wrote in message
news:eX*************@tk2msftngp13.phx.gbl...
| 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
|
|
Nov 19 '05 #2
Thanks for the suggestion. Lets say if I am always going to be on Win2003,
what are the other options.
"bruce barker" <no***********@safeco.com> wrote in message
news:O%****************@TK2MSFTNGP10.phx.gbl...
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" <ab*@abc.com> wrote in message
news:eX*************@tk2msftngp13.phx.gbl...
| 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
|
|

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

50
by: Dan Perl | last post by:
There is something with initializing mutable class attributes that I am struggling with. I'll use an example to explain: class Father: attr1=None # this is OK attr2= # this is wrong...
14
by: Avi Uziel | last post by:
Hi All, I'm writing a Windows DLL which contain some utility classes. One of my classes is Singleton, therefore contain some static members. I'm using VC6 and linking to the DLL statically. ...
10
by: Bart Goeman | last post by:
Hi, I have a question about how to put redundant information in data structures, initialized at compile time. This is often necessary for performance reasons and can't be done at run time (data...
21
by: rupesh_533 | last post by:
I am assuming the following things. 1.Pointer to an integer means it points to an integer,On incrementing the pointer,it points to the next integer in memory. 2.Pointer to an array of some size...
5
by: Xarky | last post by:
Hi, I am creating a windows form, and when a specified event occurs (button click), I am hiding the windows form and opening a new windows form. When opening the new windows form and closing...
8
by: SM | last post by:
I've always wonder if there is diference when declaring and initializing a varible inside/outside a loop. What's a better practice? Declaring and initializing variables inside a loop routine,...
38
by: junky_fellow | last post by:
Guys, I was just looking at some code where to initialize an integer with all F's following statement is used; unsigned int i = -1; I want to know if this is the right way of doing the...
10
by: Jason Doucette | last post by:
Situation: I have a simple struct that, say, holds a color (R, G, and B). I created my own constructors to ease its creation. As a result, I lose the default constructor. I dislike this, but...
13
by: WaterWalk | last post by:
Hello. When I consult the ISO C++ standard, I notice that in paragraph 3.6.2.1, the standard states: "Objects with static storage duration shall be zero-initialized before any other...
6
by: Jai Prabhu | last post by:
Hi All, Consider the following piece of code: void func (void) { static unsigned char arr = "\x00\xAA\xBB"; fprintf (stderr, "0x%x\n", arr); fprintf (stderr, "0x%x\n", arr);
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.