如何使用 Visual Studio 2010 RC“一键发布”从命令行?

发布于 2024-08-21 17:54:48 字数 952 浏览 2 评论 0 原文

我已经运行了 VS 2010 RC,并在其中设置了两个发布配置文件,一个用于发布到临时服务器,另一个用于开发人员测试箱。它工作得很好,但我想将我们的开发服务器的部署放入我们的构建服务器中并在签入时运行它。

我正在寻找一个 MS Build 目标或一个可以通过 MS Build 调用的命令,我可以将其添加到构建过程的末尾进行部署。到目前为止我已经想出了;

msbuild WebApp.csproj /t:MsDeployPublish 
    /p:MsDeployServiceUrl=myserver;DeployIisAppPath=
        "Default Web Site/DevTest";username=myname;password=mypassword

这几乎可以工作,只是它假设我的服务器在 IIS 中具有用于 Web 部署服务的 SSL 连接(它只有端口 80,因为它位于内部网络上)。我知道这一点是因为我收到了错误;

Microsoft.Web.Publishing.targets(3481,5): error : Web deployment 
task failed.(Could not complete the request to remote agent URL 
'https://myserver:8172/msdeploy.axd?site=Default Web Site'.)

您可以从错误中看到它已转到 https://myserver 而不是 http://myserver

MS Build 本身似乎调用了 DLL 来执行此操作,因此我无法监视参数,并且没有 MsDeployServiceUrl 的文档。

I've got VS 2010 RC running and have two publish profiles set up in it, one for publishing to the staging server and one for the developer test box. It works great but I want to put the deployment to our dev server into our build server and run it on check-in.

I'm looking for an MS Build target or a command I can call via MS Build that I can tack onto the end of the build process to deploy. So far I have come up with;

msbuild WebApp.csproj /t:MsDeployPublish 
    /p:MsDeployServiceUrl=myserver;DeployIisAppPath=
        "Default Web Site/DevTest";username=myname;password=mypassword

Which nearly works, except that it assumes my server has an SSL connection in IIS for the web deployment service (it only has port 80 as it is on an internal network). I know this because I get the error;

Microsoft.Web.Publishing.targets(3481,5): error : Web deployment 
task failed.(Could not complete the request to remote agent URL 
'https://myserver:8172/msdeploy.axd?site=Default Web Site'.)

You can see from the error that it has gone to https://myserver and not http://myserver.

MS Build itself seems to call a DLL to do this, so I can't spy on the parameters and there is no documentation for MsDeployServiceUrl.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

灼痛 2024-08-28 17:54:48

尝试将 : 添加

 /p:AllowUntrustedCertificate=True 

到 msbuild 的参数列表中

Try adding :

 /p:AllowUntrustedCertificate=True 

to your list of arguments to msbuild

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文