all groups > dotnet remoting > june 2004 >
You're in the

dotnet remoting

group:

Singleton and IIS


Re: Singleton and IIS Ken Kolda
6/29/2004 12:29:06 PM
dotnet remoting: Hosting a stateful remoting server under IIS is certainly possible but does
pose more complications than when running as a service. The key is to make
sure ASP.NET doesn't recycle the AppDomain or worker process in which your
singleton resides. To do this, make sure of the following:

1. You have disabled process recycling. For IIS 5.0, this means updating the
<processModel> section of the machine.config. For IIS 6.0, you set the
properties on the Application Pool in which the web app runs.

2. Make sure no process touches the files in your web app's directory or in
the Windows\Microsoft.NET\Framework\v1.1.4322\CONFIG folder. Modifying any
of these files can cause your AppDomain to be dumped and restarted. (Be
especially careful if you have a virus scanner as these can trigger the
restart depending on how they touch the files).

If you want something safer at the expense of a bit of performance, you
could host the state in your Windows service and just use IIS to proxy
requests to it via remoting. Then if IIS gets recycled, it doesn't matter
since the IIS app isn't stateful.

Ken


[quoted text, click to view]

Singleton and IIS Elp
6/29/2004 6:57:32 PM
Hi,

I'd like to build a .NET Remoting component that has to be singleton.
Actually, this component will serve as a "collaborative component". Each
client will connect to this component, which will keep a reference to each
connected client. This collaborative component will then be able to send a
message to every or some of the clients, allow clients to see who is
connected, etc...

I'm now wondering if i could host this .NET Remoting component in IIS. This
would allow me to get rid off firewall problems and make security managment
much easier than if i were hosting it in a Windows service. However, it
seems that IIS is not the best place to host a singleton component as it
seems (from what i've read) to destroy the state of the hosted objects from
time to time. So am i stuck hosting it in a windows service? Or is there
some trick that would allow me to do what i want to do while still keeping
IIS as the host?

Thanks

Re: Singleton and IIS Allen Anderson
7/5/2004 9:17:32 PM
I would leave it as a system service frankly. Singletons and IIS
don't really mix very well. That's just from my past experience.

Cheers,
Allen Anderson
http://www.glacialcomponents.com
mailto: allen@put my website base here.com

On Tue, 29 Jun 2004 18:57:32 +0100, "Elp"
[quoted text, click to view]
AddThis Social Bookmark Button