Catch ReleaseComObject exception

G

Guest

Hi,

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

mscorlib.dll!System.Runtime.InteropServices.Marshal.ReleaseComObject(System.Object o = <Nicht definierter Wert>) + 0x18 Bytes
system.management.dll!System.Management.Instrumentation.MetaDataInfo.Dispose() + 0x15 Bytes
system.management.dll!System.Management.Instrumentation.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
 
W

Willy Denoyette [MVP]

message | Hi,
|
| on shutdown I receive the exception ReleaseComObject. Following the call
| stack when the exception occures.
|
|
mscorlib.dll!System.Runtime.InteropServices.Marshal.ReleaseComObject(System.Object
o = <Nicht definierter Wert>) + 0x18 Bytes
|
system.management.dll!System.Management.Instrumentation.MetaDataInfo.Dispose()
+ 0x15 Bytes
|
system.management.dll!System.Management.Instrumentation.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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top