问题描述
如果构建成功,我希望将输出目录的内容复制到同一 "base" 文件夹下的不同位置.此父文件夹是一个相对部分,可能因源代码管理设置而异.
On a successful build, I wish to copy the contents of the output directory to a different location under the same "base" folder. This parent folder is a relative part and can vary based on Source Control settings.
我列出了一些可用的宏值......
I have listed a few of the Macro values available to me ...
$(SolutionDir) = D:GlobalDirVersionAppNameSolution1uild
$(SolutionDir) = D:GlobalDirVersionAppNameSolution1uild
$(ProjectDir) = D:GlobalDirVersionAppNameSolution1VersionProjectA
$(ProjectDir) = D:GlobalDirVersionAppNameSolution1VersionProjectA
我想将输出目录内容复制到以下文件夹:
I want to copy the Output Dir contents to the following folder :
D:GlobalDirVersionAppNameSolution2ProjectDependency
D:GlobalDirVersionAppNameSolution2ProjectDependency
需要从上述宏之一中获取基本位置D:GlobalDirVersionAppName".但是,没有任何宏值仅列出父位置.
The base location "D:GlobalDirVersionAppName" needs to be fetched from one of the above macros. However, none of the macro values list only the parent location.
我如何仅提取构建后复制命令的基本位置?
How do I extract only the base location for the post build copy command ?
推荐答案
如果 TargetDir 或其他宏都没有指向正确的位置,请使用.."目录向后移动文件夹层次结构.
If none of the TargetDir or other macros point to the right place, use the ".." directory to go backwards up the folder hierarchy.
即.使用 $(SolutionDir)....
获取您的基本目录.
ie. Use $(SolutionDir)....
to get your base directory.
有关所有宏的列表,请参见此处:
For list of all macros, see here:
http://msdn.microsoft.com/en-us/library/c02as0cs.aspx
这篇关于Visual Studio 生成后事件 - 复制到相对目录位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!