MSBuild 2010 - 如何将 Web 应用程序发布到特定位置 (nant)? [英] 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:devuildOutputDebug
那么实际的 web 文件最终会在 C:devuildOutputDebugArchiveContentC_CcodeappSourceControllersViewsobjDebugPackagePackageTmp
并且路径的 C_C
部分发生了变化(不确定它是如何选择这部分路径的).
For example: if I tell it to publish to C:devuildOutputDebug
then the actual web files end up at C:devuildOutputDebugArchiveContentC_CcodeappSourceControllersViewsobjDebugPackagePackageTmp
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:devuildOutputDebug"/>
<property name="AutoParameterizationWebConfigConnectionStrings" value="false"/>
<property name="PackageAsSingleFile" value="false"/>
</msbuild>
关于如何让它将网络文件直接发送到特定位置的任何想法?
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: empsomelocation;AutoParameterizationWebConfigConnectionStrings=false MyProject.csproj
对应的NAnt脚本:
<msbuild project="MyProject.csproj" target="PipelinePreDeployCopyAllFilesToOneFolder">
<property name="Configuration" value="Release" />
<property name="_PackageTempDir" value="C: empsomelocation" />
<property name="AutoParameterizationWebConfigConnectionStrings" value="false" />
</msbuild>
参考文献
- 在 Visual Studio 2010 中模拟发布到文件夹"功能
- 团队构建 + Web 部署+ 网络部署 + VS 2010 = Goodness
这篇关于MSBuild 2010 - 如何将 Web 应用程序发布到特定位置 (nant)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!