Net4x.Collections.Immutable 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Net4x.Collections.Immutable --version 1.0.0
                    
NuGet\Install-Package Net4x.Collections.Immutable -Version 1.0.0
                    
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="Net4x.Collections.Immutable" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Net4x.Collections.Immutable" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Net4x.Collections.Immutable" />
                    
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 Net4x.Collections.Immutable --version 1.0.0
                    
#r "nuget: Net4x.Collections.Immutable, 1.0.0"
                    
#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 Net4x.Collections.Immutable@1.0.0
                    
#: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=Net4x.Collections.Immutable&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Net4x.Collections.Immutable&version=1.0.0
                    
Install as a Cake Tool

Net4x.Collections.Immutable

Net4x.Collections.Immutable is a lightweight collection of immutable collection types and helpers targeting older .NET Framework versions (3.5, 4.0 and 4.5). It provides back-ported immutable collection APIs and utilities inspired by modern .NET immutable collections so you can write safer, thread-friendly code on legacy platforms.

Key features

  • Immutable arrays, dictionaries, stacks and sorted collections.
  • API designed to be familiar to developers who have used System.Collections.Immutable.
  • Works with .NET Framework 3.5, 4.0 and 4.5 builds included in the solution.

Getting started

  • Clone the repository and open the solution in Visual Studio (matching the target framework you need).
  • The solution contains project configurations for .NET Framework 3.5, 4.0 and 4.5.
  • Build the solution or add a project reference to the Net4x.Collections.Immutable project from your application.

Usage example

using System.Collections.Immutable;

// Immutable array
var arr = ImmutableArray.Create(1, 2, 3);
var arr2 = arr.Add(4); // returns a new instance

// Immutable dictionary
var dict = ImmutableDictionary.Create<int, string>();
var dict2 = dict.Add(1, "one");

// Immutable stack
var stack = ImmutableStack<int>.Empty;
var stack2 = stack.Push(10);

Build

  • Open the solution in Visual Studio and build the desired target configuration.
  • The projects target .NET Framework 3.5 / 4.0 / 4.5; ensure your IDE supports those frameworks.

Contributing

  • Contributions and bug reports are welcome. Please open issues or pull requests on the repository.

License This project is licensed under the Apache-2.0 license. See the LICENSE.txt file for details.

Author

  • Piero Viano
Product Compatible and additional computed target framework versions.
.NET Framework net35 is compatible.  net40 is compatible.  net403 was computed.  net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Net4x.Collections.Immutable:

Package Downloads
Net4x.Extensions.Primitives

Primitives shared by framework extensions.

Net4x.Reflection.Metadata

This packages provides a low-level .NET (ECMA-335) metadata reader and writer. It's geared for performance and is the ideal choice for building higher-level libraries that intend to provide their own object model, such as compilers.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.5.0.5 346 1/5/2026
2.5.0.4 226 12/30/2025
2.5.0.3 157 12/26/2025
2.5.0.2 146 12/21/2025
2.5.0.1 376 11/30/2025
2.5.0 883 4/4/2025
2.3.0 280 8/26/2023
2.3.0-at20230430063241 193 5/7/2023
2.2.1-at20230411061659 194 4/14/2023
2.1.0 299 4/8/2023
1.0.0 51 12/30/2025