We have set up a few Publish Profiles that are used to deploy web apps to various servers, and it all works great with 1-click deployment.
However, we find that even though the entire solution is under source control (SVN), the profiles do not seem to be carried over, so we need to re-create the profiles on each developer's machine manually.
It seems that since the profiles exist only for the solution currently loaded, that they must be stored in the solu开发者_如何学运维tion files somewhere. But they do not carry over when someone else does an update to pull down the code.
I'm guessing that whatever file they are in is one that we aren't covering in the source control project, but I haven't been able to figure out which one.
Someone must know where the Publish Profiles are stored. Is there any way to copy them from machine-to-machine so that we don't have to retype them for each developer?
The file name is actually going to be $(ProjectName).Publish.xml, and should be in the same folder as your .csproj file. If you enable the "Show All Files" option in Solution Explorer it will appear, and you can include it in your project from there. That will get it into source control.
One thing to be careful of: VS won't auto-check-out this file if you attempt to change and save the profile settings, but it won't throw an error either. There's a warning in one of the Output windows about it, if you pay attention; otherwise it will just look like it's ignoring your changes.
In the interest of keeping SO up to date, as of VS2012 (or VS2010 with Azure SDK 1.7+) publish profiles are now stored at Properties\PublishProfiles\$(ProfileName).pubxml
for Web Applications and App_Data\PublishProfiles\$(ProfileName).pubxml
for Websites.
They are also now MSBuild files and are expected to define properties as documented How to: Edit Deployment Settings in Publish Profile (.pubxml) Files
The reason I had this problem was due to .user
files: I noticed the settings were being saved in Properties/PublishProfiles/$(ProfileName).pubxml
but the actual credentials needed for deployment were saved in .user
files that were being excluded from source control.
On my Visual Studio 2010 install for a Web Site project, these files are under App_Date\PublishProfiles.
精彩评论