1+ <Project >
2+ <PropertyGroup >
3+ <NuGetUsingMSBuildCopyOutputFileToFastDebugTaskFolder >$(MSBuildThisFileDirectory)..\tools\</NuGetUsingMSBuildCopyOutputFileToFastDebugTaskFolder >
4+ <UsingMSBuildCopyOutputFileToFastDebugTaskFile >"$(NuGetUsingMSBuildCopyOutputFileToFastDebugTaskFolder)UsingMSBuildCopyOutputFileToFastDebug.dll"</UsingMSBuildCopyOutputFileToFastDebugTaskFile >
5+ </PropertyGroup >
6+
7+ <!-- 默认只有在 Debug 下开启-->
8+ <PropertyGroup Condition =" $(EnableUsingMSBuildCopyOutputFileToFastDebug)==''" >
9+ <EnableUsingMSBuildCopyOutputFileToFastDebug Condition =" '$(Configuration)' == 'Debug'" >true</EnableUsingMSBuildCopyOutputFileToFastDebug >
10+ <EnableUsingMSBuildCopyOutputFileToFastDebug Condition =" '$(Configuration)' != 'Debug'" >false</EnableUsingMSBuildCopyOutputFileToFastDebug >
11+ </PropertyGroup >
12+
13+ <!-- 清理文件 -->
14+ <PropertyGroup >
15+ <CleanUsingMSBuildCopyOutputFileToFastDebugFile >"$(IntermediateOutputPath)CleanUsingMSBuildCopyOutputFileToFastDebugFile.txt"</CleanUsingMSBuildCopyOutputFileToFastDebugFile >
16+ </PropertyGroup >
17+
18+ <!-- <UsingTask TaskName="UsingMSBuildCopyOutputFileToFastDebug.SafeOutputFileCopyTask" -->
19+ <!-- AssemblyFile="$(NuGetUsingMSBuildCopyOutputFileToFastDebugTaskFolder)\UsingMSBuildCopyOutputFileToFastDebug.dll" /> -->
20+ <!-- <UsingTask TaskName="UsingMSBuildCopyOutputFileToFastDebug.LaunchSettingsParser" -->
21+ <!-- AssemblyFile="$(NuGetUsingMSBuildCopyOutputFileToFastDebugTaskFolder)\UsingMSBuildCopyOutputFileToFastDebug.dll" /> -->
22+
23+
24+
25+ <Target Name =" CopyOutputLibToFastDebug" AfterTargets =" AfterBuild" Condition =" $(EnableUsingMSBuildCopyOutputFileToFastDebug)==true" >
26+
27+ <ItemGroup >
28+ <OutputFileToCopy Include =" $(OutputPath)$(AssemblyName).dll" ></OutputFileToCopy >
29+ <!-- 没有pdb文件拷贝过去,将会在调试提示没有符号,因此需要加上符号 -->
30+ <OutputFileToCopy Include =" $(OutputPath)$(AssemblyName).pdb" ></OutputFileToCopy >
31+ </ItemGroup >
32+
33+ <PropertyGroup >
34+ <OutputFileToCopyList >"@(OutputFileToCopy)"</OutputFileToCopyList >
35+ </PropertyGroup >
36+
37+ <Exec Command =" dotnet $(UsingMSBuildCopyOutputFileToFastDebugTaskFile) -- CopyOutputFile -MainProjectPath $(MainProjectPath) -CleanFilePath $(CleanUsingMSBuildCopyOutputFileToFastDebugFile) -OutputFileToCopyList $(OutputFileToCopyList)" />
38+ </Target >
39+
40+ <!-- <Target Name="ParseLaunchSettings" AfterTargets="AfterBuild"
41+ BeforeTargets="CopyOutputLibToFastDebug" Condition="$(MainProjectPath)=='' and $(EnableUsingMSBuildCopyOutputFileToFastDebug)==true">
42+ <Message Text="当前使用的复制方法 $(NuGetUsingMSBuildCopyOutputFileToFastDebugTaskFolder)" />
43+ <LaunchSettingsParser>
44+ <Output TaskParameter="LaunchMainProjectPath" PropertyName="LaunchMainProjectPath" ></Output>
45+ </LaunchSettingsParser>
46+ </Target>-->
47+
48+ <Target Name =" BanCopyOutputLibToFastDebug" AfterTargets =" AfterBuild"
49+ Condition =" $(EnableUsingMSBuildCopyOutputFileToFastDebug)!=true" >
50+ <Message Text =" 禁用 UsingMSBuildCopyOutputFileToFastDebug 因为 EnableUsingMSBuildCopyOutputFileToFastDebug 不为 true 值" />
51+ </Target >
52+
53+ <!-- <Target Name="CopyOutputLibToFastDebug" AfterTargets="AfterBuild"
54+ Condition="($(MainProjectPath)!='' or $(LaunchMainProjectPath)!='') and $(EnableUsingMSBuildCopyOutputFileToFastDebug)==true">
55+ <Message Text="当前使用的复制方法 $(NuGetUsingMSBuildCopyOutputFileToFastDebugTaskFolder)" />
56+ <ItemGroup>
57+ <OutputFileToCopy Include="$(OutputPath)$(AssemblyName).dll"></OutputFileToCopy>
58+ <OutputFileToCopy Include="$(OutputPath)$(AssemblyName).pdb"></OutputFileToCopy>
59+ </ItemGroup>
60+ <SafeOutputFileCopyTask SourceFiles="@(OutputFileToCopy)"
61+ DestinationFolder="$(MainProjectPath)"
62+ CleanFile="$(CleanUsingMSBuildCopyOutputFileToFastDebugFile)"
63+ Condition="$(MainProjectPath)!=''"></SafeOutputFileCopyTask>
64+
65+ <SafeOutputFileCopyTask SourceFiles="@(OutputFileToCopy)"
66+ DestinationFolder="$(LaunchMainProjectPath)"
67+ CleanFile="$(CleanUsingMSBuildCopyOutputFileToFastDebugFile)"
68+ Condition="$(LaunchMainProjectPath)!='' and $(MainProjectPath)==''"></SafeOutputFileCopyTask>
69+ </Target>-->
70+
71+ <Target Name =" UsingMSBuildCopyOutputFileToFastDebugClean" AfterTargets =" Clean" >
72+ <Exec Command =" dotnet $(UsingMSBuildCopyOutputFileToFastDebugTaskFile) -- Clean -CleanFilePath $(CleanUsingMSBuildCopyOutputFileToFastDebugFile) " />
73+ <!-- <ReadLinesFromFile
74+ File="$(CleanUsingMSBuildCopyOutputFileToFastDebugFile)" >
75+ <Output
76+ TaskParameter="Lines"
77+ ItemName="UsingMSBuildCopyOutputFileToFastDebugCleanFile"/>
78+ </ReadLinesFromFile>
79+
80+ <Delete Files="@(UsingMSBuildCopyOutputFileToFastDebugCleanFile)" >
81+ <Output TaskParameter="DeletedFiles" ItemName="UsingMSBuildCopyOutputFileToFastDebugCleanFileDeletedList"/>
82+ </Delete>
83+
84+ <Message Text="Deleted files: '@(UsingMSBuildCopyOutputFileToFastDebugCleanFileDeletedList)'"/>-->
85+ </Target >
86+ </Project >
0 commit comments