Coder Social home page Coder Social logo

hafner.compatibility.nullablereferencetypeattributes's Introduction

Hafner.Compatibility.NullableReferenceTypeAttributes

Defines the nullable reference type attributes of namespace System.Diagnostics.CodeAnalysis for frameworks that do not include them, namely .NET Framework 2.0 to 4.8, .NET Core 1.0 to 2.2 and .NET Standard 1.0 to 2.2.

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>
    <FrameworksLackingNullableReferenceTypeAttributes>|net20|net30|net35|net40|net403|net45|net451|net452|net46|net461|net462|net47|net471|net472|net48|netcoreapp1.0|netcoreapp1.1|netcoreapp2.0|netcoreapp2.1|netcoreapp2.2|netstandard1.0|netstandard1.1|netstandard1.2|netstandard1.3|netstandard1.4|netstandard1.5|netstandard1.6|netstandard2.0|</FrameworksLackingNullableReferenceTypeAttributes>
    <LangVersion>latest</LangVersion>
    <Nullable>enable</Nullable>
    <NoWarn>NETSDK1138</NoWarn>
  </PropertyGroup>

  <!-- Replace '#' through '$'! -->
  <ItemGroup Condition="#(FrameworksLackingNullableReferenceTypeAttributes.Contains('|#(TargetFramework)|'))">
    <PackageReference Include="Hafner.Compatibility.NullableReferenceTypeAttributes">
      <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.

hafner.compatibility.nullablereferencetypeattributes's People

Contributors

hugoross avatar

Watchers

 avatar

hafner.compatibility.nullablereferencetypeattributes's Issues

Strong named assemblies for .NET 4.x?

Hi,

First, I'd like to say thanks for taking the time to do this package.

Would you consider strong naming the assemblies for .NET 4.x targets? This is required for a lot of projects, mine included. ๐Ÿ˜‡

Thank you so much!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.