Solved

An unhandled exception of type

Posted on 2003-11-19
8
710 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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
 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Web Form VB.Net  import CSV 4 39
Where can I ask about my ASP.NET MVC project? 6 38
C# Comparing String Arrays. 5 43
PrintingFoundIt(Almost!(Damn!)) 1 27
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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…

831 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