Solved

IIS Stopping because of COM

Posted on 2002-03-11
11
234 Views
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.

Thanks
0
Comment
Question by:martinbw
11 Comments
 

Author Comment

by:martinbw
Comment Utility
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.
0
 
LVL 18

Expert Comment

by:mdougan
Comment Utility
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+
0
 
LVL 18

Expert Comment

by:mdougan
Comment Utility
read that as "since you are NOW on windows 2000"
0
 

Author Comment

by:martinbw
Comment Utility
Thanks.  How do we build/turn the COM object into a COM+
0
 
LVL 1

Expert Comment

by:QuietManTravis
Comment Utility
Martinbw,

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,
-Travis
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 18

Expert Comment

by:mdougan
Comment Utility
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
0
 
LVL 18

Expert Comment

by:mdougan
Comment Utility
Has your original question been answered?
0
 

Author Comment

by:martinbw
Comment Utility
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...
0
 
LVL 18

Accepted Solution

by:
mdougan earned 100 total points
Comment Utility
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:

http://www.experts-exchange.com/visualbasic/Q.20276027.html

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.
0
 
LVL 49

Expert Comment

by:DanRollins
Comment Utility
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
0
 

Author Comment

by:martinbw
Comment Utility
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.

Thanks
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now