PartialSourceGen.Attributes
0.0.2
See the version list below for details.
dotnet add package PartialSourceGen.Attributes --version 0.0.2
NuGet\Install-Package PartialSourceGen.Attributes -Version 0.0.2
<PackageReference Include="PartialSourceGen.Attributes" Version="0.0.2" />
paket add PartialSourceGen.Attributes --version 0.0.2
#r "nuget: PartialSourceGen.Attributes, 0.0.2"
// Install PartialSourceGen.Attributes as a Cake Addin #addin nuget:?package=PartialSourceGen.Attributes&version=0.0.2 // Install PartialSourceGen.Attributes as a Cake Tool #tool nuget:?package=PartialSourceGen.Attributes&version=0.0.2
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 | Versions 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. |
-
.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.