An unhandled exception of type

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
chris_shadowAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

WinterMuteUKCommented:
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
chris_shadowAuthor Commented:
tried exactly the same error messages
0
SRigneyCommented:
Are you trying to run the code on the same machine you wrote it on?

Does it still run through the IDE?
0
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

chris_shadowAuthor Commented:
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
SRigneyCommented:
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
chris_shadowAuthor Commented:
im runnig from the debug folder
0
wile_e_coyoteCommented:
I think this exception means that your .NET code is attempting to call an unregistered COM DLL.     Are you using any COM components?
0
purpleblobCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Fonts Typography

From novice to tech pro — start learning today.