“COM object that has been separated from its underlying RCW cannot be used” with .NET 4.0
问题 I've a class in my .NET 3.5 C# WinForms application which has five methods. Each method uses different sets of C++ COM interfaces. Am using Marshal.FinalReleaseCOMObject for cleaning up these COM objects. This code works fine on this .NET platform without any issues. But when I move this application to .NET 4.0, I start getting this error in one of these methods at a line where I cast a variable from ICOMInterface1 to ICOMInterface2 , i.e.: ICOMInterface1 myVar= obj as ICOMInterface2; COM