DisposableHelpers 1.2.130

This package has a SemVer 2.0.0 package version: 1.2.130+build.20250923191053.51a217a.
There is a newer version of this package available.
See the version list below for details.
dotnet add package DisposableHelpers --version 1.2.130
                    
NuGet\Install-Package DisposableHelpers -Version 1.2.130
                    
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="DisposableHelpers" Version="1.2.130" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DisposableHelpers" Version="1.2.130" />
                    
Directory.Packages.props
<PackageReference Include="DisposableHelpers" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DisposableHelpers --version 1.2.130
                    
#r "nuget: DisposableHelpers, 1.2.130"
                    
#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.
#:package DisposableHelpers@1.2.130
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DisposableHelpers&version=1.2.130
                    
Install as a Cake Addin
#tool nuget:?package=DisposableHelpers&version=1.2.130
                    
Install as a Cake Tool

DisposableHelpers

Disposable helpers for IDisposable and IAsyncDisposable with source generators. Also capable of both anonymous disposable and anonymous async disposable.

NuGets

Name Info
DisposableHelpers NuGet

Installation

// Install release version
Install-Package DisposableHelpers

// Install pre-release version
Install-Package DisposableHelpers -pre

Supported frameworks

.NET Standard 2.0 and above - see https://github.com/dotnet/standard/blob/master/docs/versions.md for compatibility matrix

Usage

Disposable

using DisposableHelpers;

namespace YourNamespace
{
    public class SampleDisposable : Disposable
    {
        private SampleUnmanagedResource resources;
        
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                resources.Release();
            }
            base.Dispose(disposing);
        }
    }
}

Disposable Source Generator

using DisposableHelpers.Attributes;

namespace YourNamespace
{
    [Disposable]
    public partial class SampleDisposable
    {
        private SampleUnmanagedResource resources;
        
        protected void Dispose(bool disposing)
        {
            if (disposing)
            {
                resources.Release();
            }
            base.Dispose(disposing);
        }
    }
}

Anonymous Disposable

using DisposableHelpers;

namespace YourNamespace
{
    public static class Program
    {
        private static SampleUnmanagedResource resources;
        
        public static void Main(string[] args)
        {
            Disposable disposable = new Disposable(disposing =>
            {
                if (disposing)
                {
                    resources.Release();
                }
            });

            disposable.Dispose();
        }
    }
}

AsyncDisposable

using DisposableHelpers;

namespace YourNamespace
{
    public class SampleAsyncDisposable : AsyncDisposable
    {
        private SampleAsyncUnmanagedResource resources;
        
        protected override async ValueTask Dispose(bool isDisposing)
        {
            if (isDisposing)
            {
                await resources.Release();
            }
            return base.Dispose(isDisposing);
        }
    }
}

AsyncDisposable Source Generator

using DisposableHelpers.Attributes;

namespace YourNamespace
{
    [AsyncDisposable]
    public partial class SampleAsyncDisposable
    {
        private SampleAsyncUnmanagedResource resources;
        
        protected async ValueTask Dispose(bool isDisposing)
        {
            if (isDisposing)
            {
                await resources.Release();
            }
            return base.Dispose(isDisposing);
        }
    }
}

Anonymous AsyncDisposable

using DisposableHelpers;

namespace YourNamespace
{
    public static class Program
    {
        private static SampleAsyncUnmanagedResource resources;
        
        public static async void Main(string[] args)
        {
            AsyncDisposable disposable = new AsyncDisposable(async disposing =>
            {
                if (disposing)
                {
                    await resources.Release();
                }
            });

            await disposable.DisposeAsync();
        }
    }
}

Want To Support This Project?

All I have ever asked is to be active by submitting bugs, features, and sending those pull requests down!.

paypal

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  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 is compatible.  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 is compatible.  net8.0-android was computed.  net8.0-browser 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.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  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)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on DisposableHelpers:

Package Downloads
SingletonSessionHelpers

Provides a base API for singleton session design pattern.

LockerHelpers

