How To: Turn off Strong Name Validation


Syed Aslam Basha here from the Information Security Tools team.

In one of my application testing I faced issue of “strong name validation failed” for a assembly, had to figure out a way to turn off strong name validation so that I can carryout testing on the given assembly while I get appropriate assembly.

The actual error is

“Unhandled exception: System.IO.FileLoadException: Could not load file or assembly ‘application name, version=4.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a’ or one of its dependencies. Strong name validation failed.<Exception from HRESULT: 0x8013141A>”

Steps to turn off strong name validation:

Launch visual studio command prompt in admin mode and run the following command

sn –Vr *,b03f5f7f11d50a3a

-Vr <assembly> [<userlist>] [<infile>]
   Register <assembly> for verification skipping (with an optional, comma separated list of usernames for which this will take effect and an optional test public key in <infile>).
<assembly>    can be specified as * to indicate all assemblies or *,<public key token> to indicate that all assemblies with the given public key token. Public key tokens should be specified as a string of hex digits.

Similarly you can remove verification skipping entries,

sn –Vu *,b03f5f7f11d50a3a
-Vu <assembly>
   Unregister <assembly> for verification skipping. The same rules for <assembly> naming are followed as for -Vr.

sn -Vx
-Vx
   Remove all verification skipping entries.

-Syed Aslam Basha (syedab@microsoft.com)

Microsoft Information Security Tools (IST) Team

Test Lead

---------------------------------------------------------

Please leave a comment if the blog post has helped you.

Skip to main content