@@ -1110,74 +1110,6 @@ Copyright (c) .NET Foundation. All rights reserved.
1110
1110
</ItemGroup >
1111
1111
</Target >
1112
1112
1113
- <!--
1114
- ============================================================
1115
- Run Information
1116
- The ProcessStart information that can be used to run this project.
1117
- ============================================================
1118
- -->
1119
-
1120
- <!-- TODO: can we now move all of this into the ComputeRunArguments target, or must this be kept for compat? -->
1121
- <PropertyGroup >
1122
- <RunWorkingDirectory Condition =" '$(RunWorkingDirectory)' == ''" >$(StartWorkingDirectory)</RunWorkingDirectory >
1123
- </PropertyGroup >
1124
-
1125
- <Choose >
1126
- <When Condition =" '$(StartAction)' == 'Program'" >
1127
- <PropertyGroup >
1128
- <RunCommand Condition =" '$(RunCommand)' == ''" >$(StartProgram)</RunCommand >
1129
- <RunArguments Condition =" '$(RunArguments)' == ''" >$(StartArguments)</RunArguments >
1130
- </PropertyGroup >
1131
- </When >
1132
-
1133
- <When Condition =" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(_IsExecutable)' == 'true'" >
1134
- <PropertyGroup Condition =" '$(UseAppHost)' != 'true'" >
1135
- <!-- TODO: https://github.com/dotnet/sdk/issues/20 Need to get the DotNetHost path from MSBuild -->
1136
- <RunCommand Condition =" '$(RunCommand)' == ''" >dotnet</RunCommand >
1137
-
1138
- <_NetCoreRunArguments >exec " $(TargetPath)" </_NetCoreRunArguments >
1139
- <RunArguments Condition =" '$(RunArguments)' == '' and '$(StartArguments)' != ''" >$(_NetCoreRunArguments) $(StartArguments)</RunArguments >
1140
- <RunArguments Condition =" '$(RunArguments)' == ''" >$(_NetCoreRunArguments)</RunArguments >
1141
- </PropertyGroup >
1142
-
1143
- <PropertyGroup Condition =" '$(UseAppHost)' == 'true'" >
1144
- <RunCommand Condition =" '$(RunCommand)' == ''" >$(TargetDir)$(AssemblyName)$(_NativeExecutableExtension)</RunCommand >
1145
- <RunArguments Condition =" '$(RunArguments)' == ''" >$(StartArguments)</RunArguments >
1146
- </PropertyGroup >
1147
- </When >
1148
-
1149
- <When Condition =" '$(TargetFrameworkIdentifier)' == '.NETFramework' and '$(_IsExecutable)' == 'true'" >
1150
- <PropertyGroup Condition =" $([MSBuild]::IsOSPlatform(`Windows`))" >
1151
- <RunCommand Condition =" '$(RunCommand)' == ''" >$(TargetPath)</RunCommand >
1152
- <RunArguments Condition =" '$(RunArguments)' == ''" >$(StartArguments)</RunArguments >
1153
- </PropertyGroup >
1154
- <PropertyGroup Condition =" $([MSBuild]::IsOSUnixLike())" >
1155
- <RunCommand Condition =" '$(RunCommand)' == ''" >mono</RunCommand >
1156
- <RunArguments Condition =" '$(RunArguments)' == ''" >" $(TargetPath)" $(StartArguments)</RunArguments >
1157
- </PropertyGroup >
1158
- </When >
1159
- </Choose >
1160
-
1161
- <PropertyGroup >
1162
- <!-- Ensure $(RunWorkingDirectory) is a full path -->
1163
- <RunWorkingDirectory Condition =" '$(RunWorkingDirectory)' != '' and '$([System.IO.Path]::IsPathRooted($(RunWorkingDirectory)))' != 'true'" >$([System.IO.Path]::GetFullPath($([System.IO.Path]::Combine('$(MSBuildProjectDirectory)', '$(RunWorkingDirectory)'))))</RunWorkingDirectory >
1164
- </PropertyGroup >
1165
-
1166
- <ItemGroup >
1167
- <!-- Signals that this project supports the target-based run invocation protocol powered by the ComputeRunArguments target. -->
1168
- <ProjectCapability Include =" SupportsComputeRunCommand" />
1169
- </ItemGroup >
1170
- <!-- Placeholder target for tools to override RunCommand/RunArguments/RunWorkingDirectory.
1171
- This allows tools to run validation or logic required to compute any required data,
1172
- which cannot be done during evaluation. -->
1173
- <Target Name =" ComputeRunArguments" />
1174
-
1175
-
1176
- <!-- Override MSBuild Run Target -->
1177
- <Target Name =" Run" DependsOnTargets =" ComputeRunArguments" >
1178
- <Exec Command =" $(RunCommand) $(RunArguments)" WorkingDirectory =" $(RunWorkingDirectory)" />
1179
- </Target >
1180
-
1181
1113
<!--
1182
1114
============================================================
1183
1115
CoreGenerateSatelliteAssemblies
@@ -1443,6 +1375,78 @@ Copyright (c) .NET Foundation. All rights reserved.
1443
1375
<Import Project =" $(ILLinkTargetsPath)" Condition =" '$(ILLinkTargetsPath)' != '' and '$(Language)' != 'C++'" />
1444
1376
<Import Project =" $(MSBuildThisFileDirectory)Microsoft.NET.Sdk.Analyzers.targets" Condition =" '$(Language)' == 'C#' or '$(Language)' == 'VB'" />
1445
1377
1378
+ <!--
1379
+ ============================================================
1380
+ Run Information
1381
+ The ProcessStart information that can be used to run this project.
1382
+ ============================================================
1383
+ -->
1384
+
1385
+ <!-- TODO: can we now move all of this into the ComputeRunArguments target, or must this be kept for compat? -->
1386
+ <!-- NOTE: the targets above may change UseAppHost and other relevant properties, and so all of this pre-computation needs to come after it.
1387
+ I checked this when I moved it and none of those targets _used_ the Run* properties.
1388
+ This is yet another case where precomputing data during evaluation _is bad_ and should be moved to a Target. -->
1389
+
1390
+ <PropertyGroup >
1391
+ <RunWorkingDirectory Condition =" '$(RunWorkingDirectory)' == ''" >$(StartWorkingDirectory)</RunWorkingDirectory >
1392
+ </PropertyGroup >
1393
+
1394
+ <Choose >
1395
+ <When Condition =" '$(StartAction)' == 'Program'" >
1396
+ <PropertyGroup >
1397
+ <RunCommand Condition =" '$(RunCommand)' == ''" >$(StartProgram)</RunCommand >
1398
+ <RunArguments Condition =" '$(RunArguments)' == ''" >$(StartArguments)</RunArguments >
1399
+ </PropertyGroup >
1400
+ </When >
1401
+
1402
+ <When Condition =" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(_IsExecutable)' == 'true'" >
1403
+ <PropertyGroup Condition =" '$(UseAppHost)' != 'true'" >
1404
+ <!-- TODO: https://github.com/dotnet/sdk/issues/20 Need to get the DotNetHost path from MSBuild -->
1405
+ <RunCommand Condition =" '$(RunCommand)' == ''" >dotnet</RunCommand >
1406
+
1407
+ <_NetCoreRunArguments >exec " $(TargetPath)" </_NetCoreRunArguments >
1408
+ <RunArguments Condition =" '$(RunArguments)' == '' and '$(StartArguments)' != ''" >$(_NetCoreRunArguments) $(StartArguments)</RunArguments >
1409
+ <RunArguments Condition =" '$(RunArguments)' == ''" >$(_NetCoreRunArguments)</RunArguments >
1410
+ </PropertyGroup >
1411
+
1412
+ <PropertyGroup Condition =" '$(UseAppHost)' == 'true'" >
1413
+ <RunCommand Condition =" '$(RunCommand)' == ''" >$(TargetDir)$(AssemblyName)$(_NativeExecutableExtension)</RunCommand >
1414
+ <RunArguments Condition =" '$(RunArguments)' == ''" >$(StartArguments)</RunArguments >
1415
+ </PropertyGroup >
1416
+ </When >
1417
+
1418
+ <When Condition =" '$(TargetFrameworkIdentifier)' == '.NETFramework' and '$(_IsExecutable)' == 'true'" >
1419
+ <PropertyGroup Condition =" $([MSBuild]::IsOSPlatform(`Windows`))" >
1420
+ <RunCommand Condition =" '$(RunCommand)' == ''" >$(TargetPath)</RunCommand >
1421
+ <RunArguments Condition =" '$(RunArguments)' == ''" >$(StartArguments)</RunArguments >
1422
+ </PropertyGroup >
1423
+ <PropertyGroup Condition =" $([MSBuild]::IsOSUnixLike())" >
1424
+ <RunCommand Condition =" '$(RunCommand)' == ''" >mono</RunCommand >
1425
+ <RunArguments Condition =" '$(RunArguments)' == ''" >" $(TargetPath)" $(StartArguments)</RunArguments >
1426
+ </PropertyGroup >
1427
+ </When >
1428
+ </Choose >
1429
+
1430
+ <PropertyGroup >
1431
+ <!-- Ensure $(RunWorkingDirectory) is a full path -->
1432
+ <RunWorkingDirectory Condition =" '$(RunWorkingDirectory)' != '' and '$([System.IO.Path]::IsPathRooted($(RunWorkingDirectory)))' != 'true'" >$([System.IO.Path]::GetFullPath($([System.IO.Path]::Combine('$(MSBuildProjectDirectory)', '$(RunWorkingDirectory)'))))</RunWorkingDirectory >
1433
+ </PropertyGroup >
1434
+
1435
+ <ItemGroup >
1436
+ <!-- Signals that this project supports the target-based run invocation protocol powered by the ComputeRunArguments target. -->
1437
+ <ProjectCapability Include =" SupportsComputeRunCommand" />
1438
+ </ItemGroup >
1439
+ <!-- Placeholder target for tools to override RunCommand/RunArguments/RunWorkingDirectory.
1440
+ This allows tools to run validation or logic required to compute any required data,
1441
+ which cannot be done during evaluation. -->
1442
+ <Target Name =" ComputeRunArguments" />
1443
+
1444
+
1445
+ <!-- Override MSBuild Run Target -->
1446
+ <Target Name =" Run" DependsOnTargets =" ComputeRunArguments" >
1447
+ <Exec Command =" $(RunCommand) $(RunArguments)" WorkingDirectory =" $(RunWorkingDirectory)" />
1448
+ </Target >
1449
+
1446
1450
<!-- Import WindowsDesktop targets if necessary -->
1447
1451
<PropertyGroup Condition =" '$(ImportWindowsDesktopTargets)' == ''
1448
1452
and ('$(UseWpf)' == 'true' Or '$(UseWindowsForms)' == 'true') " >
0 commit comments