msbuildvisual-studio-2017csprojassemblyinfo

Visual Studio 2017 and the new .csproj InternalsVisibleTo


Where do I put InternalsVisibleTo from AssemblyInfo in the new Visual Studio 2017 .csproj project file?


Solution

  • To clarify Hans Passant's comment above, you simply have to add InternalsVisibleTo to any cs file in your project. For example, I created an AssemblyInfo.cs file in the root of the project and then added the following content (only):

    using System.Runtime.CompilerServices;
    
    [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=<ADD_KEY_HERE>")]