Hafner.Compatibility.ExtensionAttribute
1.0.2
See the version list below for details.
dotnet add package Hafner.Compatibility.ExtensionAttribute --version 1.0.2
NuGet\Install-Package Hafner.Compatibility.ExtensionAttribute -Version 1.0.2
<PackageReference Include="Hafner.Compatibility.ExtensionAttribute" Version="1.0.2" />
paket add Hafner.Compatibility.ExtensionAttribute --version 1.0.2
#r "nuget: Hafner.Compatibility.ExtensionAttribute, 1.0.2"
// Install Hafner.Compatibility.ExtensionAttribute as a Cake Addin #addin nuget:?package=Hafner.Compatibility.ExtensionAttribute&version=1.0.2 // Install Hafner.Compatibility.ExtensionAttribute as a Cake Tool #tool nuget:?package=Hafner.Compatibility.ExtensionAttribute&version=1.0.2
Defines the System.Runtime.CompilerServices.Extension attribute for frameworks that do not include it, namely .NET framework 2.0 and 3.0.
Usage:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1;netcoreapp3.0;netcoreapp2.2;netcoreapp2.1;netcoreapp2.0;netcoreapp1.1;netcoreapp1.0;netstandard2.1;netstandard2.0;netstandard1.6;netstandard1.5;netstandard1.4;netstandard1.3;netstandard1.2;netstandard1.1;netstandard1.0;net48;net472;net471;net47;net462;net461;net46;net452;net451;net45;net403;net40;net35;net30;net20</TargetFrameworks>
<FrameworksLackingExtensionAttribute>|net20|net30|</FrameworksLackingExtensionAttribute>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<!-- Replace '#' through '$'! -->
<ItemGroup Condition="#(FrameworksLackingExtensionAttribute.Contains('|#(TargetFramework)|'))">
<PackageReference Include="Hafner.Compatibility.ExtensionAttribute">
<Version>1.0.0</Version>
</PackageReference>
</ItemGroup>
</Project>
Above XML is a Visual Studio 2022 C# project file (*.csproj) that targets all the frameworks from .NET 2.0 to .NET 6.0 for the .NET flavors '.NET Framework', '.NET Core' and '.NET Standard'.
Watch out: If you copy/paste above snipet you need to replace the '#' signs through '$' signs.
I had to check it in like this as otherwise the condition got interpreted, sorry about that.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net20 is compatible. net30 is compatible. net35 was computed. net40 was computed. net403 was computed. net45 was computed. 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. |
-
.NETFramework 2.0
- No dependencies.
-
.NETFramework 3.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Hafner.Compatibility.ExtensionAttribute:
Package | Downloads |
---|---|
Hafner.Compatibility.MetaPackage
Meta-package that includes Hafner.Compatibility.* packages (see https://github.com/HugoRoss/Hafner.Compatibility.Packages) as required. See 'PackageReadMe.md' for an overview with the exact types that are currently supported and for which framework they are imported. |
|
Hafner.Compatibility.Attributes
Meta-package that includes Hafner.Compatibility.* packages as needed. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Usage added to package description.