MSBuild 2010-如何将Web应用发布到特定位置(自然)? [英] MSBuild 2010 - how to publish web app to a specific location (nant)?
问题描述
我正在尝试让MSBuild 2010将Web应用发布到特定位置. 我可以将部署包发布到特定路径,但是部署包会添加自己的更改路径.
I'm trying to get MSBuild 2010 to publish a web app to a specific location. I can get it to publish the deployment package to a particular path, but the deployment package then adds its own path that changes.
例如:如果我告诉它发布到C:\dev\build\Output\Debug
,那么实际的Web文件最终会出现在C:\dev\build\Output\Debug\Archive\Content\C_C\code\app\Source\ControllersViews\obj\Debug\Package\PackageTmp
路径的C_C
部分会发生变化(不确定如何选择路径的这一部分).
For example: if I tell it to publish to C:\dev\build\Output\Debug
then the actual web files end up at C:\dev\build\Output\Debug\Archive\Content\C_C\code\app\Source\ControllersViews\obj\Debug\Package\PackageTmp
And the C_C
part of the path changes (not sure how it chooses this part of the path).
这意味着我不能只是从发布位置编写副本脚本.
This means I can't just script a copy from the publish location.
此刻我正在使用以下nant/msbuild命令:
I'm using this nant/msbuild command at the moment:
<target name="compile" description="Compiles">
<msbuild project="${name}.sln">
<property name="Platform" value="Any CPU"/>
<property name="Configuration" value="Debug"/>
<property name="DeployOnBuild" value="true"/>
<property name="DeployTarget" value="Package"/>
<property name="PackageLocation" value="C:\dev\build\Output\Debug\"/>
<property name="AutoParameterizationWebConfigConnectionStrings" value="false"/>
<property name="PackageAsSingleFile" value="false"/>
</msbuild>
关于如何获取它以将Web文件直接发送到特定位置的任何想法?
Any ideas on how to get it to send the web files directly to a specific location?
推荐答案
msbuild /t:Build;PipelinePreDeployCopyAllFilesToOneFolder /p:Configuration=Release;_PackageTempDir=C:\temp\somelocation;AutoParameterizationWebConfigConnectionStrings=false MyProject.csproj
相应的NAnt脚本:
<msbuild project="MyProject.csproj" target="PipelinePreDeployCopyAllFilesToOneFolder">
<property name="Configuration" value="Release" />
<property name="_PackageTempDir" value="C:\temp\somelocation" />
<property name="AutoParameterizationWebConfigConnectionStrings" value="false" />
</msbuild>
参考文献
- 在Visual Studio 2010中模拟发布到文件夹"功能
- 团队构建+ Web部署+ Web部署+ VS 2010 =优点
- Simulating "Publish to folder" Functionality in Visual Studio 2010
- Team Build + Web Deployment + Web Deploy + VS 2010 = Goodness
References
这篇关于MSBuild 2010-如何将Web应用发布到特定位置(自然)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!