[英]MsBuild target that copies project dependencies into target dir
MsBuild目标中的哪个目标将项目依赖项(引用的项目依赖项)复制到目标目录(例如\\ bin \\ Debug)。 当然,它可能是编译目标,但我想知道最接近的目标。
MsBuild目标列表: https ://gist.github.com/StevenLiekens/cae70cce25344ba47b86
但我想知道最接近的目标。
那应该是目标_CopyFilesMarkedCopyLocal
。
https://gist.github.com/StevenLiekens/cae70cce25344ba47b86#file-target-xml-L93
您可以创建两个测试空白项目,项目A引用项目B,然后将MSBuild项目的生成输出详细程度更改为“ 详细”或“ 诊断” (“ Tools
->“ Options
->“ Projects and Solutions
- >Build and Run
->“ MSBuild project build output verbosity
>Build and Run
MSBuild project build output verbosity
,生成项目A,在输出窗口的生成日志中,您将找到有关项目A的以下消息:
2>Target "_CopyFilesMarkedCopyLocal" in file "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets" from project "c:\users\xxx\source\repos\ClassLibrary2\ProjectA\ProjectA.csproj" (target "CopyFilesToOutputDirectory" depends on it):
2>Task "Copy"
2> Copying file from "c:\users\xxx\source\repos\xxxx\ProjectB\bin\Debug\ProjectB.dll" to "bin\Debug\ProjectB.dll".
2> Copying file from "c:\users\xxx\source\repos\xxxx\ProjectB\bin\Debug\ProjectB.pdb" to "bin\Debug\ProjectB.pdb".
2>Done executing task "Copy".
2>Using "Touch" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
2>Task "Touch"
2> Creating "c:\users\xxx\source\repos\ClassLibrary2\ProjectA\obj\Debug\ProjectA.csproj.CopyComplete" because "AlwaysCreate" was specified.
2>Done executing task "Touch".
2>Done building target "_CopyFilesMarkedCopyLocal" in project "ProjectA.csproj".
就像我们知道的那样,如果我们引用一个项目, Copy Local
引用项目的“ Copy Local
”属性将设置为True,在我们构建该项目时,该引用将被复制到目标目录。
希望这可以帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.