在 TFS 资源管理器中,我在“构建定义编辑器”->“流程”->“构建流程参数”->“6. 发布 - Azure 网站”->“Web 部署发布配置文件”下找到了此属性:
我下载了发布配置文件,但 TFS 构建报告以下错误:
Overall Build Process
Update Build Number
Run On Agent (reserved build agent Hosted Build Agent)
Create Workspace
Get Workspace
Create Label
Compile, Test, and Associate Changesets and Work Items
Compile and Test
Fetch Azure Web Site Publish Profile
Run MSBuild for Project
Built $/myproj/myproj/myproj.sln for default targets.
Built $/myproj/myproj/myproj/myproj.csproj for default targets.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets (4435): The value for PublishProfile is set to 'myproj.azurewebsites.net', expected to find the file at 'C:\a\src\myproj\myproj\myproj\Properties\PublishProfiles\myproj.azurewebsites.net' but it could not be found.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets (4449): Target ValidatePublishProfileSettings Failed MSBuild Log File
Handle Exception
Create Work Item
Associate Changesets and Work Items
Exception Message: MSBuild error 1 has ended this build. You can find more specific information about the cause of this error in above messages. (type BuildProcessTerminateException)
Exception Stack Trace:
at System.Activities.Statements.Throw.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
Drop Files to Drop Location
Work item '4: Build Failure in Build: myproj_2012-55-10_07-55.1' was opened by the build.
最佳答案
我遇到了类似的问题,实际上没有很多关于build设置的文档。我从你的屏幕截图中看到你正在使用 .publishsettings 文件,但我无法让它工作,相反我认为你需要一个 .pubxml 文件。
试试这个:
- 右键单击项目并选择发布(或发布网站)
- 您将看到发布向导,在配置文件选项卡上选择导入并选择从 Azure 门户下载的文件。
- 关闭向导。 (我第一次手动发布,但我不认为这是必要的)。此时 Visual Studio 应该已经创建了 3tow .pubxml 文件。一份用于 webdeploy,一份用于 ftp。
- 将此文件 checkin 源代码管理系统中的某处
- 在问题的第一个屏幕截图中使用其源代码管理文件夹位置来选择第 6 步中的文件。
希望有帮助,它为我解决了这个问题。
关于tfs - 属性 "Web Deploy Publish Profile"有何用途?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13798356/