MSBuild OutputPath属性和绝对路径
我正在尝试将OutputPath值设置为绝对路径:MSBuild OutputPath属性和绝对路径,msbuild,Msbuild,我正在尝试将OutputPath值设置为绝对路径: <OutputPath>c:\Projects\xxx\Deployment</OutputPath> 有没有方法将绝对路径与OutputPath属性一起使用?我尝试过BaseOutputPath属性: <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Deployment|AnyCPU'"> <BaseOutputPath&
<OutputPath>c:\Projects\xxx\Deployment</OutputPath>
有没有方法将绝对路径与OutputPath属性一起使用?我尝试过BaseOutputPath属性:
<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>
C:\Projects\xxx\
部署
真的
真的
xxx.Web.Deployment
但它似乎被忽视了。BaseOutputPath和BaseIntermediateOutputPath的用途是什么?我不确定您是否能做到您所说的,但您可以添加类似于以下内容的内容:
<PropertyGroup>
<CentralisedBinariesFolderLocation>c:\wherever</CentralisedBinariesFolderLocation>
</PropertyGroup>
<Target Name="AfterBuild">
<Exec Command="xcopy /Y /S /F /R "$(TargetPath)" "$(CentralisedBinariesFolderLocation)"" />
</Target>
c:\where
它将在构建后将其复制到相关位置。我不确定您是否能够做到您所说的,但您可以添加类似于以下内容的内容:
<PropertyGroup>
<CentralisedBinariesFolderLocation>c:\wherever</CentralisedBinariesFolderLocation>
</PropertyGroup>
<Target Name="AfterBuild">
<Exec Command="xcopy /Y /S /F /R "$(TargetPath)" "$(CentralisedBinariesFolderLocation)"" />
</Target>
c:\where
将在生成后将其复制到相关位置。尝试使用
OutDir
而不是OutputPath
:
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Deployment|AnyCPU'">
<OutDir>C:\Projects\xxx\$(Configuration)</OutDir>
<EnableUpdateable>true</EnableUpdateable>
<UseMerge>true</UseMerge>
<SingleAssemblyName>xxx.Web.Deployment</SingleAssemblyName>
</PropertyGroup>
C:\Projects\xxx\$(配置)
真的
真的
xxx.Web.Deployment
尝试使用OutDir
而不是OutputPath
:
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Deployment|AnyCPU'">
<OutDir>C:\Projects\xxx\$(Configuration)</OutDir>
<EnableUpdateable>true</EnableUpdateable>
<UseMerge>true</UseMerge>
<SingleAssemblyName>xxx.Web.Deployment</SingleAssemblyName>
</PropertyGroup>
C:\Projects\xxx\$(配置)
真的
真的
xxx.Web.Deployment
除了10月份答案中的所有步骤之外,是否可以仅使用与
OutputPath
相同的路径定义WebPublishPipelineProjectDirectory
我在我的CI解决方案中尝试了它(使用CruiseControl
),它似乎很有效
有人知道这样做有什么副作用对我来说并不明显吗?不是10月份答案中的所有步骤,难道不能用与
OutputPath
相同的路径定义WebPublishPipelineProjectDirectory
我在我的CI解决方案中尝试了它(使用CruiseControl
),它似乎很有效
有人知道这样做有什么副作用对我来说并不明显吗?我认为这也是一种方法。但我有一个小问题,$(TargetPath)什么也不返回。是否有其他变量可用于获取部署路径?已使用:。不是很优雅,但在我的情况下有效。如果有更好的办法,请告诉我!:)我想这也是一条路。但我有一个小问题,$(TargetPath)什么也不返回。是否有其他变量可用于获取部署路径?已使用:。不是很优雅,但在我的情况下有效。如果有更好的办法,请告诉我!:)我尝试了这个,它输出到
C:\Projects\xxx\$(配置)\\u PublishedWebsites\MyApp.Website
。我尝试了这个,它输出到C:\Projects\xxx\$(配置)\\u PublishedWebsites\MyApp.Website
。