MsBuild 发布网站而不使用发布配置文件 [英] MsBuild publish website without using publish profile

查看:26
本文介绍了MsBuild 发布网站而不使用发布配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

发布配置文件可以从 Visual Studio 2013 发布对话框和命令行 MsBuild 中使用发布 Visual Studio 网站,如本问题中所述使用 msbuild 执行文件系统发布配置文件

A publish profile to publish a Visual Studio Website can be used from both the Visual Studio 2013 publish dialog, and from the command line MsBuild as explained in this question Using msbuild to execute a File System Publish Profile

C:WindowsMicrosoft.NETFrameworkv4.0.30319MSBuild.exe 
./ProjectRoot/MyProject.csproj /p:DeployOnBuild=true /p:PublishProfile=FileSystemDebug

但是,我想完全摆脱发布配置文件并从命令行执行所有操作 - 因为我不希望发布路径在 PublishProfile xml 文件中硬编码.如何直接在命令行参数中指定相同的选项?我已尝试改用 OutDir,但这会导致与 PublishProfile 中指定的路径不同的行为(在我的路径中附加了一个额外的 _PublishedWebsites).

However, I want to get rid of the publish profile completely and do everything from the command line - because I do not want the publish path to be hard-coded in the PublishProfile xml file. How can I specify the same options directly in the command line arguments? I have tried using OutDir instead, but that results in a different behavior than the path specified in the PublishProfile (an extra _PublishedWebsites is appended to my path).

推荐答案

您实际上可以从命令行覆盖 PublishProfile 设置.你会想要这个参数:

You can actually override the PublishProfile settings from the command line. You would want this parameter:

/p:publishUrl=pathToPublishHere

如果它是本地文件系统,这应该可以正常工作.

If it's local filesystem this should work just fine.

这篇关于MsBuild 发布网站而不使用发布配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