Skip to content
Enables declaring 'InternalsVisibleTo' items in a .NET project file, rather than declaring them to an AssemblyInfo.cs file.
Branch: master
Clone or download
Pull request Compare This branch is 4 commits ahead, 5 commits behind thomaslevesque:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
build
buildMultiTargeting
.gitignore
LICENSE
Meziantou.MSBuild.InternalsVisibleTo.nuspec
README.md
nuget.exe

README.md

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.

You can’t perform that action at this time.