MakeTypesPublic 1.0.1

Package disables access checks to non-public types and members.

Install-Package MakeTypesPublic -Version 1.0.1
dotnet add package MakeTypesPublic --version 1.0.1
<PackageReference Include="MakeTypesPublic" Version="1.0.1">
  <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.
paket add MakeTypesPublic --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MakeTypesPublic, 1.0.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install MakeTypesPublic as a Cake Addin
#addin nuget:?package=MakeTypesPublic&version=1.0.1

// Install MakeTypesPublic as a Cake Tool
#tool nuget:?package=MakeTypesPublic&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Overview

The package MakeTypesPublic is intended to disable access checks to non-public (private, internal) types and members.

How to use it

  • You need just add IgnoreAccessChecks metadata (IgnoreAccessChecks="true") to ProjectReference or PackageReference items.
  • You can also set IgnoreAccessChecks property (<IgnoreAccessChecks>true</IgnoreAccessChecks>) to true/false if you want to enable/disable it.
    By default it's enabled only for not design-time builds. So, Visual Studio will show errors but compiler and runtime will work.

How it works

There are a few types of access checks:

  • Compile-time access checks. You should compile with fake assemblies with public types and members (ideally reference-only assembly) to disable it.
    The Roslyn has options to disable access checks but those options are internal.
    To learn more see the following links:
    Link 1,
    Link 2,
    Link 3.
  • Run-time access checks. You should add IgnoresAccessChecksToAttribute assembly attributes to disable it.
  • Design-time access checks. There is a problem here.
    You could make Visual Studio to consume the fake assemblies. But this can lead to some problems. So I preferred just ignore those errors.
    Maybe there are other ways to suppress these errors? But I don't know them.
    If you still want to make Visual Studio to consume the fake assemblies you can set IgnoreAccessChecks property to true. By default this property is true only for not design-time builds.

Github

https://github.com/Denis535/MakeTypesPublic

NuGet

https://www.nuget.org/packages/MakeTypesPublic

Overview

The package MakeTypesPublic is intended to disable access checks to non-public (private, internal) types and members.

How to use it

  • You need just add IgnoreAccessChecks metadata (IgnoreAccessChecks="true") to ProjectReference or PackageReference items.
  • You can also set IgnoreAccessChecks property (<IgnoreAccessChecks>true</IgnoreAccessChecks>) to true/false if you want to enable/disable it.
    By default it's enabled only for not design-time builds. So, Visual Studio will show errors but compiler and runtime will work.

How it works

There are a few types of access checks:

  • Compile-time access checks. You should compile with fake assemblies with public types and members (ideally reference-only assembly) to disable it.
    The Roslyn has options to disable access checks but those options are internal.
    To learn more see the following links:
    Link 1,
    Link 2,
    Link 3.
  • Run-time access checks. You should add IgnoresAccessChecksToAttribute assembly attributes to disable it.
  • Design-time access checks. There is a problem here.
    You could make Visual Studio to consume the fake assemblies. But this can lead to some problems. So I preferred just ignore those errors.
    Maybe there are other ways to suppress these errors? But I don't know them.
    If you still want to make Visual Studio to consume the fake assemblies you can set IgnoreAccessChecks property to true. By default this property is true only for not design-time builds.

Github

https://github.com/Denis535/MakeTypesPublic

NuGet

https://www.nuget.org/packages/MakeTypesPublic

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.1 110 11/27/2020
1.0.0 112 11/27/2020