|
6 | 6 | <NuGetUsingMSBuildCopyOutputFileToFastDebugTaskFolder Condition=" '$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tools\net48\</NuGetUsingMSBuildCopyOutputFileToFastDebugTaskFolder> |
7 | 7 | </PropertyGroup> |
8 | 8 |
|
| 9 | + <!--默认只有在 Debug 下开启--> |
| 10 | + <PropertyGroup Condition="$(EnableUsingMSBuildCopyOutputFileToFastDebug)==''"> |
| 11 | + <EnableUsingMSBuildCopyOutputFileToFastDebug Condition="'$(Configuration)' == 'Debug'">true</EnableUsingMSBuildCopyOutputFileToFastDebug> |
| 12 | + <EnableUsingMSBuildCopyOutputFileToFastDebug Condition="'$(Configuration)' != 'Debug'">false</EnableUsingMSBuildCopyOutputFileToFastDebug> |
| 13 | + </PropertyGroup> |
| 14 | + |
9 | 15 | <UsingTask TaskName="UsingMSBuildCopyOutputFileToFastDebug.SafeOutputFileCopyTask" |
10 | 16 | AssemblyFile="$(NuGetUsingMSBuildCopyOutputFileToFastDebugTaskFolder)\UsingMSBuildCopyOutputFileToFastDebug.dll" /> |
11 | 17 | <UsingTask TaskName="UsingMSBuildCopyOutputFileToFastDebug.LaunchSettingsParser" |
12 | 18 | AssemblyFile="$(NuGetUsingMSBuildCopyOutputFileToFastDebugTaskFolder)\UsingMSBuildCopyOutputFileToFastDebug.dll" /> |
13 | 19 |
|
14 | 20 | <Target Name="ParseLaunchSettings" AfterTargets="AfterBuild" |
15 | | - BeforeTargets="CopyOutputLibToFastDebug" Condition="$(MainProjectPath)==''"> |
| 21 | + BeforeTargets="CopyOutputLibToFastDebug" Condition="$(MainProjectPath)=='' and $(EnableUsingMSBuildCopyOutputFileToFastDebug)==true"> |
16 | 22 | <Message Text="当前使用的复制方法 $(NuGetUsingMSBuildCopyOutputFileToFastDebugTaskFolder)" /> |
17 | 23 | <LaunchSettingsParser> |
18 | 24 | <Output TaskParameter="LaunchMainProjectPath" PropertyName="LaunchMainProjectPath" ></Output> |
19 | 25 | </LaunchSettingsParser> |
20 | 26 | </Target> |
21 | 27 |
|
| 28 | + <Target Name="BanCopyOutputLibToFastDebug" AfterTargets="AfterBuild" |
| 29 | + Condition="$(EnableUsingMSBuildCopyOutputFileToFastDebug)!=true"> |
| 30 | + <Message Text="禁用 UsingMSBuildCopyOutputFileToFastDebug 因为 EnableUsingMSBuildCopyOutputFileToFastDebug 不为 true 值"/> |
| 31 | + </Target> |
22 | 32 |
|
23 | 33 | <Target Name="CopyOutputLibToFastDebug" AfterTargets="AfterBuild" |
24 | | - Condition="$(MainProjectPath)!='' or $(LaunchMainProjectPath)!=''"> |
| 34 | + Condition="($(MainProjectPath)!='' or $(LaunchMainProjectPath)!='') and $(EnableUsingMSBuildCopyOutputFileToFastDebug)==true"> |
25 | 35 | <Message Text="当前使用的复制方法 $(NuGetUsingMSBuildCopyOutputFileToFastDebugTaskFolder)" /> |
26 | 36 | <ItemGroup> |
27 | 37 | <OutputFileToCopy Include="$(OutputPath)$(AssemblyName).dll"></OutputFileToCopy> |
|
0 commit comments