如何将deployIisAppPath指定为非DefaultWebSite的站点根目录?

Cod*_*ior 10 iis msbuild tfs msdeploy

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

SERVERNAME(myDomain\Username)
   Application Pools
   Sites
      Default Web Site
      MyProjectSite
         bin
         Content
         ...
         Views
Run Code Online (Sandbox Code Playgroud)

我正在尝试部署到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的tracelog无济于事.即使跟踪设置为详细,tracelog中也没有显示任何内容.我试过禁用两台计算机上的防火墙,似乎没有任何东西在这方面工作.

Cod*_*ior 5

想出这个.

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

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

我将Create deployment package as a zip file设置设置为false,Items to deploy下拉到只运行此应用程序所需的文件,所有内容都顺利完成.

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