We help IT Professionals succeed at work.

How should I register my COM object in IIS 5?

jsullivan asked

I have a simple ASP web site which makes calls to a custom VB DLL COM object that I created.  What is the best way to ensure that my COM object runs in an isolated process on my IIS 5 server?  I registered my DLL simply by copying it to the IIS machine and running regsvr32 on it.  Then I edited the properties of my web site and set the Application Protection property to "High (isolated)".  Is this enough to ensure that the DLL runs in an isolated process (or at least in the same process as the web site)?  Or, do I have to use the Component Services Manager (CSM) and add my component through that?  If I have to use CSM, why?

Also, does it matter where I put my DLL on the IIS 5 machine?  My web site is currently located in C:\Inetpub\wwwroot\myweb.  I did not put my DLL under this folder.  I put it in C:\myobject.  Does this matter?  Should I be putting the DLL under the "myweb" folder?

Watch Question

the first question: setting "high (isolated) is not recommended for web server.  Use it only for development server.  By setting to "hight (isolated)" you can unload the component instead of shut down the whole web server.

the second question: it does not matter where you put your dll on IIS5 machine.  However, I like to put it under the web folder (I am not sure if it safe of not) but by that way, when I move my web folder I have the whole things in there.

The option that you have selected will run the web application in a separate process and the COM object will run in that same process.

If you wanted to run the COM object in a separate process from the web app, then you could use CSM to create a Server Application (in the Activation tab).  You could do this if you wanted to keep your web app running in the same process as ASP, but still have the object separate.  You only really need CSM if you want to take advantages its functionality -- queuing, transactions, etc.

Finally, you don't need to keep the DLL in the same folder as the web site.  Your app uses the object's ClassId to find the actual location of the DLL.  However, for maintenance purposes, it may be a better practice to keep them together, so that you're aware of everything that's part of a single application.
Michel SakrRounded IT Consultant / Projects manager / Cloud Consultant / IT Planning

put your dll wherever you want.. even on another server (possible but not recommended)..
by default IIS5 will run dll instances out of process if it's an MTS (com+) object..  when you create the instance btw and use server.createobject instead of createobject you'll be passing the dll via mts.. it is a good practice to register the dll via com+ .. create a package there and add to it your component.. (unregistred component where you browse for the dll) since iis will lock your component otherwise and you won't be able to recompile without restarting the iisadmin..


Thanks DarthPedro, I felt your answer was the most complete.  Thanks to phuctran and Silvers5 for responding too.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.