Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2005
Design Warnings
 Assemblies should have valid strong...
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:

Want more? Here are some additional resources on this topic:

Visual Studio Team System
Assemblies should have valid strong names

TypeName

AssembliesShouldHaveValidStrongNames

CheckId

CA2210

Category

Microsoft.Design

Breaking Change

NonBreaking

An assembly is not signed with a strong name, the strong name could not be verified, or the strong name would not be valid without the current registry settings of the computer.

This rule retrieves and verifies the strong name of an assembly. A violation occurs if any of the following are true:

  • The assembly does not have a strong name.

  • The assembly was altered after signing.

  • The assembly is delay-signed.

  • The assembly was incorrectly signed, or signing failed.

  • The assembly requires registry settings to pass verification. For example, the Strong Name tool (Sn.exe) was used to skip verification for the assembly.

The strong name protects clients from unknowingly loading an assembly that has been tampered with. Assemblies without strong names should not be deployed outside of very limited scenarios. If you share or distribute assemblies that are not correctly signed, the assembly can be tampered with, the common language runtime might not load the assembly, or the user might have to disable verification on his or her computer. An assembly without a strong name suffers from the following drawbacks:

  • Its origins cannot be verified.

  • The common language runtime cannot warn users if the contents of the assembly have been altered.

  • It cannot be loaded into the global assembly cache.

Note that to load and analyze a delay-signed assembly, you must disable verification for the assembly.

To fix a violation of this rule, use the Strong Name tool (sn.exe) to create a key file and sign the assembly with a strong name using one of the following procedures:

Only exclude a warning from this rule if the assembly is used in an environment where tampering with the contents is not a concern.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
How to quickly sign your assembly.      David M. Kean - MSFT ... dNetGuru   |   Edit   |  

To sign your assembly with a strong name, do the following:

  1. In Visual Studio 2005, open your solution.
  2. In Solution Explorer, right-click your project and choose Properties
  3. In the Project properties, choose the the Signing tab and check the Sign the assembly checkbox
  4. Drop the Choose a strong name key file combo and choose New
  5. In the Create Strong Name Key window and enter a name for your strong name key in the Key file name textbox
  6. Choose whether to protect the key with a password and click OK
  7. Under the Build menu, choose Build [projectname]
Note : You can also use a key file from your storage, to do so in the 4th step choose Browse and select the preferred Key file from the storage attached to your computer, then skip to the last step

That's it!

Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker