-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathMicrosoft.NET.Sdk.targets
580 lines (477 loc) · 29.4 KB
/
Microsoft.NET.Sdk.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
<!--
***********************************************************************************************
Microsoft.NET.Sdk.targets
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
Copyright (c) .NET Foundation. All rights reserved.
***********************************************************************************************
-->
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<!-- Workaround: https://github.com/Microsoft/msbuild/issues/1293 -->
<PropertyGroup Condition="'$(MSBuildRuntimeType)' == 'Core' Or '$(TargetFrameworkIdentifier)' != '.NETFramework'">
<GenerateResourceMSBuildArchitecture Condition=" '$(GenerateResourceMSBuildArchitecture)' == '' ">CurrentArchitecture</GenerateResourceMSBuildArchitecture>
<GenerateResourceMSBuildRuntime Condition=" '$(GenerateResourceMSBuildRuntime)' == '' ">CurrentRuntime</GenerateResourceMSBuildRuntime>
</PropertyGroup>
<Import Project="Microsoft.NET.Sdk.Common.targets" />
<ImportGroup>
<Import Project="$(MSBuildThisFileDirectory)Microsoft.PackageDependencyResolution.targets" Condition="Exists('$(MSBuildThisFileDirectory)Microsoft.PackageDependencyResolution.targets')" />
</ImportGroup>
<Import Project="Microsoft.NET.Sdk.DefaultItems.targets" />
<UsingTask TaskName="GenerateDepsFile" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" />
<UsingTask TaskName="GenerateRuntimeConfigurationFiles" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" />
<UsingTask TaskName="GetAssemblyVersion" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" />
<UsingTask TaskName="GenerateSatelliteAssemblies" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" />
<PropertyGroup>
<DisableStandardFrameworkResolution Condition="'$(DisableStandardFrameworkResolution)' == ''">$(_IsNETCoreOrNETStandard)</DisableStandardFrameworkResolution>
</PropertyGroup>
<PropertyGroup>
<GenerateRuntimeConfigurationFiles Condition=" '$(GenerateRuntimeConfigurationFiles)' == '' and '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(HasRuntimeOutput)' == 'true' ">true</GenerateRuntimeConfigurationFiles>
<UserRuntimeConfig Condition=" '$(UserRuntimeConfig)' == '' ">$(MSBuildProjectDirectory)/runtimeconfig.template.json</UserRuntimeConfig>
<GenerateSatelliteAssembliesForCore Condition=" '$(GenerateSatelliteAssembliesForCore)' == '' and '$(MSBuildRuntimeType)' == 'Core' ">true</GenerateSatelliteAssembliesForCore>
<ComputeNETCoreBuildOutputFiles Condition=" '$(ComputeNETCoreBuildOutputFiles)' == '' and '$(TargetFrameworkIdentifier)' == '.NETCoreApp'">true</ComputeNETCoreBuildOutputFiles>
</PropertyGroup>
<ItemGroup>
<GenerateRuntimeConfigurationFilesInputs Include="$(ProjectAssetsFile)" />
<GenerateRuntimeConfigurationFilesInputs Include="$(UserRuntimeConfig)" Condition=" Exists($(UserRuntimeConfig)) " />
</ItemGroup>
<PropertyGroup>
<ProjectDepsFileName Condition="'$(ProjectDepsFileName)' == ''">$(AssemblyName).deps.json</ProjectDepsFileName>
<ProjectDepsFilePath Condition="'$(ProjectDepsFilePath)' == ''">$(TargetDir)$(ProjectDepsFileName)</ProjectDepsFilePath>
<ProjectRuntimeConfigFileName Condition="'$(ProjectRuntimeConfigFileName)' == ''">$(AssemblyName).runtimeconfig.json</ProjectRuntimeConfigFileName>
<ProjectRuntimeConfigFilePath Condition="'$(ProjectRuntimeConfigFilePath)' == ''">$(TargetDir)$(ProjectRuntimeConfigFileName)</ProjectRuntimeConfigFilePath>
<ProjectRuntimeConfigDevFilePath Condition="'$(ProjectRuntimeConfigDevFilePath)' == ''">$(TargetDir)$(AssemblyName).runtimeconfig.dev.json</ProjectRuntimeConfigDevFilePath>
<IncludeMainProjectInDepsFile Condition=" '$(IncludeMainProjectInDepsFile)' == '' ">true</IncludeMainProjectInDepsFile>
</PropertyGroup>
<PropertyGroup>
<_NativeLibraryPrefix Condition="'$(_NativeLibraryPrefix)' == '' and !$(RuntimeIdentifier.StartsWith('win'))">lib</_NativeLibraryPrefix>
<_NativeLibraryExtension Condition="'$(_NativeLibraryExtension)' == '' and $(RuntimeIdentifier.StartsWith('win'))">.dll</_NativeLibraryExtension>
<_NativeLibraryExtension Condition="'$(_NativeLibraryExtension)' == '' and $(RuntimeIdentifier.StartsWith('osx'))">.dylib</_NativeLibraryExtension>
<_NativeLibraryExtension Condition="'$(_NativeLibraryExtension)' == ''">.so</_NativeLibraryExtension>
<_NativeExecutableExtension Condition="'$(_NativeExecutableExtension)' == '' and $(RuntimeIdentifier.StartsWith('win'))">.exe</_NativeExecutableExtension>
<_DotNetHostExecutableName>dotnet$(_NativeExecutableExtension)</_DotNetHostExecutableName>
<_DotNetAppHostExecutableName>apphost$(_NativeExecutableExtension)</_DotNetAppHostExecutableName>
<_DotNetHostPolicyLibraryName>$(_NativeLibraryPrefix)hostpolicy$(_NativeLibraryExtension)</_DotNetHostPolicyLibraryName>
<_DotNetHostFxrLibraryName>$(_NativeLibraryPrefix)hostfxr$(_NativeLibraryExtension)</_DotNetHostFxrLibraryName>
</PropertyGroup>
<PropertyGroup>
<_DefaultUserProfileRuntimeStorePath>$(HOME)</_DefaultUserProfileRuntimeStorePath>
<_DefaultUserProfileRuntimeStorePath Condition="'$(OS)' == 'Windows_NT'">$(USERPROFILE)</_DefaultUserProfileRuntimeStorePath>
<_DefaultUserProfileRuntimeStorePath>$([System.IO.Path]::Combine($(_DefaultUserProfileRuntimeStorePath), '.dotnet', 'store'))</_DefaultUserProfileRuntimeStorePath>
<UserProfileRuntimeStorePath Condition="'$(UserProfileRuntimeStorePath)' == ''">$(_DefaultUserProfileRuntimeStorePath)</UserProfileRuntimeStorePath>
</PropertyGroup>
<PropertyGroup>
<CoreBuildDependsOn>
$(CoreBuildDependsOn);
GenerateBuildDependencyFile;
GenerateBuildRuntimeConfigurationFiles
</CoreBuildDependsOn>
</PropertyGroup>
<PropertyGroup>
<CoreCleanDependsOn>
_SdkBeforeClean
$(CoreCleanDependsOn)
</CoreCleanDependsOn>
</PropertyGroup>
<PropertyGroup>
<RebuildDependsOn>
_SdkBeforeRebuild;
$(RebuildDependsOn)
</RebuildDependsOn>
</PropertyGroup>
<!--
============================================================
GenerateBuildDependencyFile
Generates the $(project).deps.json file during Build
============================================================
-->
<Target Name="GenerateBuildDependencyFile"
DependsOnTargets="_DefaultMicrosoftNETPlatformLibrary;
_HandlePackageFileConflicts;
_ComputeReferenceAssemblies"
BeforeTargets="CopyFilesToOutputDirectory"
Condition=" '$(GenerateDependencyFile)' == 'true'"
Inputs="$(ProjectAssetsFile);$(MSBuildAllProjects)"
Outputs="$(ProjectDepsFilePath)">
<!--
Explicitly not passing any ExcludeFromPublishPackageReferences information during 'Build', since these dependencies
should be included during 'Build'. They are only excluded on 'Publish'.
-->
<GenerateDepsFile ProjectPath="$(MSBuildProjectFullPath)"
AssetsFilePath="$(ProjectAssetsFile)"
DepsFilePath="$(ProjectDepsFilePath)"
TargetFramework="$(TargetFrameworkMoniker)"
AssemblyName="$(AssemblyName)"
AssemblyExtension="$(TargetExt)"
AssemblyVersion="$(Version)"
AssemblySatelliteAssemblies="@(IntermediateSatelliteAssembliesWithTargetPath)"
ReferencePaths="@(ReferencePath)"
ReferenceDependencyPaths="@(ReferenceDependencyPaths)"
ReferenceSatellitePaths="@(ReferenceSatellitePaths)"
ReferenceAssemblies="@(_ReferenceAssemblies)"
IncludeMainProject="$(IncludeMainProjectInDepsFile)"
RuntimeIdentifier="$(RuntimeIdentifier)"
PlatformLibraryName="$(MicrosoftNETPlatformLibrary)"
FilesToSkip="@(_ConflictPackageFiles)"
CompilerOptions="@(DependencyFileCompilerOptions)"
IsSelfContained="$(SelfContained)"
IncludeRuntimeFileVersions="$(IncludeFileVersionsInDependencyFile)">
</GenerateDepsFile>
<ItemGroup>
<!-- Do this in an ItemGroup instead of as an output parameter of the GenerateDepsFile task so that it still gets added to the item set
during incremental builds when the task is skipped -->
<FileWrites Include="$(ProjectDepsFilePath)" Condition="Exists('$(ProjectDepsFilePath)')"/>
</ItemGroup>
</Target>
<!--
============================================================
GenerateBuildRuntimeConfigurationFiles
Generates the $(project).runtimeconfig.json and $(project).runtimeconfig.dev.json files during Build
============================================================
-->
<Target Name="GenerateBuildRuntimeConfigurationFiles"
DependsOnTargets="_DefaultMicrosoftNETPlatformLibrary"
BeforeTargets="CopyFilesToOutputDirectory"
Condition=" '$(GenerateRuntimeConfigurationFiles)' == 'true'"
Inputs="@(GenerateRuntimeConfigurationFilesInputs)"
Outputs="$(ProjectRuntimeConfigFilePath);$(ProjectRuntimeConfigDevFilePath)">
<GenerateRuntimeConfigurationFiles AssetsFilePath="$(ProjectAssetsFile)"
TargetFrameworkMoniker="$(TargetFrameworkMoniker)"
TargetFramework="$(TargetFramework)"
RuntimeConfigPath="$(ProjectRuntimeConfigFilePath)"
RuntimeConfigDevPath="$(ProjectRuntimeConfigDevFilePath)"
RuntimeIdentifier="$(RuntimeIdentifier)"
PlatformLibraryName="$(MicrosoftNETPlatformLibrary)"
UserRuntimeConfig="$(UserRuntimeConfig)"
HostConfigurationOptions="@(RuntimeHostConfigurationOption)"
AdditionalProbingPaths="@(AdditionalProbingPath)"
IsSelfContained="$(SelfContained)">
</GenerateRuntimeConfigurationFiles>
<ItemGroup>
<!-- Do this in an ItemGroup instead of as an output parameter of the GenerateDepsFile task so that it still gets added to the item set
during incremental builds when the task is skipped -->
<FileWrites Include="$(ProjectRuntimeConfigFilePath)" Condition="Exists('$(ProjectRuntimeConfigFilePath)')"/>
<FileWrites Include="$(ProjectRuntimeConfigDevFilePath)" Condition="Exists('$(ProjectRuntimeConfigDevFilePath)')"/>
</ItemGroup>
</Target>
<!-- Add runtimeconfig.json file to BuiltProjectOutputGroupOutput, so that it will get included in the NuGet package by the Pack target -->
<Target Name="AddRuntimeConfigFileToBuiltProjectOutputGroupOutput"
Condition=" '$(GenerateRuntimeConfigurationFiles)' == 'true'"
BeforeTargets="BuiltProjectOutputGroup">
<ItemGroup>
<BuiltProjectOutputGroupOutput Include="$(ProjectRuntimeConfigFilePath)" FinalOutputPath="$(ProjectRuntimeConfigFilePath)" />
</ItemGroup>
</Target>
<Target Name="_SdkBeforeClean">
<PropertyGroup Condition="'$(_CleaningWithoutRebuilding)' == ''">
<_CleaningWithoutRebuilding>true</_CleaningWithoutRebuilding>
<EmitAssetsLogMessages>false</EmitAssetsLogMessages>
</PropertyGroup>
</Target>
<Target Name="_SdkBeforeRebuild">
<PropertyGroup>
<_CleaningWithoutRebuilding>false</_CleaningWithoutRebuilding>
</PropertyGroup>
</Target>
<!--
============================================================
DefaultRuntimeHostConfigurationOptions
Defaults @(RuntimeHostConfigurationOption) items based on MSBuild properties.
============================================================
-->
<ItemGroup>
<RuntimeHostConfigurationOption Include="System.GC.Concurrent"
Condition="'$(ConcurrentGarbageCollection)' != ''"
Value="$(ConcurrentGarbageCollection)" />
<RuntimeHostConfigurationOption Include="System.GC.Server"
Condition="'$(ServerGarbageCollection)' != ''"
Value="$(ServerGarbageCollection)" />
<RuntimeHostConfigurationOption Include="System.GC.RetainVM"
Condition="'$(RetainVMGarbageCollection)' != ''"
Value="$(RetainVMGarbageCollection)" />
<RuntimeHostConfigurationOption Include="System.Runtime.TieredCompilation"
Condition="'$(TieredCompilation)' != ''"
Value="$(TieredCompilation)" />
<RuntimeHostConfigurationOption Include="System.Threading.ThreadPool.MinThreads"
Condition="'$(ThreadPoolMinThreads)' != ''"
Value="$(ThreadPoolMinThreads)" />
<RuntimeHostConfigurationOption Include="System.Threading.ThreadPool.MaxThreads"
Condition="'$(ThreadPoolMaxThreads)' != ''"
Value="$(ThreadPoolMaxThreads)" />
<RuntimeHostConfigurationOption Include="System.Globalization.Invariant"
Condition="'$(InvariantGlobalization)' != ''"
Value="$(InvariantGlobalization)" />
</ItemGroup>
<!--
============================================================
DefaultAdditionalProbingPaths
Adds the default @(AdditionalProbingPath) items.
============================================================
-->
<ItemGroup Condition="'$(GenerateRuntimeConfigurationFiles)' == 'true' and '$(SkipDefaultAdditionalProbingPaths)' != 'true'">
<!-- Note: can't use Path.Combine here since `|` is an illegal path character -->
<AdditionalProbingPath Include="$(UserProfileRuntimeStorePath)$([System.IO.Path]::DirectorySeparatorChar)|arch|$([System.IO.Path]::DirectorySeparatorChar)|tfm|" />
</ItemGroup>
<!--
============================================================
_ComputeNETCoreBuildOutputFiles
Computes any files that need to be copied to the build output folder for .NET Core.
============================================================
-->
<UsingTask TaskName="EmbedAppNameInHost" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" />
<Target Name="_ComputeNETCoreBuildOutputFiles"
DependsOnTargets="ResolvePackageAssets"
AfterTargets="ResolveReferences"
BeforeTargets="AssignTargetPaths"
Condition="'$(ComputeNETCoreBuildOutputFiles)' == 'true'">
<!--
During "build" and "run" of .NET Core projects, the assemblies coming from NuGet packages
are loaded from the NuGet cache. But, in order for a self-contained app to be runnable,
it requires a host in the output directory to load the app.
During "publish", all required assets are copied to the publish directory.
-->
<ItemGroup Condition="'$(SelfContained)' == 'true' and '$(RuntimeIdentifier)' != '' and '$(_IsExecutable)' == 'true'">
<NativeNETCoreCopyLocalItems Include="@(NativeCopyLocalItems)"
Condition="'%(NativeCopyLocalItems.FileName)%(NativeCopyLocalItems.Extension)' == '$(_DotNetHostPolicyLibraryName)' or
'%(NativeCopyLocalItems.FileName)%(NativeCopyLocalItems.Extension)' == '$(_DotNetHostFxrLibraryName)'" />
<NativeRestoredAppHostNETCore Include="@(NativeCopyLocalItems)"
Condition="'%(NativeCopyLocalItems.FileName)%(NativeCopyLocalItems.Extension)' == '$(_DotNetAppHostExecutableName)'"/>
</ItemGroup>
<PropertyGroup Condition="'@(NativeRestoredAppHostNETCore)' != '' ">
<AppHostDestinationDirectoryPath>$(BaseIntermediateOutputPath)\$(TargetFramework)\$(RuntimeIdentifier)\host</AppHostDestinationDirectoryPath>
</PropertyGroup>
<NETSdkError Condition="'@(NativeRestoredAppHostNETCore->Count())' > 1"
ResourceName="MultipleFilesResolved"
FormatArguments="$(_DotNetAppHostExecutableName)" />
<EmbedAppNameInHost AppHostSourcePath="@(NativeRestoredAppHostNETCore)"
AppHostDestinationDirectoryPath="$(AppHostDestinationDirectoryPath)"
AppBinaryName="$(AssemblyName)$(TargetExt)"
Condition="'@(NativeRestoredAppHostNETCore)' != '' ">
<Output TaskParameter="ModifiedAppHostPath" ItemName="NativeAppHostNETCore" />
</EmbedAppNameInHost>
<ItemGroup Condition="'@(NativeAppHostNETCore)' == '' ">
<NativeAppHostNETCore Include="@(NativeCopyLocalItems)"
Condition="'%(NativeCopyLocalItems.FileName)%(NativeCopyLocalItems.Extension)' == '$(_DotNetHostExecutableName)'" />
</ItemGroup>
<NETSdkError Condition="'@(NativeAppHostNETCore->Count())' > 1"
ResourceName="MultipleFilesResolved"
FormatArguments="@(NativeAppHostNETCore)" />
<ItemGroup Condition="'@(NativeAppHostNETCore)' != '' ">
<NativeNETCoreCopyLocalItems Include="@(NativeAppHostNETCore)">
<!-- Rename the host executable to the app's name -->
<Link>$(AssemblyName)%(NativeAppHostNETCore.Extension)</Link>
</NativeNETCoreCopyLocalItems>
</ItemGroup>
<ItemGroup Condition="'$(SelfContained)' == 'true' and '$(RuntimeIdentifier)' != '' and '$(_IsExecutable)' == 'true'">
<AllNETCoreCopyLocalItems Include="@(NativeNETCoreCopyLocalItems)">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</AllNETCoreCopyLocalItems>
</ItemGroup>
<ItemGroup>
<!-- Use 'None' so we can rename files using the 'Link' metadata as necessary -->
<None Include="@(AllNETCoreCopyLocalItems)" />
</ItemGroup>
</Target>
<!--
============================================================
_ComputeReferenceAssemblies
Computes references that are only used at compile-time.
============================================================
-->
<Target Name="_ComputeReferenceAssemblies"
DependsOnTargets="ResolveAssemblyReferences">
<ItemGroup>
<_FrameworkReferenceAssemblies Include="@(ReferencePath)"
Condition="%(ReferencePath.FrameworkFile) == 'true' or
%(ReferencePath.ResolvedFrom) == 'ImplicitlyExpandDesignTimeFacades'" />
<!--
"ReferenceOnly" assemblies are assemblies that are only used at compile-time, and they can't be resolved
by the normal compile-assembly resolvers at runtime:
1. App local
2. NuGet/Package layout
3. ProgramFiles\Reference Assemblies
These assemblies need to be copied to the 'refs' folder for both build and publish.
-->
<_ReferenceOnlyAssemblies Include="@(ReferencePath)"
Exclude="@(_FrameworkReferenceAssemblies)"
Condition="%(ReferencePath.CopyLocal) != 'true' and
%(ReferencePath.NuGetSourceType) == ''" />
<_ReferenceAssemblies Include="@(_FrameworkReferenceAssemblies)" />
<_ReferenceAssemblies Include="@(_ReferenceOnlyAssemblies)" />
</ItemGroup>
</Target>
<!--
============================================================
Run Information
The ProcessStart information that can be used to run this project.
============================================================
-->
<PropertyGroup>
<RunWorkingDirectory Condition="'$(RunWorkingDirectory)' == ''">$(StartWorkingDirectory)</RunWorkingDirectory>
</PropertyGroup>
<Choose>
<When Condition="'$(StartAction)' == 'Program'">
<PropertyGroup>
<RunCommand Condition="'$(RunCommand)' == ''">$(StartProgram)</RunCommand>
<RunArguments Condition="'$(RunArguments)' == ''">$(StartArguments)</RunArguments>
</PropertyGroup>
</When>
<When Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(_IsExecutable)' == 'true'">
<PropertyGroup Condition="'$(SelfContained)' != 'true'">
<!-- TODO: https://github.com/dotnet/sdk/issues/20 Need to get the DotNetHost path from MSBuild -->
<RunCommand Condition="'$(RunCommand)' == ''">dotnet</RunCommand>
<_NetCoreRunArguments>exec "$(TargetPath)"</_NetCoreRunArguments>
<RunArguments Condition="'$(RunArguments)' == '' and '$(StartArguments)' != ''">$(_NetCoreRunArguments) $(StartArguments)</RunArguments>
<RunArguments Condition="'$(RunArguments)' == ''">$(_NetCoreRunArguments)</RunArguments>
</PropertyGroup>
<PropertyGroup Condition="'$(SelfContained)' == 'true'">
<RunCommand Condition="'$(RunCommand)' == ''">$(TargetDir)$(AssemblyName)$(_NativeExecutableExtension)</RunCommand>
<RunArguments Condition="'$(RunArguments)' == ''">$(StartArguments)</RunArguments>
</PropertyGroup>
</When>
<When Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' and '$(_IsExecutable)' == 'true'">
<PropertyGroup>
<RunCommand Condition="'$(RunCommand)' == ''">$(TargetPath)</RunCommand>
<RunArguments Condition="'$(RunArguments)' == ''">$(StartArguments)</RunArguments>
</PropertyGroup>
</When>
</Choose>
<PropertyGroup>
<!-- Ensure $(RunWorkingDirectory) is a full path -->
<RunWorkingDirectory Condition="'$(RunWorkingDirectory)' != '' and '$([System.IO.Path]::IsPathRooted($(RunWorkingDirectory)))' != 'true'">$([System.IO.Path]::GetFullPath($([System.IO.Path]::Combine('$(MSBuildProjectDirectory)', '$(RunWorkingDirectory)'))))</RunWorkingDirectory>
</PropertyGroup>
<!--
============================================================
CoreGenerateSatelliteAssemblies
============================================================
-->
<PropertyGroup>
<CreateSatelliteAssembliesDependsOn>
$(CreateSatelliteAssembliesDependsOn);
CoreGenerateSatelliteAssemblies
</CreateSatelliteAssembliesDependsOn>
</PropertyGroup>
<UsingTask TaskName="GetAssemblyAttributes" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" />
<Target Name="CoreGenerateSatelliteAssemblies"
DependsOnTargets="ResolveAssemblyReferences;_GetAssemblyInfoFromTemplateFile"
Inputs="$(MSBuildAllProjects);@(_SatelliteAssemblyResourceInputs);$(IntermediateOutputPath)$(TargetName)$(TargetExt)"
Outputs="$(IntermediateOutputPath)%(Culture)\$(TargetName).resources.dll"
Condition="'@(_SatelliteAssemblyResourceInputs)' != '' and '$(GenerateSatelliteAssembliesForCore)' == 'true' ">
<MakeDir Directories="@(_SatelliteAssemblyResourceInputs->'$(IntermediateOutputPath)%(Culture)')" />
<PropertyGroup>
<_AssemblyInfoFile>$(IntermediateOutputPath)%(_SatelliteAssemblyResourceInputs.Culture)\$(TargetName).resources.cs</_AssemblyInfoFile>
<_OutputAssembly>$(IntermediateOutputPath)%(_SatelliteAssemblyResourceInputs.Culture)\$(TargetName).resources.dll</_OutputAssembly>
</PropertyGroup>
<ItemGroup>
<SatelliteAssemblyAttribute Include="System.Reflection.AssemblyCultureAttribute" Condition="'%(_SatelliteAssemblyResourceInputs.Culture)' != ''">
<_Parameter1>%(_SatelliteAssemblyResourceInputs.Culture)</_Parameter1>
</SatelliteAssemblyAttribute>
</ItemGroup>
<WriteCodeFragment AssemblyAttributes="@(SatelliteAssemblyAttribute)" Language="C#" OutputFile="$(_AssemblyInfoFile)">
<Output TaskParameter="OutputFile" ItemName="FileWrites" />
</WriteCodeFragment>
<PropertyGroup Condition="'$(UseSharedCompilation)' == ''">
<UseSharedCompilation>true</UseSharedCompilation>
</PropertyGroup>
<Csc Resources="@(_SatelliteAssemblyResourceInputs)"
Sources="$(_AssemblyInfoFile)"
OutputAssembly="$(_OutputAssembly)"
References="@(ReferencePath)"
KeyContainer="$(KeyContainerName)"
KeyFile="$(KeyOriginatorFile)"
NoConfig="true"
NoLogo="$(NoLogo)"
NoStandardLib="$(NoCompilerStandardLib)"
PublicSign="$(PublicSign)"
DelaySign="$(DelaySign)"
Deterministic="$(Deterministic)"
DisabledWarnings="$(DisabledWarnings)"
WarningLevel="$(WarningLevel)"
WarningsAsErrors="$(WarningsAsErrors)"
WarningsNotAsErrors="$(WarningsNotAsErrors)"
TargetType="Library"
ToolExe="$(CscToolExe)"
ToolPath="$(CscToolPath)"
UseSharedCompilation="$(UseSharedCompilation)">
<Output TaskParameter="OutputAssembly" ItemName="FileWrites"/>
</Csc>
</Target>
<Target Name="_GetAssemblyInfoFromTemplateFile">
<GetAssemblyAttributes PathToTemplateFile="$(IntermediateOutputPath)$(TargetName)$(TargetExt)" >
<Output TaskParameter="AssemblyAttributes" ItemName="_AssemblyAttributesFromTemplateFile" />
</GetAssemblyAttributes>
<ItemGroup>
<SatelliteAssemblyAttribute Include="@(_AssemblyAttributesFromTemplateFile)" />
</ItemGroup>
</Target>
<!--
============================================================
_DefaultMicrosoftNETPlatformLibrary
.NET Core apps can have shared frameworks that are pre-installed on the target machine, thus the app is "portable"
to any machine that already has the shared framework installed. In order to enable this, a "platform" library
has to be declared. The platform library and its dependencies will be excluded from the runtime assemblies.
============================================================
-->
<Target Name="_DefaultMicrosoftNETPlatformLibrary">
<PropertyGroup Condition="'$(MicrosoftNETPlatformLibrary)' == ''">
<MicrosoftNETPlatformLibrary Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">Microsoft.NETCore.App</MicrosoftNETPlatformLibrary>
</PropertyGroup>
</Target>
<!--
============================================================
GetAllRuntimeIdentifiers
============================================================
-->
<Target Name="GetAllRuntimeIdentifiers"
Returns="$(RuntimeIdentifiers);$(RuntimeIdentifier)" />
<!--
============================================================
InjectTargetPathMetadata
Update TargetPathWithTargetPlatformMoniker with target framework
identifier and version metadata. This is so that the
ImplicitlyExpandNETStandardFacades target can determine if a
referenced project needs the .NET Standard facades even if
the project hasn't been compiled to disk yet.
See https://github.com/dotnet/sdk/issues/1403 for more context
============================================================
-->
<ItemDefinitionGroup>
<TargetPathWithTargetPlatformMoniker>
<TargetFrameworkIdentifier>$(TargetFrameworkIdentifier)</TargetFrameworkIdentifier>
<TargetFrameworkVersion>$(_TargetFrameworkVersionWithoutV)</TargetFrameworkVersion>
</TargetPathWithTargetPlatformMoniker>
</ItemDefinitionGroup>
<!--
============================================================
Project Capabilities
============================================================
-->
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(_IsExecutable)' == 'true'">
<ProjectCapability Include="CrossPlatformExecutable" />
</ItemGroup>
<!-- Reference Manager capabilities -->
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<ProjectCapability Remove="ReferenceManagerAssemblies" />
<ProjectCapability Remove="ReferenceManagerCOM" />
</ItemGroup>
<!-- Publish capabilities -->
<ItemGroup>
<ProjectCapability Include="FolderPublish" />
</ItemGroup>
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.DisableStandardFrameworkResolution.targets" Condition="'$(DisableStandardFrameworkResolution)' == 'true'" />
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.GenerateAssemblyInfo.targets" />
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.ComposeStore.targets" />
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.CrossGen.targets" />
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.ObsoleteReferences.targets" />
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.Publish.targets" />
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.PackTool.targets" />
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.PreserveCompilationContext.targets" />
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.ConflictResolution.targets" />
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.Sdk.CSharp.targets" Condition="'$(Language)' == 'C#'" />
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.Sdk.VisualBasic.targets" Condition="'$(Language)' == 'VB'" />
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.Sdk.FSharp.targets" Condition="'$(Language)' == 'F#'" />
</Project>