Provides helpers for execution locking mechanism.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.152 58 1/13/2026
1.2.151 1,013 12/10/2025
1.2.150 5,543 12/2/2025
1.2.149 123 12/1/2025
1.2.148 92 11/28/2025
1.2.147 267 11/28/2025
1.2.146 79 11/27/2025
1.2.145 355 11/25/2025
1.2.144 213 11/25/2025
1.2.143 99 11/25/2025
1.2.142 275 11/11/2025
1.2.141 101 11/11/2025
1.2.140 7,232 11/6/2025
1.2.139 97 11/6/2025
1.2.138 738 11/4/2025
1.2.137 109 11/4/2025
1.2.136 749 11/2/2025
1.2.135 3,269 10/14/2025
1.2.134 127 10/9/2025
1.2.133 112 10/9/2025
1.2.132 149 9/30/2025
1.2.131 145 9/29/2025
1.2.130 164 9/23/2025
1.2.129 161 9/9/2025
1.2.128 10,140 9/5/2025
1.2.127 1,953 8/20/2025
1.2.126 138 8/19/2025
1.2.125 3,328 8/9/2025
1.2.124 123 8/7/2025
1.2.123 187 8/6/2025
1.2.121 118 8/5/2025
1.2.120 97 7/29/2025
1.2.119 771 7/29/2025
1.2.118 84 7/29/2025
1.2.117 82 7/29/2025
1.2.116 94 7/29/2025
1.2.115 165 7/17/2025
1.2.113 587 7/10/2025
1.2.112 122 7/8/2025
1.2.111 817 6/10/2025
1.2.110 179 6/10/2025
1.2.109 174 6/4/2025
1.2.108 175 5/27/2025
1.2.107 1,172 5/14/2025
1.2.106 179 5/13/2025
1.2.105 248 5/5/2025
1.2.104 146 5/5/2025
1.2.102 1,719 4/8/2025
1.2.101 386 3/25/2025
1.2.99 279 3/24/2025
1.2.98 286 3/17/2025
1.2.97 323 3/12/2025
1.2.93 661 2/20/2025
1.2.92 317 2/20/2025
1.2.90 573 1/27/2025
1.2.89 376 1/20/2025
1.2.88 332 1/16/2025
1.2.86 499 1/10/2025
1.2.84 318 1/8/2025
1.2.83 457 12/31/2024
1.2.82 345 12/27/2024
1.2.81 347 12/26/2024
1.2.80 415 12/18/2024
1.2.79 363 12/17/2024
1.2.78 398 12/6/2024
1.2.77 466 12/5/2024
1.2.76 357 12/5/2024
1.2.75 331 12/3/2024
1.2.74 244 12/3/2024
1.2.73 348 12/3/2024
1.2.71 262 12/3/2024
1.2.70 397 11/25/2024
1.2.69 262 11/25/2024
1.2.68 237 11/22/2024
1.2.67 281 11/22/2024
1.2.64 458 11/20/2024
1.2.63 214 11/19/2024
1.2.62 379 11/14/2024
1.2.60 321 11/13/2024
1.2.59 352 11/12/2024
1.2.58 330 11/8/2024
1.2.57 214 11/8/2024
1.2.56 178 11/8/2024
1.2.55 194 11/8/2024
1.2.54 203 11/7/2024
1.2.53 329 11/6/2024
1.2.52 178 11/6/2024
1.2.51 320 11/5/2024
1.2.50 416 10/30/2024
1.2.49 295 10/30/2024
1.2.48 328 10/29/2024
1.2.47 412 10/28/2024
1.2.46 222 10/25/2024
1.2.45 461 10/23/2024
1.2.44 368 10/22/2024
1.2.43 468 10/17/2024
1.2.42 492 10/14/2024
1.2.41 433 10/11/2024
1.2.40 634 10/7/2024
1.2.39 434 10/4/2024
1.2.38 403 10/2/2024
1.2.37 412 9/27/2024
1.2.36 193 9/27/2024
1.2.35 218 9/27/2024
1.2.34 504 9/25/2024
1.2.33 297 9/25/2024
1.2.32 400 9/23/2024
1.2.31 205 9/23/2024
1.2.30 401 9/20/2024
1.2.29 275 9/20/2024
1.2.28 426 9/18/2024
1.2.27 310 9/16/2024
1.2.26 439 9/10/2024
1.2.24 491 9/5/2024
1.2.23 502 8/29/2024
1.2.22 411 8/26/2024
1.2.21 370 8/22/2024
1.2.20 215 8/22/2024
1.2.19 208 8/22/2024
1.2.18 322 8/20/2024
1.2.17 512 8/14/2024
1.2.16 299 8/13/2024
1.2.15 540 7/31/2024
1.2.14 228 7/31/2024
1.2.13 283 7/26/2024
1.2.12 630 7/16/2024
1.2.11 257 7/15/2024
1.2.10 230 7/13/2024
1.2.9 263 7/12/2024
1.2.8 286 7/9/2024
1.2.7 270 7/8/2024
1.2.6 216 7/8/2024
1.2.5 208 7/8/2024
1.2.4 279 7/7/2024
1.2.3 369 7/1/2024
1.2.2 226 6/30/2024
1.2.1 268 6/28/2024
1.2.0 355 5/3/2024
1.1.16 1,533 10/3/2023
1.1.15 447 8/30/2023
1.1.14 383 8/28/2023
1.1.13 435 8/8/2023
1.1.12 412 7/11/2023
1.1.11 279 7/9/2023
1.1.10 375 6/20/2023
1.1.9 2,040 9/8/2022
1.1.8 542 9/4/2022
1.1.7 526 9/4/2022
1.1.6 2,983 7/20/2022
1.1.5 588 7/20/2022
1.1.4 606 7/17/2022
1.1.3 563 7/17/2022
1.1.2 596 7/17/2022
1.1.1 597 7/17/2022
1.1.0 628 7/17/2022
1.0.2 5,073 3/7/2022
1.0.1 3,678 2/21/2022
1.0.0 1,422 2/17/2022

## New Version
* Bump `disposable_helpers` from `1.2.129` to `1.2.130`. See [changelog](https://github.com/Kiryuumaru/DisposableHelpers/compare/disposable_helpers/1.2.129...disposable_helpers/1.2.130)

## What's Changed
* Bump NukeBuildHelpers from 9.0.0 to 9.0.1 by @dependabot[bot] in https://github.com/Kiryuumaru/DisposableHelpers/pull/190

**Full Changelog**: https://github.com/Kiryuumaru/DisposableHelpers/compare/build.20250909191254.4a50d05...build.20250923191053.51a217a