10

我有一个 ASP.NET MVC Web 应用程序项目,我想将它部署到我的 IIS 网络服务器。站点树是这样设置的:

SERVERNAME(myDomain\Username)
   Application Pools
   Sites
      Default Web Site
      MyProjectSite
         bin
         Content
         ...
         Views

我正在尝试部署到 MyProject 站点。请参阅下面我使用的设置与我返回的错误。我显然没有正确指定我的站点路径,但对于我的生活,我无法弄清楚它应该是什么。

以下设置在迭代之间保持不变:

/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:CreatePackageOnPublish=False /p:MSDeployPublishMethod=WMSvc /p:AuthType=Basic /p:Username="myUserName" /p:Password="MyPassword" /p:AllowUntrustedCertificate=True

将 SiteName/ 指定为 IISAppPath:

参数:

/p:MsDeployServiceUrl="https://serverName:8172/MsDeploy.axd?Site=MyProjectSite" /p:DeployIisAppPath="MyProjectSite/"

错误:

Could not complete an operation with the specified provider ("createApp") when connecting using the Web Management Service- 我不想创建新网站。我想同步已经存在的内容。

将 IISAppPath 指定为 Root(假设使用 URL 中的站点名称)

参数:

/p:MsDeployServiceUrl="https://serverName:8172/MsDeploy.axd?Site=MyProjectSite" /p:DeployIisAppPath="/"

错误:

Could not complete an operation with the specified provider ("iisApp") when connecting using the Web Management Service- 看起来它正在尝试访问默认网站或其他东西(我故意没有赋予自己权利)。

将 IISAppPath 指定为空字符串(假设使用 URL 中的站点名称)

参数:

/p:MsDeployServiceUrl="https://serverName:8172/MsDeploy.axd?Site=MyProjectSite" /p:DeployIisAppPath=""

错误:

The "ConcatFullServiceUrlWithSiteName" task was not given a value for the required parameter "SiteAppName"- 所以它将“”解释为实际上是一个空值,从而破坏了连接它的尝试。

在 URL 中不指定站点属性,但将 SiteName/ 指定为 IISAppPath

参数:

/p:MsDeployServiceUrl="https://serverName:8172/MsDeploy.axd" /p:DeployIisAppPath="MyProjectSite/"

错误:

Could not complete an operation with the specified provider ("createApp") when connecting using the Web Management Service

在 URL 中不指定站点属性,但将 SiteName 指定为 IISAppPath

参数:

/p:MsDeployServiceUrl="https://serverName:8172/MsDeploy.axd" /p:DeployIisAppPath="MyProjectSite"

错误:

Could not complete an operation with the specified provider ("createApp") when connecting using the Web Management Service

现在鉴于它在 SiteAppName 上运行连接,它必须将它与站点名称结合起来,是吗?你应该放什么来让网站同步到网站的根目录?

更新

为了找出正确的路径方案,我尝试使用 Visual Studio 2012 发布对话框进行发布。在这种情况下,我收到一条错误消息,指出请求超时(测试连接几乎可以立即工作,预览更改工作但需要几秒钟)。我检查了事件日志,wmsvc 的跟踪日志无济于事。即使将跟踪设置为详细,跟踪日志中也不会显示任何内容。我已尝试禁用两台计算机上的防火墙,但在这方面似乎也没有任何效果。

4

1 回答 1

5

想出了这个。

问题源于项目属性的 Web 部署页面中的两个设置。我之前已经设置了这个项目(在调试配置中),只复制运行应用程序所需的文件,而不是构建一个 zip 包。但是,我忽略了对发布配置的这些设置做任何事情。

它尝试使用 createApp 的原因(置信度为 75%)是因为它是从它创建的 Zip 包进行部署的。所以在这些情况下我的 IISAppPath 设置很好,我只是部署了错误的东西。

我将Create deployment package as a zip file设置设置为 false,并将Items to deploy下拉菜单设置为仅运行此应用程序所需的文件,一切顺利。

顺便说一句,我发现(如上所述)您可以使用 Visual Studio 中的 Web 发布对话框输出的发布配置文件(不幸的是 2012 年;2010 年您必须做一些我不确定的按摩)。我命名我的没有空格,并提供密码作为参数以及不受信任的证书设置。现在 TFS 的构建定义中的 MSBuild 参数如下所示: /p:DeployOnBuild=True;PublishProfile=NameOfPublishProfile /p:AllowUntrustedCertificate=True /p:Password=PleaseVerifyMe

于 2013-03-06T16:57:47.603 回答