This topic has been archived. It cannot be replied.
-
工作学习 / 专业技术讨论 / Anyone has expereince Com Interop in .NET using c#? I got some problems when I try to release a COM object using Marshal.ReleaseComObject.
-graceye88(叶子);
2006-5-25
{983}
(#2991289@0)
-
I think that is because the Broker is ref, which can not be released in this way.
-42channel(Channel);
2006-5-25
(#2991359@0)
-
Yes. I think that is the problem. I don't know how I can release a Com object like that. Do you have any good suggestion.
-graceye88(叶子);
2006-5-26
(#2992276@0)
-
I don't think 'ReleaseComObject' really matters here. The interface must be leaked somewhere else.
-yuxiliu(Nescafe);
2006-5-26
(#2992721@0)
-
And I don't think you need to call "ReleaseComObject" unless you 1. want the objects to be released in a certain order. 2. someone statically holds a reference of your object somewhere in your code.
-yuxiliu(Nescafe);
2006-5-26
(#2992727@0)
-
I am not sure if I have to. In my code, I have to create the object in page load. Sometimes I got the error: The callee (server [not server application]) is not available and disappeared; all connections are invalid.This happens very random.So I think it is better to release the object immedately rather than wait for Garbage collection to release it.
-graceye88(叶子);
2006-5-26
{138}
(#2992954@0)
-
That's sounds like an automation error, as the message states, you are making calls on a already released object.I would suggest to investigate when and why the object you are calling become invalid.
-yuxiliu(Nescafe);
2006-5-26
{86}
(#2993461@0)