Solved

An unhandled exception of type

Posted on 2003-11-19
8
703 Views
Last Modified: 2013-12-03
Hi i am trying to run a c sharp application which uses a class library, the class library uses the System.runtime.interopservices namespace.


when i compile the project i get no errors but when i run the project i get the following:

An unhandled exception of type 'System.Runtime.Interopservices.comexception' occured in sncl.dll

Additional information: Com object with CLSID {499C0c20-A766-11cF-8011-00A0c90A8F78} is either not valid or not registered.

can someone help as this is urgent.
regards Chris
0
Comment
Question by:chris_shadow
8 Comments
 
LVL 9

Expert Comment

by:WinterMuteUK
ID: 9781261
If you put the code into a try/catch thingy, you might be able to get a clearer response:
try {
     <your code>
}
catch (Exception ex) {MessageBox.Show(ex.ToString());}
0
 

Author Comment

by:chris_shadow
ID: 9781303
tried exactly the same error messages
0
 
LVL 15

Expert Comment

by:SRigney
ID: 9781365
Are you trying to run the code on the same machine you wrote it on?

Does it still run through the IDE?
0
 

Author Comment

by:chris_shadow
ID: 9781572
yep i am running on the same machine, i dont understand why im getting an error with system.runtime.interopservices


silly question but does anyone know of a component set to communicate with a pocket pc, i cant use activesync as i need programatically handle up to 10 pocket pcs at the same time.

chears
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 15

Expert Comment

by:SRigney
ID: 9781673
Are you running from the Release folder, or did you try moving files around?

Not sure on the PocketPC question, you'll be much better off posting this as an additional question.  I'm sure there are some experts out there that may miss the oportunity to answer that question because they don't look into the question about your unhandled exception type.
0
 

Author Comment

by:chris_shadow
ID: 9781849
im runnig from the debug folder
0
 
LVL 4

Expert Comment

by:wile_e_coyote
ID: 9782166
I think this exception means that your .NET code is attempting to call an unregistered COM DLL.     Are you using any COM components?
0
 
LVL 6

Accepted Solution

by:
purpleblob earned 500 total points
ID: 9786137
The error message you are getting is fairly self explanatory (if it's telling the turth :-) ), it would appear that the COM object you're trying to talk to has not been registered on the machine that you're running the .NET application from.

How did you reference the COM object, i.e. did you create the interop by adding a reference to the COM object ? Are you running the .NET application from the machine that the COM object is registered on ?

I quickly checked my registry on this - the CLSID is that of the Connection Manager. You could do a search of the registry (if you're happy interacting with the registry) and check the CLSID actually exists.

Note: as COM object's are instantiated as and when required you will find that the application will compile fine, it's at the point of CreateInstance (which happens in the interop) where the CLSID will be passed into and then will fail if the object does not exist).

Hope this helps

0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

757 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

21 Experts available now in Live!

Get 1:1 Help Now