MsBuild发布网站而不使用发布配置文件 [英] MsBuild publish website without using publish profile
问题描述
要发布Visual Studio网站,可以使用发布配置文件从Visual Studio 2013发布对话框,以及从命令行MsBuild,如本问题使用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:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.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屋!