2

我正在尝试使用 Visual Studio 的团队资源管理器和 TFS 创建构建定义以将 MVC 站点部署到 IIS。

我遵循了名为“使用 Team Foundation Server 2010 进行持续部署”的 Pluralsight 教程。

我从教程中遵循的步骤包括:

  • 安装的 IIS 管理脚本和工具
  • 安装管理服务
  • 在管理服务上,我允许远程连接并仅启用 Windows 凭据
  • 已安装的 Web 部署
  • 创建了部署域帐户
  • 允许域帐户权限修改 IIS 文件系统
  • 使用此域帐户设置委派规则
  • 使用域帐户设置 IIS 权限

我在构建定义中设置的 MSBuild 争论是:

/p:DeployOnBuild=true 
/p:DeployTarget=MSDeployPublish 
/p:CreatePackageOnPublish=False 
/p:MSDeployPublishMethod=WMSVC 
/p:SkipExtraFilesOnServer=True 
/p:AllowUntrustedCertificate=True 
/p:MSDeployServiceUrl="https://<iis server name>:8172/msdeploy.axd"
/p:Username="<domain>\<user>" 
/p:Password="<password>" 
/p:DeployIISAppPath="Default Web Site/<site name>"

我将构建排队并通过,写入放置文件夹但未写入 IIS。

我使用相同的属性值从解决方案资源管理器发布了 MVC 应用程序,它已成功部署到 IIS。

有谁知道我错过了什么?

4

2 回答 2

6

I solved the problem by examining the contents on my local machine and the comparing it with the build server.

I found that the 'Web' and 'WebApplication' folders on my local machine at 'C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0' were not present in the same location on the build server.

Once I copied and pasted them across my build worked and the mvc site was deployed to IIS as expected.

于 2012-12-21T03:24:25.653 回答
3

这是对我有用的设置。尝试更改 CreatePackageOnPublish=True 并查看它是否有效。

/p:DeployOnBuild=True
/p:DeployTarget=MsDeployPublish
/p:CreatePackageOnPublish= True
/p:MSDeployPublishMethod=WMSVC
/p:MSDeployServiceUrl=https://ServerName:8172/MSDeploy.axd /p:DeployIisAppPath="NameofWebsiteOnIISServer"
/p :AllowUntrustedCertificate=True
/p:UserName="domain\serviceaccount"
/p:Password="AwesomeSecurePassword"

首先,我建议检查您是否能够通过 webdeploy 直接通过 Visual Studio 发布。下面列出了在 Visual Studio 中找出正确的 Web 部署设置的最佳方法。我推荐这种方法,因为它会给你错误消息v / s“每次都排队一个新的构建”来查看网站是否已发布。

  1. 右键单击 IIS7 里面的网站 --> WebDeploy --> 点击 Configure Web Deploy Publishing
  2. 单击设置,然后获取生成的发布设置文件,并在您右键单击网站并单击 Visual Studio 中的发布网站时导入这些发布设置。
  3. 尝试先使用 Visual Studio 发布一键发布,因为在 Visual Studio 中使用 Web 部署发布更容易发现错误。

如果您收到错误,则此站点 ( http://www.iis.net/learn/publish/troubleshooting-web-deploy/web-deploy-error-codes ) 包含与之相关的所有错误消息。

确保您指定的服务帐户是否列在“管理”下的“IIS 管理器权限”部分中。

还要检查“ Web 管理服务”和“ Web 部署代理服务”服务是否正在运行。

于 2012-12-04T15:14:24.157 回答