473,691 Members | 2,686 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Catch ReleaseComObjec t exception

Hi,

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

mscorlib.dll!Sy stem.Runtime.In teropServices.M arshal.ReleaseC omObject(System .Object o = <Nicht definierter Wert>) + 0x18 Bytes
system.manageme nt.dll!System.M anagement.Instr umentation.Meta DataInfo.Dispos e() + 0x15 Bytes
system.manageme nt.dll!System.M anagement.Instr umentation.Meta DataInfo.Finali ze() + 0x1b Bytes

I already added exception handler for the exception types:
-Application.Thr eadException
-AppDomain.Unhan dledException

When the ReleaseComObjec t 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 1522

"Christian Havel" <Ch************ @discussions.mi crosoft.com> wrote in
message news:09******** *************** ***********@mic rosoft.com...
| Hi,
|
| on shutdown I receive the exception ReleaseComObjec t. Following the call
| stack when the exception occures.
|
|
mscorlib.dll!Sy stem.Runtime.In teropServices.M arshal.ReleaseC omObject(System .Object
o = <Nicht definierter Wert>) + 0x18 Bytes
|
system.manageme nt.dll!System.M anagement.Instr umentation.Meta DataInfo.Dispos e()
+ 0x15 Bytes
|
system.manageme nt.dll!System.M anagement.Instr umentation.Meta DataInfo.Finali ze()
+ 0x1b Bytes
|
| I already added exception handler for the exception types:
| -Application.Thr eadException
| -AppDomain.Unhan dledException
|
| When the ReleaseComObjec t 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
30291
by: Gary.Hu | last post by:
I was trying to catch the Arithmetic exception, unsuccessfully. try{ int a = 0, b = 9; b = b / a; }catch(...){ cout << "arithmetic exception was catched!" << endl; } After ran the program, it quitted with core dumped. %test
5
4001
by: ahmadzia673 | last post by:
I am using a COM component in my ASP.Net application. When i try to release it from memory by using Marshal.ReleaseComObject, its not working. The memory is still leaks. What to do? Is there any other way to prevent from this leakage? Please help me!
11
3481
by: Pohihihi | last post by:
I was wondering what is the ill effect of using try catch in the code, both nested and simple big one. e.g. try { \\ whole app code goes here } catch (Exception ee) {}
23
3064
by: VB Programmer | last post by:
Variable scope doesn't make sense to me when it comes to Try Catch Finally. Example: In order to close/dispose a db connection you have to dim the connection outside of the Try Catch Finally block. But, I prefer to dim them "on the fly" only if needed (save as much resources as possible). A little further... I may wish to create a sqlcommand and datareader object ONLY if certain conditions are met. But, if I want to clean these up in the...
0
1150
by: Christian Havel | last post by:
Hi, we are using a framework which is based on the Enterprise Library June 2005. When I am locking a object (successfull) and let the application run further I receive a NullReferenceException (Problem with: System.Runtime.InteropServices.Marshal.ReleaseComObject). In the eventview I see a error "Failed to fire the WMI Event DataConnectionOpenedEvent" Exception: System.Exception: The scheme for the assembly was not registered with WMI.
1
1325
by: Christian Havel | last post by:
Hi, we are using a framework (which is based on the Microsoft Enterprise Library) and retrieve a ReleaseCOMObject Exception. When I try to debug I can find out any information about the COM object. How can I find out which COM object is responsible for the exception? Thanks
1
1888
by: Christian Havel | last post by:
Hi, I have the problem, that I receive a ReleaseComObject exception from a used framework which is based on the Microsoft Enterprise Library. How can I find out, from whom this exception is thrown? Thanks Christian
32
6117
by: cj | last post by:
Another wish of mine. I wish there was a way in the Try Catch structure to say if there wasn't an error to do something. Like an else statement. Try Catch Else Finally. Also because I understand Finally runs whether an error was caught or not, I haven't found a use for finally yet.
0
2728
by: xrxst32 | last post by:
Hello there, I have some doubts about the best practice for using COM automation, the Runtime Callable Wrapper (RCW) and Marshal.ReleaseComObject. So the question is/are: Do I need to release each COM object explicit by a call to Marshal.ReleaseComObject, does the RCW take care of that or does it leaks unmanaged resources?
0
8599
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8531
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9079
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8951
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8791
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8794
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4550
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
1952
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.