如何使用MsBuild MsDeployPublish来定位本地文件系统?
我正在尝试复制 Visual Studio 2010“发布...”命令(适用于 Web 应用程序项目),我将在 UI 中选择发布方法:“文件系统”。
我对此的尝试是......
%msbuild% /t:MsDeployPublish /property:MsDeployServiceUrl="file:///d:\MyDeploymentFolder";MsDeployPublishMethod="文件系统" "d:\MySourceFolder\Project.csproj"
...并尝试了“的方法”文件系统”、“文件系统”、“本地”和其他一些。
我收到的错误意味着 MsDeploy 仍在尝试推送到 IIS 服务器:
"D:\MySourceFolder\Project.csproj" (MsDeployPub
lish target) (1) ->
(MSDeployPublish target) ->
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web
.Publishing.targets(3847,5): error : Web deployment task failed.(The metabase k
ey '/lm/w3svc' could not be found.) [D:\MySourceFolder\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.P
ublishing.targets(3847,5): error : \r [D:\MySourceFolder\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.P
ublishing.targets(3847,5): error : The metabase key '/lm/w3svc' could not be fo
und.\r [D:\MySourceFolder\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.P
ublishing.targets(3847,5): error : Unable to access the IIS configuration syste
m. Please make sure you have IIS 7 (or later) installed.\r [D:\MySourceFolder\Project.csproj]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.P
ublishing.targets(3847,5): error : Retrieving the COM class factory for compone
nt with CLSID {2B72133B-3F5B-4602-8952-803546CE3344} failed due to the followin
g error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REG
DB_E_CLASSNOTREG)). [D:\MySourceFolder\Project.csproj]
如何以文件系统为目标进行部署,因为 Visual Studio 通常允许我使用 GUI?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
根据我的回答 使用 MSBuild,如何从命令行构建 MVC4 解决方案(在此过程中应用 Web.config 转换)和输出到一个文件夹?
或者如果您正在构建解决方案文件:
您也可以目标使用
/t:SolutionFolder/Project:Target
语法通过解决方案访问项目:As per my answer from Using MSBuild, how do I build an MVC4 solution from the command line (applying Web.config transformations in the process) and output to a folder?
Or if you are building the solution file:
You can also target the project via the solution using the
/t:SolutionFolder/Project:Target
syntax:我放弃了尝试让 MSBuild 复制可部署的 Web 文件(除此之外不做任何其他事情),因此我在 PowerShell 中编写了它的脚本,并对结果感到非常满意。比我通过 MSBuild 尝试过的任何东西都要快得多。这是要点(字面上):
I gave up trying to get MSBuild to copy deployable web files (and not do anything else but that), so I scripted it in PowerShell and am really happy with the result. Much faster than anything I tried through MSBuild. Here's the gist (literally):
我认为您对 msbuild 的描述不够具体。
从我关于该主题的书签之一中拉出此内容,希望它会有所帮助:http://www.digitallycreated.net/Blog/59/locally-publishing-a-vs2010-asp.net-web-application-using-msbuild
I don't think you are being specific enough with what you are telling msbuild.
Pulled this out of one of my bookmarks on the subject, hopefully it will help: http://www.digitallycreated.net/Blog/59/locally-publishing-a-vs2010-asp.net-web-application-using-msbuild