/InternalReservedAttributeGenerator

A C# Source Generator for generating C# reserved attributes with internal accessibility.

Primary LanguageC#MIT LicenseMIT

InternalReservedAttributeGenerator

A C# Source Generator for generating C# reserved attributes with internal accessibility.

see also: https://github.com/ufcpp/InternalReservedAttributeContent

Some C# features depend on attributes and modifiers but these can be internal. For instance, you may get CS0518 "Predefined type 'System.Runtime.CompilerServices.IsExternalInit' is not defined or imported" errors when using records (C# 9.0 feature) and you can avoid this error by adding the IsExternalInit class internally in your project.

namespace System.Runtime.CompilerServices
{
    internal sealed class IsExternalInit { }
}

The InternalReservedAttributeGenerator automatically generates these attributes and modifiers:

NuGet

NuGet