MSBuild 2010-如何将Web应用发布到特定位置(自然)? [英] MSBuild 2010 - how to publish web app to a specific location (nant)?

查看:74
本文介绍了MSBuild 2010-如何将Web应用发布到特定位置(自然)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试让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>

参考文献

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