IIS Stopping because of COM

Posted on 2002-03-11
Medium Priority
Last Modified: 2013-11-25
Sometime ago we wrote a COM object to use on IIS.  Nothing fancy, we just use it to control the layout of our navigation on our web site (btw we used COM because of the inherent problems in IIS 4 of memory hogging when using asp include files).  The COM works fine under NT Server.

We've now moved to Windows 2000 and IIS5.  We're experiencing problems where IIS just stops (and needs to be reset).  This seems to be random.  We are wondering if it could be something to do with the COM.

Are there project/build settings or other considerations that we need to think about and change that could be causing this issue.

It's on our production servers so it's pretty urgent.

We're not experts in VB or COM but are ok, but the more details the better.

Question by:martinbw
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Author Comment

ID: 6855564
btw we do if possible want to keep using the COM.  We understand that IIS5 is better in terms of resource allocation with include files, but the COM contains a fair bit of functionality and we don't have the time right now to convert the site.
LVL 18

Expert Comment

ID: 6855655
Well, since you are not on windows 2000, I'd recommend that you turn your COM object into a COM+ object.  It will then run out of the process of the web server, so, even if your COM object crashes, it won't take down the webserver.  I think that you had an option with MTS to run a COM out of process, but that might have only been for Active-X EXEs....  no such limitation under COM+
LVL 18

Expert Comment

ID: 6855661
read that as "since you are NOW on windows 2000"
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments


Author Comment

ID: 6855710
Thanks.  How do we build/turn the COM object into a COM+

Expert Comment

ID: 6857281

mdougan is correct.  Make your object a COM+ app, and you will find it much more stable anyway.  You don't have to rebuild the object, just set up a com+ app that points to it.  

To do so, you need to use "Componenet Services" of Windows 2000.  You can find this on Start->Settings->Control Panel->Component Services.  

Here are the steps you need to take:

1) Unregister your component:  At the command prompt, type
     regsvr32 /u c:\the_path_here\file_name.dll

   Also a good idea is to run iisreset at this point.

2) Open Component Services, and navigate to:
     /Component Services/Computers/My Computer/COM+ Applications

3) Right click on COM+ Applications, and select "New Application" to open the wizard.

4) Click "Create an empty application", Select the type of process activation you want, give the application a user to run as.  (Note that if you specify a user, and have a password change policy, when the password is changed this will fail to authenticate.)

5) Navigate to the empty COM+ application, then down to its Components.  Right Click on "Components" and select "New Component" to start yet another wizard.

6) Select your components in the wizard.  This will register the COM object with the system.  Complete the wizard.

7) Go back to the COM+ application level, right click on your application, and select "Start".

That should do it for you.

Test this on your staging machine before you do it on production.

Good luck,
LVL 18

Expert Comment

ID: 6858863
Well, that might be true.  It depends on what your component does.  You have to make sure that it is set up to run under MTS Transactions.  Either UsesTransactions or RequiresTransactions if you're updating a database.  Your methods should either call GetObjectContext.SetComplete or GetObjectContext.SetAbort (one of them must be called if you've specified uses or requires transactions).

You'll want to make sure that you instantiate the object using CreateObject and not Dim x as New MyObject.  And, if you create any other COM objects inside of this COM object, then you'll need to use:

Dim oClients as MyClass.MyClient

Set oClients = GetObjectContext.CreateInstance("MyClass.MyClient")

So that any transactions that occur in oClients gets wrapped in the transaction for the original COM+ object that you're calling.

Microsoft has some good white papers on Programming Guidelines for Visual Basic COM+ Applications
LVL 18

Expert Comment

ID: 6887042
Has your original question been answered?

Author Comment

ID: 6888168
No, not really.  We've installed the COM as a COM+ but the servers still going down. Now, it could be something else or it could be the COM (when we ran the site in a non-com version it worked OK) as soon as we put the com on it became unstable and unpredictable.

The COM was designed and developed under NT.  We don't have that much expertise in VB here, hence the question.  What should the build configurations really be for the dll?  Maybe we've been doing something wrong right from the start...
LVL 18

Accepted Solution

mdougan earned 400 total points
ID: 6890939
Well, that could be.  The first question I'd have for you is how are you creating an instance of your COM+ object?  If you are using New as in Dim x as New MyObject, then even if you have this object loaded into a COM+ application, you'll be using COM and not COM+ to load it.  You'll need to ensure that you are using CreateObject instead.  There is another thread where I've gone into detail about various pieces of syntax in switching a COM object to a COM+ object, and rather than pasting all of that text here, I'll just give you the link:


There is also a link on one of the comments there about a document called complus from microsoft.  You should download this document and read through it.  I followed the recommendations closely and had great success.
LVL 49

Expert Comment

ID: 7618177
Hi martinbw,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept mdougan's comment(s) as an answer.

martinbw, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
DanRollins -- EE database cleanup volunteer

Author Comment

ID: 7645638
We resolved this by removing a call to another COM object within our own COM object.  This was causing the problem.  So none of the answers really resolved it for us.  Can we close it and give 50 points to mdougan (for the effort and suggestions) and refund 50 to my account.


Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question