FutureFeatureGenerator 1.4.0

dotnet add package FutureFeatureGenerator --version 1.4.0
                    
NuGet\Install-Package FutureFeatureGenerator -Version 1.4.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="FutureFeatureGenerator" Version="1.4.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FutureFeatureGenerator" Version="1.4.0" />
                    
Directory.Packages.props
<PackageReference Include="FutureFeatureGenerator">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
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 FutureFeatureGenerator --version 1.4.0
                    
#r "nuget: FutureFeatureGenerator, 1.4.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 FutureFeatureGenerator@1.4.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=FutureFeatureGenerator&version=1.4.0
                    
Install as a Cake Addin
#tool nuget:?package=FutureFeatureGenerator&version=1.4.0
                    
Install as a Cake Tool

Create a file named FutureFeature.txt in your project directory. If it doesn't take effect, check the file properties and set it to C# Analyzer Additional Files.

File example:

System.Diagnostics.CodeAnalysis.AllowNullAttribute
;Comment
System
    Reflection
        AssemblyMetadataAttribute
    Runtime.CompilerServices public
        * 
    Diagnostics.CodeAnalysis
        DisallowNullAttribute public
    IO
        Stream
            Read() public
            Write() public
    ArgumentNullException public
        ThrowIfNull() public

You can write the full type name on one line, or you can write it with indentation levels as shown below. When writing to the type name, you can use * to include all types in the current namespace.

Each level of indentation is defined by 1 Tab or 4 Spaces. Adjacent levels are considered connected by ., non-adjacent levels will be skipped.

You can write * on the first line of the file, which will include all types.

Each type has its own #if conditional compilatio.

The default modifier is internal. If you want to change it to public, simply add a space and the word public after the type you wish to modify.

If the target to be added is a method, the type where the method resides will be named "Future" plus the original type name. If the method is an instance method, this will be added as an extension method. If it is a static method, it will be added as is.

For the convenience of multi-targeting compilation, such as netstandard2.0;net6, the compilation condition for static methods is set to true, so there's no need to write conditional compilation.

FutureArgumentNullException.ThrowIfNull(arg);

#if NET6_0_OR_GREATER
ArgumentNullException.ThrowIfNull(arg);
#else
FutureArgumentNullException.ThrowIfNull(arg);
#endif

There are three configuration items. default is false UseExtensions adds extensions() outside static methods.
UseRealCondition uses actual conditions instead of #if true. Below is the enabling syntax. DisableAddDependencies disable classes and methods that auto add dependencies

@UseExtensions true
@UseRealCondition true
@DisableAddDependencies true

Example:

@UseExtensions true
@UseRealCondition true
System.ArgumentException
    ThrowIfNullOrEmpty()
    ThrowIfNullOrWhiteSpace()

You can write the final node name without indentation. (if multiple are found, they will all be added) Example:

System.Runtime.CompilerServices
    IsExternalInit
;same effect as below
IsExternalInit

Provide the following types and methods:

System
    Diagnostics.CodeAnalysis
        AllowNullAttribute
        DisallowNullAttribute
        DoesNotReturnAttribute
        DoesNotReturnIfAttribute
        ExperimentalAttribute
        MaybeNullAttribute
        MaybeNullWhenAttribute
        MemberNotNullAttribute
        MemberNotNullWhenAttribute
        NotNullAttribute
        NotNullIfNotNullAttribute
        NotNullWhenAttribute
        StringSyntaxAttribute
    IO
        Stream
            ;Read(Span<byte>)
            Read()
            ;Write(ReadOnlySpan<byte>)
            Write()
    Reflection
        AssemblyMetadataAttribute
    Runtime.CompilerServices
        CallerArgumentExpressionAttribute
        CallerFilePathAttribute
        CallerLineNumberAttribute
        CallerMemberNameAttribute
        CompilerFeatureRequiredAttribute
        IsExternalInit
        OverloadResolutionPriorityAttribute
        RequiredMemberAttribute
    ; FutureArgumentException
    ArgumentException
        ThrowIfNullOrEmpty()
        ThrowIfNullOrWhiteSpace()
    ; FutureArgumentNullException
    ArgumentNullException
        ThrowIfNull()
    ArgumentOutOfRangeException
        ThrowIfEqual()
        ThrowIfNotEqual()
        ThrowIfGreaterThan()
        ThrowIfGreaterThanOrEqual()
        ThrowIfLessThan()
        ThrowIfLessThanOrEqual()
    Char
        IsAscii()
        IsBetween()
        IsAsciiDigit()
    Index
    Range
    Type
        GetConstructor()
        GetMethod()
    ObjectDisposedException
        ;ThrowIf()
        ThrowIf(Boolean,Object)
        ThrowIf(Boolean,Type)
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

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.4.0 97 8/21/2025
1.3.0 148 5/2/2025
1.2.0 1,214 1/24/2025