- Verify the location of your DOTNET SDK directory. You simply need
sn.exe
available to the batch script. Modify the sdkdir variable to a directory containing the tool. - DragDrop the assembly you need a key from onto the batch-script provided.
- Note that 'Your-AssemblyName' (as in the demo assemblyinfo.cs) is stored within the csproj main
PropertyGroup
and of course, is calledAssemblyName
. - Once you performed step-1, you need to clean out the whitespace between line-segments of the
PublicKey
so that it reads on one line---careful to not make any errors, otherwise you will get compile errors and the dependant assembly will not see the internals. - Be careful copy/pasting the key into the appropriate location, within your
AssemblyInfo.cs
file. - Compile
TIP: Note that the first few times you use the InternalsVisibleAttribute can be a pain until you get used to it. You might want to use the same key-file in both assemblies to get started. Dont copy or duplicate the keyfile, use the 'browse' feature of VisualStudio's project-settings to use the exact same keyfile.