MSBuild OutputPath属性和绝对路径 [英] MSBuild OutputPath property and absolute paths

查看:119
本文介绍了MSBuild OutputPath属性和绝对路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将OutputPath值设置为绝对路径:

I'm trying to set the OutputPath value to an absolute path:

<OutputPath>c:\Projects\xxx\Deployment</OutputPath>

但是我得到这个错误:

Error   17  The expression "[System.IO.Path]::GetFullPath(D:\Projects\xxx\trunk\xxx.Web.Deployment\c:\Projects\xxx\Deployment\)" cannot be evaluated. The given path's format is not supported.     1   1   xxx.Web.Deployment

是否可以通过OutputPath属性使用绝对路径?我已经尝试过使用BaseOutputPath属性进行实验:

Is there a way to use an absolute path with the OutputPath property? I've tried experimenting with the BaseOutputPath property:

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Deployment|AnyCPU'">
  <BaseOutputPath>C:\Projects\xxx\</BaseOutputPath>
  <OutputPath>.\Deployment</OutputPath>
  <EnableUpdateable>true</EnableUpdateable>
  <UseMerge>true</UseMerge>
  <SingleAssemblyName>xxx.Web.Deployment</SingleAssemblyName>

但是它似乎被忽略了.什么是BaseOutputPath和BaseIntermediateOutputPath?

But it seems to get ignored. What are BaseOutputPath and BaseIntermediateOutputPath used for?

推荐答案

我不确定您是否可以执行您正在说的事情,但是您可以添加类似于以下内容的内容:

I'm not sure whether you can do what you're talking about, but you can add something similar to the following:

<PropertyGroup>  
    <CentralisedBinariesFolderLocation>c:\wherever</CentralisedBinariesFolderLocation>
</PropertyGroup>  

<Target Name="AfterBuild">
    <Exec Command="xcopy /Y /S /F /R &quot;$(TargetPath)&quot; &quot;$(CentralisedBinariesFolderLocation)&quot;" />
</Target>

在构建后会将其复制到相关位置.

Which will copy it to the relevant location after the build.

这篇关于MSBuild OutputPath属性和绝对路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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