O'Reilly logo

Professional Visual Studio® 2010 by Chris Anderson, Michael Minutillo, David Gardner, Nick Randolph

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 46. Assembly Versioning And Signing

WHAT'S IN THIS CHAPTER?

  • Versioning Assemblies

  • Signing an Assembly to give it a Strong Name

  • Managing Strongly Named Assemblies in the Global Assembly Cache

When you create a .NET assembly, you can optionally sign it to provide it with a strong name. An assembly without a strong name is identified by its filename, which often is not enough to uniquely identify it. This means that other projects that depend on your assembly cannot be guaranteed to consume the correct version. A strongly named assembly can be uniquely identified by dependent projects and even system administrators, who can apply a security policy to your assembly.

In this chapter, you learn how to use Visual Studio 2010 to set the assembly version number, and how you can use a digital signature to sign your assembly so that it can't be tampered with. This will also result in a strongly named assembly, which can be added to the Global Assembly Cache.

ASSEMBLY NAMING

Every .NET assembly, whether it is an executable or a class library, contains a manifest that has information about the assembly's identity. Primarily this includes the name and version number of the assembly, but also includes culture and public key if it is a strongly named assembly. This information can be easily viewed by opening an assembly in Red Gate's .NET Reflector, as shown in Figure 46-1.

Figure 46-1

Figure 46-1. Figure 46-1 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required