Meziantou.MSBuild.InternalsVisibleTo 1.0.1

Allow to declare 'InternalsVisibleTo' in the csproj file, rather than declaring them to an AssemblyInfo.cs file.

Install-Package Meziantou.MSBuild.InternalsVisibleTo -Version 1.0.1
dotnet add package Meziantou.MSBuild.InternalsVisibleTo --version 1.0.1
<PackageReference Include="Meziantou.MSBuild.InternalsVisibleTo" 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 Meziantou.MSBuild.InternalsVisibleTo --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Meziantou.MSBuild.InternalsVisibleTo

The code is an adaptation of https://github.com/thomaslevesque/InternalsVisibleTo.MSBuild to fit my needs. It adds the notion of suffix and the default suffix.

NuGet version

Allow to declare InternalsVisibleTo in the csproj file, rather than declaring them to an AssemblyInfo.cs file.

How to use

  1. Install the Meziantou.MSBuild.InternalsVisibleTo NuGet package.
  2. Edit your csproj file:
<Project Sdk="Microsoft.NET.Sdk">
  
  <ItemGroup>
    <InternalsVisibleTo Include="CustomTest1" /> <!-- [assembly: InternalsVisibleTo("CustomTest1")] -->
    <InternalsVisibleTo Include="CustomTest2, PublicKey=abc" /> <!-- [assembly: InternalsVisibleTo("CustomTest2, PublicKey=abc")] -->
    <InternalsVisibleTo Include="$(AssemblyName).Custom" /> <!-- [assembly: InternalsVisibleTo("ClassLibrary1.Custom")] -->

    <InternalsVisibleToSuffix Include=".Tests" /> <!-- [assembly: InternalsVisibleTo("ClassLibrary1.Tests")] -->
    <InternalsVisibleToSuffix Include=".FunctionalTests" /> <!-- [assembly: InternalsVisibleTo("ClassLibrary1.FunctionalTests")] -->
  </ItemGroup>

</Project>

This will generate the appropriate InternalsVisibleTo attributes for your assembly.

Meziantou.MSBuild.InternalsVisibleTo

The code is an adaptation of https://github.com/thomaslevesque/InternalsVisibleTo.MSBuild to fit my needs. It adds the notion of suffix and the default suffix.

NuGet version

Allow to declare InternalsVisibleTo in the csproj file, rather than declaring them to an AssemblyInfo.cs file.

How to use

  1. Install the Meziantou.MSBuild.InternalsVisibleTo NuGet package.
  2. Edit your csproj file:
<Project Sdk="Microsoft.NET.Sdk">
  
  <ItemGroup>
    <InternalsVisibleTo Include="CustomTest1" /> <!-- [assembly: InternalsVisibleTo("CustomTest1")] -->
    <InternalsVisibleTo Include="CustomTest2, PublicKey=abc" /> <!-- [assembly: InternalsVisibleTo("CustomTest2, PublicKey=abc")] -->
    <InternalsVisibleTo Include="$(AssemblyName).Custom" /> <!-- [assembly: InternalsVisibleTo("ClassLibrary1.Custom")] -->

    <InternalsVisibleToSuffix Include=".Tests" /> <!-- [assembly: InternalsVisibleTo("ClassLibrary1.Tests")] -->
    <InternalsVisibleToSuffix Include=".FunctionalTests" /> <!-- [assembly: InternalsVisibleTo("ClassLibrary1.FunctionalTests")] -->
  </ItemGroup>

</Project>

This will generate the appropriate InternalsVisibleTo attributes for your assembly.

Dependencies

This package has no dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.1 55 11/6/2019
1.0.0 49 11/2/2019