471,305 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Catch ReleaseComObject exception

Hi,

on shutdown I receive the exception ReleaseComObject. Following the call
stack when the exception occures.

mscorlib.dll!System.Runtime.InteropServices.Marsha l.ReleaseComObject(System.Object o = <Nicht definierter Wert>) + 0x18 Bytes
system.management.dll!System.Management.Instrument ation.MetaDataInfo.Dispose() + 0x15 Bytes
system.management.dll!System.Management.Instrument ation.MetaDataInfo.Finalize() + 0x1b Bytes

I already added exception handler for the exception types:
-Application.ThreadException
-AppDomain.UnhandledException

When the ReleaseComObject exception is thrown, both handlers are not called.
How can I find out which COM object is ment and how can I fix this bug?
Thanks
Christian

Feb 14 '06 #1
1 1454

"Christian Havel" <Ch************@discussions.microsoft.com> wrote in
message news:09**********************************@microsof t.com...
| Hi,
|
| on shutdown I receive the exception ReleaseComObject. Following the call
| stack when the exception occures.
|
|
mscorlib.dll!System.Runtime.InteropServices.Marsha l.ReleaseComObject(System.Object
o = <Nicht definierter Wert>) + 0x18 Bytes
|
system.management.dll!System.Management.Instrument ation.MetaDataInfo.Dispose()
+ 0x15 Bytes
|
system.management.dll!System.Management.Instrument ation.MetaDataInfo.Finalize()
+ 0x1b Bytes
|
| I already added exception handler for the exception types:
| -Application.ThreadException
| -AppDomain.UnhandledException
|
| When the ReleaseComObject exception is thrown, both handlers are not
called.
| How can I find out which COM object is ment and how can I fix this bug?
| Thanks
| Christian
|

Your problem is due to a missing Dispose call in your code (or not applying
the using idiom). The finalizer is called at CLR shutdown time, long after
the object is already gone with a previous GC sweep (Object o = null).
This would be an indication that you have blocked the finalizer thread
somehow, therefore it would be great to post a "complete sample" that
illustrates the problem.

Willy.
Feb 14 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Gary.Hu | last post: by
11 posts views Thread by Pohihihi | last post: by
23 posts views Thread by VB Programmer | last post: by
reply views Thread by Christian Havel | last post: by
1 post views Thread by Christian Havel | last post: by
1 post views Thread by Christian Havel | last post: by
32 posts views Thread by cj | 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.