Vs 2012: Use signtool.exe in post build. The handling method for characters in special passwords

Source: Internet
Author: User

As we all know, in Visual Studio, you can use Post build to perform operations similar to cmd or batch processing. Microsoft's signtool is used in recent projects to sign a digital signature to a. xap (Silverlight compiled file) file.

Background: because the digital signature is about to expire, You need to replace the previous one with the new one. The letter signature is a file (XXX. pfx) applied by the IT department of the company, and the password is also provided by them. Because the IT department requires password protection, the Password Must Meet the so-called security rules, IT Department colleagues set the password to a string with "special characters" _ x % v? Xxx ^ xx2 "(X indicates a letter, which is considered safe and inconvenient to directly release the password :)). Therefore, when running the post build command, an error is reported: missing file...

"$ (Projectdir) signtool" sign/F "$ (projectdir) mysign. pfx"/P _ x % v? Xxx ^ xx2 "$ (targetdir) clientapplication. xap"

 

Solution: Check the special characters in the next batch and find that special characters must be processed using % or ^ (for example, add a % before the special character % to output % correctly ), in addition, strings containing special characters must be included in. The modified post build command is as follows:

"$ (Projectdir) signtool" sign/F "$ (projectdir) mysign. pfx"/P "_ x % v? Xxx ^ xx2 "$ (targetdir) clientapplication. xap"

 

Use the modified post build command to compile again. The result is correct... Good job !!

 

I also attached a link for processing special characters for batch processing, hoping to help: http://www.hackbase.com/tech/2009-09-27/56481.html

Vs 2012: Use signtool.exe in post build. The handling method for characters in special passwords

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.