System.DisposableObject 1.5.1

.NET 5.0 .NET Core 3.1 .NET Standard 2.0 .NET Framework 4.0
There is a newer version of this package available.
See the version list below for details.
dotnet add package System.DisposableObject --version 1.5.1
NuGet\Install-Package System.DisposableObject -Version 1.5.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="System.DisposableObject" Version="1.5.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add System.DisposableObject --version 1.5.1
#r "nuget: System.DisposableObject, 1.5.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install System.DisposableObject as a Cake Addin
#addin nuget:?package=System.DisposableObject&version=1.5.1

// Install System.DisposableObject as a Cake Tool
#tool nuget:?package=System.DisposableObject&version=1.5.1

Nuget Nuget


Base object for disposing managed and unmanaged objects. This object implements the dispose pattern for the .NET Framework.


Create a class and inherit from DisposableObject as shown below:

using System;

public class SomeObject : DisposableObject
  protected override void OnDisposeManagedObjects()
    // ***
    // *** Disposed CLR managed objects here.
    // ***

  protected override void OnDisposeUnmanagedObjects()
    // ***
    // *** Disposed non-CLR managed objects here.
    // ***

Override one or both of the above methods depending on the type of resources your class uses.

When instantiating the class. wrap it in a using statement.

using (SomeObject obj = new SomeObject())
  // ***
  // *** obj will be disposed and the dispose
  // *** methods will be called.

or call the Dispose() method.

SomeObject obj = new SomeObject();

In either case, the OnDisposeManagedObjects() and OnDisposeUnmanagedObjects() are called.




Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net40 is compatible.  net403 was computed.  net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 3.1

    • No dependencies.
  • .NETFramework 4.0

    • No dependencies.
  • .NETFramework 4.5

    • No dependencies.
  • .NETFramework 4.6.1

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.
  • net5.0

    • No dependencies.
  • net6.0

    • No dependencies.

NuGet packages (12)

Showing the top 5 NuGet packages that depend on System.DisposableObject:

Package Downloads

A library for easy access to File based databases such as Microsoft Access, flat files or Excel Spreadsheets.


This library provides context implementations the work-flows and other context based operations.


This library provides some basic support functionality.


This library provides code performance tools.


This library provides an implementation of the repository that can be used with Entity Framework Core.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on System.DisposableObject:

Repository Stars
An ethernet based virtual Zebra Label Printer that can be used to test applications that produce bar code labels.
Version Downloads Last updated
8.0.0 81 11/25/2023
1.5.1 6,710 1/16/2022
1.5.0 505 1/16/2022
1.4.1 4,511 12/3/2020
1.4.0 535 12/2/2020
1.3.2 3,630 4/14/2020
1.3.1 1,722 1/27/2020