Assigning a strong name to the yfiles.NET assemblies
Tips & TricksSummary
This article shows how to assign a strong name to the assemblies from the yfiles.NET or yfiles WPF distributions.
Description
The assemblies from the yFiles.NET / yFiles WPF distribution are not strongly named. This is intentional, since you are required to to obfuscate yfiles.NET prior to distribution. However, this obfuscation step invalidates any strong name assigned previously, thus resulting in an unusable library. Simply resigning the assemblies with our strong name key is not possible for you, since you'd need access to the private key from our keypair.
Therefore, if you need to have strongly named yFiles assemblies (e.g. if you are building a strongly named application), you have to sign the assemblies with your own company key. This step is usually part of the build process of an assembly, so the usual methods (e.g. source attributes, al.exe, sn -R) won't work here. However, you can resort to freely available third party tools.Using StrongNameSigner.exe
You can use the freely available StrongNameSigner tool for this purpose. This tool offers both a GUI as well as a command line interface and an API for integration into build engines. Please see the documentation for integration as a MSBuild target.- Open the Visual Studio Command prompt or otherwise make sure that your PATH includes the .NET SDK binaries, and change to the directory where you want to perform the signing.
- Create two directories unsigned and signed and copy the yFiles assemblies you want to sign to the unsigned directory
- In a command window, execute:
C:\Program Files\BrutalDev.NET Assembly Strong-Name Signer\StrongNameSigner.Console.exe -in .\unsigned -out .\signed -k YOUR_KEY_FILE.snk - The resulting assemblies will be placed in the signed directory and should now have a valid strong name from your company key. You can check this with:
sn -T signed\yfilesAlgorithms.dll
The public key token must match the token of your public key.
InternalsVisibleTo attribute for friend assemblies has to include the public key of the signed assembly, otherwise accessing internal members from friend assemblies won't work. This most prominently affects the CreateLayerConstraintFactory and CreateSequenceConstraintFactory. The current version of StrongNameSigner will make this adjustment automatically if you sign all assemblies at once.Resources
Categories this article belongs to:
yFiles for Silverlight > Deployment
yFiles WPF > Deployment
yFiles.NET > Deployment
Applies to:
yFiles.NET: 4.0, 4.1, 4.2, 4.3, 5.0, 5.1, 5.2, 5.3, 5.4, 5.5, 5.6
yFiles WPF: 1.0, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6
yFiles for Silverlight: 1.0, 2.0, 2.1, 2.2, 2.3
Keywords:
assemblies - strong name - Signer - StrongNameSigner