1.12. Give an Assembly a Strong Name

Problem

You need to give an assembly a strong name for several reasons:

  • So it has a unique identity, which allows people to assign specific permissions to the assembly when configuring code access security policy

  • So it can't be modified and passed off as your original assembly

  • So it can be installed in the GAC and shared across multiple applications

Solution

When you build your assembly using the command-line VB .NET compiler, use the /keyfile or /keycontainer compiler switch to specify the location of your strong-named key pair. Use assembly-level attributes to specify optional information such as the version number and culture for your assembly. The compiler will strong name your assembly as part of the compilation ...

Get Visual Basic 2008 Recipes: A Problem-Solution Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.