gpt4 book ai didi

MSBuild OutputPath 属性和绝对路径

转载 作者:行者123 更新时间:2023-12-04 07:45:33 30 4
gpt4 key购买 nike

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

<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 属性:
<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 有什么用?

最佳答案

我不确定您是否可以执行您所说的操作,但是您可以添加类似于以下内容的内容:

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

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

这将在构建后将其复制到相关位置。

关于MSBuild OutputPath 属性和绝对路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2989394/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com