views:

239

answers:

2

From the MSDN help, it says the -Vr option is:

Registers assembly for verification skipping.

My question is when the -Vr is used, will it only change the assembly file itself or it will change the system registry as well. This matters whether I should issue this command in the development machine or in the final deployed machine.

A: 

Neither. You shouldn't skip verification on your deployment version.

Anon.
Actually it's not deployment system, it's my test system. Please suggest. If I run -Vr in test system, does it mean the signature will NOT be validated in the test system at all?
Bin Chen
You'll need to add it the verification skiplist on the machine you intend to test on.
Anon.
If I only run "sn -Vr a.dll", is the a.dll skipped in the machine that running tht command?
Bin Chen
+1  A: 

sn -Vr creates an entry in the registry on the local machine. It does not modify the assembly. You must run sn -Vr locally on every machine on which you wish to skip verification of the target assembly's strong name.

Since you mention that your concern is for a test machine, you may want to keep in mind that at least some of your test runs really ought to be run against the "as shipped" state of the application, which would include the final signature for assemblies. While I understand that key management concerns might preclude applying the final signature to, say, automated builds, you're eventually going to need to test using fully signed assemblies and no verification skipping if you want to emulate the eventual execution environment.

Nicole Calinoiu
Hi Nicole, do you know the difference between with the userlist argument and without the userlist argument?
Bin Chen
If you don't specify a userlist, the verification skip entry will be added under HKLM\SOFTWARE\Microsoft\StrongName\Verification. If you do specify a userlist, the verification skip entry will still be added under the same key, but it will have an additional UserList value that specifies the user(s) to which the verification skipping applies. When the .NET runtime verifies an assembly's signature, it should only consider apply verification skipping for users in the UserList for any given skip entry in the registry if a UserList is present.
Nicole Calinoiu