471,328 Members | 1,691 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,328 software developers and data experts.

ManagementClass.GetInstances() throws COM exception

Hi there,

We have created a custom adapter for Microsoft BizTalk using C#. We wish to
add the adapter to the BizTalk adapters list automatically upon install and
remove it on uninstall. We found this code, which seemed to do exactly what
we want:

geekswithblogs.net/cmcneill/ archive/2005/04/05/28336.aspx

However, when running the Uninstall method, an exception is thrown at the
line:

ManagementObjectCollection adapterObjects = adapterClass.GetInstances();

The exception is: "System.Runtime.InteropServices.InvalidComObjectEx ception:
COM object
that has been separated from its underlying RCW can not be used"

Now, just for kicks I decided to install SP1 for .NET framework 1.1, and
voila, no exception. However, it seems a ridiculous requirement to have this
service pack installed just to run this one function that is only called
once on uninstall. Is there any other way to get around this problem (and
what is the problem anyways??) . Any insight on this is appreciated.

Jul 21 '05 #1
1 2965
Sorry, the link is

http://geekswithblogs.net/cmcneill/a.../05/28336.aspx

"Ryan Berry" wrote:
Hi there,

We have created a custom adapter for Microsoft BizTalk using C#. We wish to
add the adapter to the BizTalk adapters list automatically upon install and
remove it on uninstall. We found this code, which seemed to do exactly what
we want:

geekswithblogs.net/cmcneill/ archive/2005/04/05/28336.aspx

However, when running the Uninstall method, an exception is thrown at the
line:

ManagementObjectCollection adapterObjects = adapterClass.GetInstances();

The exception is: "System.Runtime.InteropServices.InvalidComObjectEx ception:
COM object
that has been separated from its underlying RCW can not be used"

Now, just for kicks I decided to install SP1 for .NET framework 1.1, and
voila, no exception. However, it seems a ridiculous requirement to have this
service pack installed just to run this one function that is only called
once on uninstall. Is there any other way to get around this problem (and
what is the problem anyways??) . Any insight on this is appreciated.

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Steve Teeples | last post: by
2 posts views Thread by =?Utf-8?B?Qy4gSHVnaGVz?= | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.