First, let's take a look.ProgramSET command: command line InputIldasmThis is an disassembly program. In addition,. Net reflector is also a powerful tool for analyzing assembly, which canCode
Decompiled into C #, C ++, and VB. Http://www.aisto.com/roeder/dotnet.
To put it bluntly, the shared Assembly requires a strong name. Use sn.exe to generate a key pair. Procedure:
- Create a class library. The namespace is sharing, which is consistent with the process of creating a common class library.
- Create a strong name: generate a public key and private key pair, and strictly protect the private key.
① You can select project Properties> signing> sign the assembly, and then select or add the pfx file.
② Use the command line tool:
Generation:Sn-KE: \ study \ assemblyshared \ sharing \ test1.keys note that the following path should specify the complete path of the file. At the beginning, it was always fail, which was caused by a problem in writing this path.
- View the public key:Sn-PE: \ study \ assemblyshared \ sharing \ test1.keys E: \ study \ assemblyshared \ sharing \ test1.key
- Then useSn-TPCommand to view the Public Key
5. Install the shared assembly and run the gacutil/I command. At the beginning, the system prompts you to use the Administrator account to perform the operation. Later, the operation is successful.
6. Create a project and use the shared assembly. Make sure to set the referenced property localcopy to false.
7. Main commands used for strong naming:
Generation: Sn-K Keyfile. SNK public key and private key pair
Public extraction key: Sn-P Keyfile. SNK public. SNK extract the public key from Keyfile and save it to the public. SNK file to sign the Assembly later.
Skip verification: Sn-VR Assembly performs skip verification on the Assembly on the development machine. The Assembly is not signed.
Signature: Sn-r Assembly Keyfile. SNK late signature of assembly, this step is done before release
Cancel skip verification: Sn-vu Assembly cancels skip verification on the Assembly on the development machine. The Assembly is signed at this time.
Or cancel all: Sn-VX cancel all verification