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

查看:11
本文介绍了MSBuild 2010 - 如何将 Web 应用程序发布到特定位置 (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>

参考文献

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