Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top