visual-studio Visual Studio 2010 发布配置文件——它们存储在哪里?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2917939/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio 2010 Publish Profiles -- Where are they stored?
提问by Jeff S
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.
我们已经设置了一些用于将 Web 应用程序部署到各种服务器的发布配置文件,并且通过一键式部署可以很好地工作。
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.
但是,我们发现即使整个解决方案都在源代码控制(SVN)之下,但配置文件似乎没有被继承,因此我们需要在每个开发人员的机器上手动重新创建配置文件。
It seems that since the profiles exist only for the solution currently loaded, that they must be stored in the solution 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?
必须有人知道发布配置文件的存储位置。有什么方法可以将它们从机器复制到机器,这样我们就不必为每个开发人员重新键入它们?
回答by Michael Edenfield
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.
文件名实际上是 $(ProjectName).Publish.xml,并且应该与 .csproj 文件位于同一文件夹中。如果您在解决方案资源管理器中启用“显示所有文件”选项,它将出现,您可以从那里将其包含在您的项目中。这将使其进入源代码控制。
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.
需要注意的一件事:如果您尝试更改和保存配置文件设置,VS 不会自动检出此文件,但它也不会引发错误。如果您注意的话,在输出窗口之一中会有一个关于它的警告;否则它看起来就像忽略了您的更改。
回答by Richard Szalay
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).pubxmlfor Web Applications and App_Data\PublishProfiles\$(ProfileName).pubxmlfor Websites.
为了使 SO 保持最新状态,从 VS2012(或VS2010 with Azure SDK 1.7+)开始Properties\PublishProfiles\$(ProfileName).pubxml,Web 应用程序和App_Data\PublishProfiles\$(ProfileName).pubxml网站的发布配置文件现在存储在。
They are also now MSBuild files and are expected to define properties as documented How to: Edit Deployment Settings in Publish Profile (.pubxml) Files
它们现在也是 MSBuild 文件,预计将按照文档中的说明定义属性:如何:在发布配置文件 (.pubxml) 文件中编辑部署设置
回答by SilverlightFox
The reason I had this problem was due to .userfiles: I noticed the settings were being saved in Properties/PublishProfiles/$(ProfileName).pubxmlbut the actual credentials needed for deployment were saved in .userfiles that were being excluded from source control.
我遇到这个问题的原因是由于.user文件:我注意到设置正在保存,Properties/PublishProfiles/$(ProfileName).pubxml但部署所需的实际凭据保存在.user从源代码管理中排除的文件中。
回答by Keith Hoffman
On my Visual Studio 2010 install for a Web Site project, these files are under App_Date\PublishProfiles.
在我为网站项目安装的 Visual Studio 2010 中,这些文件位于 App_Date\PublishProfiles 下。

