Frequently asked question

Should I use COMReleaser or Marshal.ReleaseComObject?

Last Published: April 25, 2020


This article addresses the use of COM objects in .NET code and the appropriate way to dispose of these COM object references.

In .NET code, references to COM objects are held by way of runtime callable wrappers (RCWs). There are two classes used to release the COM object references in .NET code: COMReleaser or Marshall.ReleaseComObject. The COMReleaser class is the recommended method in most situations, because internally it calls the System.Runtime.InteropServices.Marshall.ReleaseCOMObject, which ensures that all COM object references are terminated.

For additional information, please see the help documentation in the Related Information section on how to release COM References.

Article ID:000009974

  • ArcGIS Engine

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options