PartialSourceGen.Attributes 0.0.4

dotnet add package PartialSourceGen.Attributes --version 0.0.4                
NuGet\Install-Package PartialSourceGen.Attributes -Version 0.0.4                
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="PartialSourceGen.Attributes" Version="0.0.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PartialSourceGen.Attributes --version 0.0.4                
#r "nuget: PartialSourceGen.Attributes, 0.0.4"                
#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.
// Install PartialSourceGen.Attributes as a Cake Addin
#addin nuget:?package=PartialSourceGen.Attributes&version=0.0.4

// Install PartialSourceGen.Attributes as a Cake Tool
#tool nuget:?package=PartialSourceGen.Attributes&version=0.0.4                

NuGet Version

What is this

This is a library containing the marker attributes used in PartialSourceGen library. In the normal use case, this library is not necessary, so this should not be needed to install!

It is needed, if you need to enable InternalsVisibleTo and you will get an error of CS0436.

Why

The source generator generates the attributes used as markers into your project with an internal scope.

When enabling InternalsVisibleTo all projects that reference each other will generate their own version of the same attribute markers, which normally is not visible to other projects.

Installation

Run dotnet add package PartialSourceGen.Attributes to add the marker attributes.

Then in your csproj file enable PARTIALSOURCEGEN_EXCLUDE_ATTRIBUTES constant:

 
 <Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        
        <DefineConstants>PARTIALSOURCEGEN_EXCLUDE_ATTRIBUTES</DefineConstants>
    </PropertyGroup>
 </Project>

Contains

No logic only attributes.
The marker attributes can be found in the PartialSourceGen namespace:

  • Partial
  • IncludeInitializer
  • ExcludePartial
  • ForceNull
  • PartialReference

The PartialReference comes in 2 variants, the newer dotnet 7.0, generic attribute variant and the traditional non-generic attribute variant.

Alternative solution

You can write your own attributes and put them in the PartialSourceGen namespace. The attributes do not contain logic, and are only markers for the source generator.

Versioning

The versioning of this library does not follow the source generator versioning.

References

The main PartialSourceGen project can be found here: https://github.com/Newex/PartialSourceGen

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
.NET Framework net481 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.8.1

    • No dependencies.
  • net8.0

    • 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
0.0.4 102 9/24/2024
0.0.3 83 7/26/2024
0.0.2 129 4/6/2024
0.0.1 124 4/5/2024