Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2012 Publish Profiles - Encrypted Password

I've loved using the new VS 2012 Publishing Profiles, but when using them on a build server i'm unsure how to store the password.

When I tick the box the "save the password" it creates a .pubxml.user file and encrypts the password in an XML node.

When i run the deployment on a build server the password file always seems to be ignored.

I can get away with storing the password in a

<PropertyGroup>
    <Password>NotMyRealPassword>
</PropertyGroup

But given they are already encrypting it i'd love to use the VS Encryption if I can.

How do i unecrypt and fill the <Password> property without building a custom task to do so?

Also - if I did have to build a custom MSBUILD task, what type of encryption is in use in this SUO file?

like image 858
Doug Avatar asked Oct 03 '12 07:10

Doug


1 Answers

As I was trying to write an answer to your question I realized that I'm not well suited to answer the quetsion, but I did want to make some comments on the .pubxml.user file.

When you save a web publish profile in Visual Studio we encrypt the password and store the encrypted value in the .pubxml.user file for the given publish profile. We encrypt this value on a per-user/per-machine basis. So if you take the same file to a different machine (or if a different user logged into the same machine) it would not decrypt to the correct value. Because of this it's not worth investigating if you can decrypt the value which is stored by VS on a build server.

like image 176
Sayed Ibrahim Hashimi Avatar answered Nov 13 '22 08:11

Sayed Ibrahim Hashimi