To all developers who haven’t heard of this, there is an ability to have a project, say a test project, to have access to another project’s Internal classes. (MSDN definition).
For security reasons, make sure that your test assembly is strongly named. You can achieve this via the “Signing” tab on the project properties.
Don’t ask why I’m playing with COM projects with .NET (I’m messing with the MSBuild sdc tasks and their automated COM components install tasks)
However, I still choose to use the Visual Studio command line to create my keys via the Strong Name tool (sn.exe) and then browse for it via the “Signing” tab on project properties. Make sure you are in the same directory as your solution file (.sln)
sn -k TestComComponent.snk // Generate strong name key
sn -p TestComComponent.snk key.publickey // Extract public key from TestComComponent.snk into key.publickey
This gives us the public key blob that we need to embed into the InternalsVisibleTo attribute we are going to add to our AssemblyInfo.cs file.
This is what you would need to add to your AssemblyInfo.cs file of your main assembly: