参照http://blogs.technet.com/b/jonathanalmquist/archive/2008/08/19/seal-a-management-pack.aspx
注意:这个public key 被用了在 unseal.xml,就是publictoken.这个每次都要手工修改。
Sealing a Management Pack is easy. Although, it can be frustrating the first time through. It's a process that requires a few different pieces to interact, so preparation is key. Going through some simple steps now will save time in the future.
Finally, the c:\MPS directorywill look like this.
The two files highlighted:
Command.txt is just a file I created that contains the commands needed to sealthe management pack. The MPResources.resources file is automatically createdwhile sealing management packs. This is not anything you’ll need to copy intothe directory.
Now, we're ready to seal ourManagement Pack.
Open a command prompt andnavigate to your work directory (c:\MPS). Run these commands in sequence.(beware of word wrap with these commands)
You should now have your sealedMP in the Output directory. And, you'll have a working directory for later use.Just remember to keep the MP versions in the c:\MPS\MP directory current withyour Management Groups. Otherwise, you'll get version errors while attemptingto run the MPSeal tool.
Hint: Once you've created the key the firsttime around, it's not necessary to create a new key each time you seal a MP.The current key may be reused. So, the only step you'll need to actually doafter the first run is the last step. How's that for easy!
A note todevelopers: I’ve hadsome questions about where theMPResources.resources file mentionedabove is created. Specifically, if two build flavor threads (x64 and x86, forexample), compiles at same time and try to create this file under sources, onebuild thread will break.
To solve that problem, executeMPSeal from a different location. Examples below.
This will create theMPResources.resources file in the users %temp% directory.
This will create theMPResources.resources file in the x86 directory I created.
This will create theMPResources.resources file in the x64 directory I created.