Nukepayload2.SourceGenerators.IgnoresAccessChecksTo 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Nukepayload2.SourceGenerators.IgnoresAccessChecksTo --version 1.0.0                
NuGet\Install-Package Nukepayload2.SourceGenerators.IgnoresAccessChecksTo -Version 1.0.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="Nukepayload2.SourceGenerators.IgnoresAccessChecksTo" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Nukepayload2.SourceGenerators.IgnoresAccessChecksTo --version 1.0.0                
#r "nuget: Nukepayload2.SourceGenerators.IgnoresAccessChecksTo, 1.0.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.
// Install Nukepayload2.SourceGenerators.IgnoresAccessChecksTo as a Cake Addin
#addin nuget:?package=Nukepayload2.SourceGenerators.IgnoresAccessChecksTo&version=1.0.0

// Install Nukepayload2.SourceGenerators.IgnoresAccessChecksTo as a Cake Tool
#tool nuget:?package=Nukepayload2.SourceGenerators.IgnoresAccessChecksTo&version=1.0.0                

IgnoresAccessChecksTo VB Source Generator (MSBuild)

The IgnoresAccessChecksToAttribute is the reverse of the InternalsVisibleToAttribute - it allows an assembly to declare assemblies whose internals would be visible to it. The attribute class isn't declared in the BCL but is recognized by the CLR (Desktop >= 4.6 and Core), i.e. you can declare it in your code and it would work.

Since there's currently no compiler support for this attribute, this package can be used as a workaround. It generates reference assemblies where all the internal types & members become public, and adds a VB file with the attribute and its instances.

Usage

Just add the package and define InternalsAssemblyName items with the assemblies you need access to.

<Project Sdk="Microsoft.NET.Sdk">

  <ItemGroup>
    <InternalsAssemblyName Include="AssemblyToGrantAccessTo1" />
    <InternalsAssemblyName Include="AssemblyToGrantAccessTo2" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Nukepayload2.SourceGenerators.IgnoresAccessChecksTo" Version="*" PrivateAssets="All" />
  </ItemGroup>

</Project>

By default, the build tasks replaces all method bodies with Throw New NullReferenceException. To keep the original bodies, you can specify:

  <PropertyGroup>
    <InternalsAssemblyUseEmptyMethodBodies>false</InternalsAssemblyUseEmptyMethodBodies>
  </PropertyGroup>
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETFramework 4.6

    • No dependencies.
  • .NETStandard 2.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
1.1.0 77 7/27/2024
1.0.0 279 9/24/2023

Initial release. The core logics came from "IgnoresAccessChecksToGenerator, version=0.6.0".