SpanUnwrap.Fody
1.1.0
dotnet add package SpanUnwrap.Fody --version 1.1.0
NuGet\Install-Package SpanUnwrap.Fody -Version 1.1.0
<PackageReference Include="SpanUnwrap.Fody" Version="1.1.0" />
<PackageVersion Include="SpanUnwrap.Fody" Version="1.1.0" />
<PackageReference Include="SpanUnwrap.Fody" />
paket add SpanUnwrap.Fody --version 1.1.0
#r "nuget: SpanUnwrap.Fody, 1.1.0"
#:package SpanUnwrap.Fody@1.1.0
#addin nuget:?package=SpanUnwrap.Fody&version=1.1.0
#tool nuget:?package=SpanUnwrap.Fody&version=1.1.0
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
FodyandSpanUnwrap.Fody. InstallingFodyexplicitly 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.xmlfile 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 | Versions 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. |
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.