SpanUnwrap.Fody 1.1.0

dotnet add package SpanUnwrap.Fody --version 1.1.0
                    
NuGet\Install-Package SpanUnwrap.Fody -Version 1.1.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="SpanUnwrap.Fody" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SpanUnwrap.Fody" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="SpanUnwrap.Fody" />
                    
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 SpanUnwrap.Fody --version 1.1.0
                    
#r "nuget: SpanUnwrap.Fody, 1.1.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 SpanUnwrap.Fody@1.1.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=SpanUnwrap.Fody&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=SpanUnwrap.Fody&version=1.1.0
                    
Install as a Cake Tool

SpanUnwrap.Fody

This is an add-in for Fody which lets you unwraps Span<T> and ReadOnlySpan<T> in compile time.

Installation

(Note: The following configurations are intended for SDK-style projects)

1. Core Packages and Settings

  • Install the NuGet packages Fody and SpanUnwrap.Fody. Installing Fody explicitly is needed to enable weaving.

    <PackageReference Include="Fody" Version="*">
        <PrivateAssets>all</PrivateAssets>
        <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="SpanUnwrap.Fody" Version="*">
        <PrivateAssets>all</PrivateAssets>
        <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    
  • If you already have a FodyWeavers.xml file in the root directory of your project, add the <SpanUnwrap /> tag there. This file will be created on the first build if it doesn't exist:

    <?xml version="1.0" encoding="utf-8" ?>
    <Weavers>
        <SpanUnwrap />
    </Weavers>
    

See Fody usage for general guidelines, and Fody Configuration for additional options.

2. Legacy Framework Support

If your project targets .NET Standard 2.0 (or lower), .NET Core 2.x (or lower), or .NET Framework, you must include System.Memory manually.

<PackageReference Include="System.Memory" Version="*" />

Tip: Zero-Runtime Dependency: If you only need System.Memory for compile-time constant access and want to keep your runtime clean, use the following configuration instead:

<PackageReference Include="System.Memory" Version="*">
    <PrivateAssets>all</PrivateAssets>
    <ExcludeAssets>runtime</ExcludeAssets>
    <IncludeAssets>compile; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

Usage

Use the Unwrap.From() method to unwrap a Span<T> or ReadOnlySpan<T> at compile time and expose its underlying storage directly.

See the GitHub repository for more information.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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-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 was computed.  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

  • .NETStandard 2.1

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 87 5/15/2026
1.0.0 81 5/15/2026