One common approach is to create custom HttpModule and inject a custom
context to the application.
This custom context can host all the services you want to provide to the
application. All the services that are embedded inyour context are available
to all the classes of your asp .net app. This approach not only provides
enough isoloation from the application code but also easily configurable.

HTH

Ravi




From: JC Oberholzer <[EMAIL PROTECTED]>
Reply-To: "Moderated discussion of advanced .NET topics."
<[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [ADVANCED-DOTNET] Process Isolation in ASP.NET
Date: Fri, 13 Jun 2003 10:10:13 -0400

I need some help on the following: My class library (dll) uses a variable
declared as public in order to share central information to all classes in
the application (such as connectionstring etc).  This works fine with
WinForm apps using the class library, as one instance of the public
variable exists per appdomain.

I need to use the same class library for an ASP app as well, and this is
where I need some help : How to get the ASP app to instantiate one
instance of my public variable per user session:

I have played around a lot with createing serializable classes and
creating my own appdomains, but my solutions are not very ellegant, adn I
reckon I can surely not be the only guy to have run into this issue.  ? Is
there any way to just "configure" my way out of this? (would be the first
prize), or any other relatively easy way to get around this issue?

Thx

JC Oberholzer

-- Technical info: Each of my class libraries always has a class
clsSystem, with private constructure and a shared function GetInstance
which is used to ensure I have only one onstance of my public variable in
the app

public class clsSystem
..
 Public Shared Function GetInstance () as clsSystem

_________________________________________________________________ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

Reply via email to