【问题标题】:TFS Build Process Publishes Web Site under different name than specified in Publish ProfileTFS 构建过程以不同于发布配置文件中指定的名称发布网站
【发布时间】:2013-03-20 20:57:55
【问题描述】:

我正在使用 TFS Build 使用我定义的发布配置文件发布网站。发布发生了,但它发布到以 Web 应用程序项目名称命名的 Web 应用程序,而不是我在发布配置文件中指定的名称。如果我使用相同的发布配置文件发布到我的本地计算机,它会使用我在发布配置文件中指定的名称进行发布。尽管在 TFS 构建案例中它是本地非域帐户,但我在这两种情况下都使用了管理帐户。

使用的参数如下(出于安全原因删除了相关细节):

/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:PublishProfile=MyProfile 
/p:AllowUntrustedCertificate=True /p:MSDeployPublishMethod=WMSVC 
/p:MSDeployServiceUrl=https://SomeName:8172/MsDeploy.axd 
/p:UserName=SomeName\LocalAdminDude /p:Password=SomePassword

发布配置文件本身如下所示:

<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize     the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit     http://go.microsoft.com/fwlink/?LinkID=208121. 
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
   <WebPublishMethod>MSDeploy</WebPublishMethod>
   <SiteUrlToLaunchAfterPublish/>http://Server/NameIWant</SiteUrlToLaunchAfterPublish>
   <MSDeployServiceURL>https://Server:8172/msdeploy.axd</MSDeployServiceURL>
   <DeployIisAppPath>Default Web Site/NameIWant</DeployIisAppPath>
   <RemoteSitePhysicalPath />
   <SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
   <MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
   <UserName>Server\LocalAdminDude</UserName>
   <_SavePWD>True</_SavePWD>
 </PropertyGroup>
</Project>

基本上,如果我的网络项目名为 NameIWantPROJECT,我希望它发布到一个名为 NameIWant 的网站。如果我在本地发布,那行得通,如果我使用上述参数通过 TFS,它会发布为 NameIWantPROJECT 而不是我指定的。

【问题讨论】:

  • 检查Build definition 中的Build Defaults 选项卡。也许还有一些其他的放置文件夹而不是你想要的。
  • 我相信我已经找到了答案。构建服务器是 TFS 2010,Visual Studio 是 2012。似乎 TFS 2010 不支持或识别 PublishProfile 属性。发布配置文件是 2012 年新增的,支持似乎没有被向后移植...
  • 很高兴听到您发现了这一点。很高兴看到答案仍然像现在一样。

标签: asp.net web build tfs publish


【解决方案1】:

尝试使用 /p:DeployIisAppPath 代替 /p:PublishProfile。即添加以下参数。

/p:DeployIisAppPath="默认网站/NameYouWant"

TFS 2010 对我有用。

【讨论】:

    猜你喜欢
    • 2018-07-04
    • 1970-01-01
    • 1970-01-01
    • 2019-03-18
    • 2012-11-07
    • 2013-01-01
    • 2014-09-16
    • 2013-06-29
    • 2016-10-19
    相关资源
    最近更新 更多