UPDATE May 2019: Works great with Visual Studio 2019.
For everyone using Visual Studio 2017, there is a final method:
In our favorite IDE, go to " Tools> External Tools ... " and " Add " a new tool with the following settings:
- Title: Get PublicKey
- Command: " C: \ Program Files (x86) \ Microsoft SDKs \ Windows \ v10.0A \ bin \ NETFX 4.6.2 Tools \ sn.exe " (/! \ Select the version of the NETFX tool that matches your version of the NETFX build, here it is 4.6.2)
- Arguments: -Tp $ (TargetPath)
- Check "Use output window"
Apply / OK these changes.
In Solution Explorer, click the build name of your project , and then go to Tools> Get PublicKey . The output window should display the (rather long) public key along with the token public key.
Finally, in the project that contains the inner class (ie the tested project) that you want to provide, open the file " AssemblyInfo.cs " and add the line:
[assembly: InternalsVisibleTo ("MyCompany.SolutionName.ProjectName, PublicKey = Insert your public key here")]
/! \ You must remove line breaks from your public key.
This worked great for me, so hopefully this helps you too!
Invvard
source share