2 ***********************************************************************************************
\r
3 Microsoft.NET.Sdk.targets
\r
5 WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
\r
6 created a backup copy. Incorrect changes to this file will make it
\r
7 impossible to load or build your projects from the command-line or the IDE.
\r
9 Copyright (c) .NET Foundation. All rights reserved.
\r
10 ***********************************************************************************************
\r
12 <Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
\r
15 <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
\r
18 <Import Project="Microsoft.NET.Sdk.Common.targets" />
\r
21 <Import Project="$(MSBuildThisFileDirectory)Microsoft.PackageDependencyResolution.targets" Condition="Exists('$(MSBuildThisFileDirectory)Microsoft.PackageDependencyResolution.targets')" />
\r
24 <Import Project="Microsoft.NET.Sdk.DefaultItems.targets" />
\r
26 <UsingTask TaskName="GenerateDepsFile" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" />
\r
27 <UsingTask TaskName="GenerateRuntimeConfigurationFiles" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" />
\r
28 <UsingTask TaskName="GetAssemblyVersion" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" />
\r
29 <UsingTask TaskName="GenerateSatelliteAssemblies" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" />
\r
32 <DisableStandardFrameworkResolution Condition="'$(DisableStandardFrameworkResolution)' == ''">$(_IsNETCoreOrNETStandard)</DisableStandardFrameworkResolution>
\r
36 <GenerateRuntimeConfigurationFiles Condition=" '$(GenerateRuntimeConfigurationFiles)' == '' and '$(OutputType)' == 'exe' ">true</GenerateRuntimeConfigurationFiles>
\r
37 <UserRuntimeConfig Condition=" '$(UserRuntimeConfig)' == '' ">$(MSBuildProjectDirectory)/runtimeconfig.template.json</UserRuntimeConfig>
\r
38 <GenerateSatelliteAssembliesForCore Condition=" '$(GenerateSatelliteAssembliesForCore)' == '' and '$(MSBuildRuntimeType)' == 'Core' ">true</GenerateSatelliteAssembliesForCore>
\r
39 <ComputeNETCoreBuildOutputFiles Condition=" '$(ComputeNETCoreBuildOutputFiles)' == '' and '$(TargetFrameworkIdentifier)' == '.NETCoreApp'">true</ComputeNETCoreBuildOutputFiles>
\r
43 <ProjectDepsFileName Condition="'$(ProjectDepsFileName)' == ''">$(AssemblyName).deps.json</ProjectDepsFileName>
\r
44 <ProjectDepsFilePath Condition="'$(ProjectDepsFilePath)' == ''">$(TargetDir)$(ProjectDepsFileName)</ProjectDepsFilePath>
\r
45 <ProjectRuntimeConfigFileName Condition="'$(ProjectRuntimeConfigFileName)' == ''">$(AssemblyName).runtimeconfig.json</ProjectRuntimeConfigFileName>
\r
46 <ProjectRuntimeConfigFilePath Condition="'$(ProjectRuntimeConfigFilePath)' == ''">$(TargetDir)$(ProjectRuntimeConfigFileName)</ProjectRuntimeConfigFilePath>
\r
47 <ProjectRuntimeConfigDevFilePath Condition="'$(ProjectRuntimeConfigDevFilePath)' == ''">$(TargetDir)$(AssemblyName).runtimeconfig.dev.json</ProjectRuntimeConfigDevFilePath>
\r
51 <_NativeLibraryPrefix Condition="'$(_NativeLibraryPrefix)' == '' and !$(RuntimeIdentifier.StartsWith('win'))">lib</_NativeLibraryPrefix>
\r
53 <_NativeLibraryExtension Condition="'$(_NativeLibraryExtension)' == '' and $(RuntimeIdentifier.StartsWith('win'))">.dll</_NativeLibraryExtension>
\r
54 <_NativeLibraryExtension Condition="'$(_NativeLibraryExtension)' == '' and $(RuntimeIdentifier.StartsWith('osx'))">.dylib</_NativeLibraryExtension>
\r
55 <_NativeLibraryExtension Condition="'$(_NativeLibraryExtension)' == ''">.so</_NativeLibraryExtension>
\r
57 <_NativeExecutableExtension Condition="'$(_NativeExecutableExtension)' == '' and $(RuntimeIdentifier.StartsWith('win'))">.exe</_NativeExecutableExtension>
\r
59 <_DotNetHostExecutableName>dotnet$(_NativeExecutableExtension)</_DotNetHostExecutableName>
\r
60 <_DotNetAppHostExecutableName>apphost$(_NativeExecutableExtension)</_DotNetAppHostExecutableName>
\r
62 <_DotNetHostPolicyLibraryName>$(_NativeLibraryPrefix)hostpolicy$(_NativeLibraryExtension)</_DotNetHostPolicyLibraryName>
\r
63 <_DotNetHostFxrLibraryName>$(_NativeLibraryPrefix)hostfxr$(_NativeLibraryExtension)</_DotNetHostFxrLibraryName>
\r
67 <CoreBuildDependsOn>
\r
68 $(CoreBuildDependsOn);
\r
69 GenerateBuildDependencyFile;
\r
70 GenerateBuildRuntimeConfigurationFiles
\r
71 </CoreBuildDependsOn>
\r
75 ============================================================
\r
76 GenerateBuildDependencyFile
\r
78 Generates the $(project).deps.json file during Build
\r
79 ============================================================
\r
82 <Target Name="GenerateBuildDependencyFile"
\r
83 DependsOnTargets="_DefaultMicrosoftNETPlatformLibrary"
\r
84 BeforeTargets="_CheckForCompileOutputs"
\r
85 Condition=" '$(GenerateDependencyFile)' == 'true'"
\r
86 Inputs="$(ProjectAssetsFile)"
\r
87 Outputs="$(ProjectDepsFilePath)">
\r
90 Explicitly not passing any PrivateAssets information during 'Build', since these dependencies
\r
91 should be included during 'Build'. They are only excluded on 'Publish'.
\r
93 <GenerateDepsFile ProjectPath="$(MSBuildProjectFullPath)"
\r
94 AssetsFilePath="$(ProjectAssetsFile)"
\r
95 DepsFilePath="$(ProjectDepsFilePath)"
\r
96 TargetFramework="$(TargetFrameworkMoniker)"
\r
97 AssemblyName="$(AssemblyName)"
\r
98 AssemblyExtension="$(TargetExt)"
\r
99 AssemblyVersion="$(Version)"
\r
100 AssemblySatelliteAssemblies="@(IntermediateSatelliteAssembliesWithTargetPath)"
\r
101 ReferencePaths="@(ReferencePath)"
\r
102 ReferenceSatellitePaths="@(ReferenceSatellitePaths)"
\r
103 RuntimeIdentifier="$(RuntimeIdentifier)"
\r
104 PlatformLibraryName="$(MicrosoftNETPlatformLibrary)"
\r
105 CompilerOptions="@(DependencyFileCompilerOptions)">
\r
106 </GenerateDepsFile>
\r
109 <!-- 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
\r
110 during incremental builds when the task is skipped -->
\r
111 <FileWrites Include="$(ProjectDepsFilePath)" Condition="Exists('$(ProjectDepsFilePath)')"/>
\r
116 ============================================================
\r
117 GenerateBuildRuntimeConfigurationFiles
\r
119 Generates the $(project).runtimeconfig.json and $(project).runtimeconfig.dev.json files during Build
\r
120 ============================================================
\r
123 <Target Name="GenerateBuildRuntimeConfigurationFiles"
\r
124 DependsOnTargets="_DefaultMicrosoftNETPlatformLibrary"
\r
125 BeforeTargets="_CheckForCompileOutputs"
\r
126 Condition=" '$(GenerateRuntimeConfigurationFiles)' == 'true'"
\r
127 Inputs="$(ProjectAssetsFile);$(UserRuntimeConfig)"
\r
128 Outputs="$(ProjectRuntimeConfigFilePath);$(ProjectRuntimeConfigDevFilePath)">
\r
130 <GenerateRuntimeConfigurationFiles AssetsFilePath="$(ProjectAssetsFile)"
\r
131 TargetFrameworkMoniker="$(TargetFrameworkMoniker)"
\r
132 TargetFramework="$(TargetFramework)"
\r
133 RuntimeConfigPath="$(ProjectRuntimeConfigFilePath)"
\r
134 RuntimeConfigDevPath="$(ProjectRuntimeConfigDevFilePath)"
\r
135 RuntimeIdentifier="$(RuntimeIdentifier)"
\r
136 PlatformLibraryName="$(MicrosoftNETPlatformLibrary)"
\r
137 UserRuntimeConfig="$(UserRuntimeConfig)"
\r
138 HostConfigurationOptions="@(RuntimeHostConfigurationOption)">
\r
140 </GenerateRuntimeConfigurationFiles>
\r
143 <!-- 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
\r
144 during incremental builds when the task is skipped -->
\r
145 <FileWrites Include="$(ProjectRuntimeConfigFilePath)" Condition="Exists('$(ProjectRuntimeConfigFilePath)')"/>
\r
146 <FileWrites Include="$(ProjectRuntimeConfigDevFilePath)" Condition="Exists('$(ProjectRuntimeConfigDevFilePath)')"/>
\r
151 <!-- Add runtimeconfig.json file to BuiltProjectOutputGroupOutput, so that it will get included in the NuGet package by the Pack target -->
\r
152 <Target Name="AddRuntimeConfigFileToBuiltProjectOutputGroupOutput"
\r
153 Condition=" '$(GenerateRuntimeConfigurationFiles)' == 'true'"
\r
154 BeforeTargets="BuiltProjectOutputGroup">
\r
156 <BuiltProjectOutputGroupOutput Include="$(ProjectRuntimeConfigFilePath)" FinalOutputPath="$(ProjectRuntimeConfigFilePath)" />
\r
161 ============================================================
\r
162 DefaultRuntimeHostConfigurationOptions
\r
164 Defaults @(RuntimeHostConfigurationOption) items based on MSBuild properties.
\r
165 ============================================================
\r
169 <RuntimeHostConfigurationOption Include="System.GC.Concurrent"
\r
170 Condition="'$(ConcurrentGarbageCollection)' != ''"
\r
171 Value="$(ConcurrentGarbageCollection)" />
\r
173 <RuntimeHostConfigurationOption Include="System.GC.Server"
\r
174 Condition="'$(ServerGarbageCollection)' != ''"
\r
175 Value="$(ServerGarbageCollection)" />
\r
177 <RuntimeHostConfigurationOption Include="System.GC.RetainVM"
\r
178 Condition="'$(RetainVMGarbageCollection)' != ''"
\r
179 Value="$(RetainVMGarbageCollection)" />
\r
181 <RuntimeHostConfigurationOption Include="System.Threading.ThreadPool.MinThreads"
\r
182 Condition="'$(ThreadPoolMinThreads)' != ''"
\r
183 Value="$(ThreadPoolMinThreads)" />
\r
185 <RuntimeHostConfigurationOption Include="System.Threading.ThreadPool.MaxThreads"
\r
186 Condition="'$(ThreadPoolMaxThreads)' != ''"
\r
187 Value="$(ThreadPoolMaxThreads)" />
\r
191 ============================================================
\r
192 _ComputeNETCoreBuildOutputFiles
\r
194 Computes any files that need to be copied to the build output folder for .NET Core.
\r
195 ============================================================
\r
197 <UsingTask TaskName="EmbedAppNameInHost" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" />
\r
198 <Target Name="_ComputeNETCoreBuildOutputFiles"
\r
199 DependsOnTargets="_ComputeActiveTFMFileDependencies"
\r
200 AfterTargets="ResolveReferences"
\r
201 BeforeTargets="AssignTargetPaths"
\r
202 Condition="'$(ComputeNETCoreBuildOutputFiles)' == 'true'">
\r
205 During "build" and "run" of .NET Core projects, the assemblies coming from NuGet packages
\r
206 are loaded from the NuGet cache. But, in order for a self-contained app to be runnable,
\r
207 it requires a host in the output directory to load the app.
\r
208 During "publish", all required assets are copied to the publish directory.
\r
210 <ItemGroup Condition="'$(RuntimeIdentifier)' != '' and '$(OutputType)' == 'Exe'">
\r
211 <_NETCoreNativeFileItems Include="@(_ActiveTFMFileDependencies->WithMetadataValue('FileGroup', 'NativeLibrary'))" />
\r
212 <__NETCoreNativeItems Include="@(FileDefinitions)" Exclude="@(_NETCoreNativeFileItems)" />
\r
213 <_NETCoreNativeItems Include="@(FileDefinitions)" Exclude="@(__NETCoreNativeItems)" />
\r
215 <NativeNETCoreCopyLocalItems Include="%(_NETCoreNativeItems.ResolvedPath)"
\r
216 Condition="'%(_NETCoreNativeItems.FileName)%(_NETCoreNativeItems.Extension)' == '$(_DotNetHostPolicyLibraryName)' or
\r
217 '%(_NETCoreNativeItems.FileName)%(_NETCoreNativeItems.Extension)' == '$(_DotNetHostFxrLibraryName)'" />
\r
219 <NativeRestoredAppHostNETCore Include="%(_NETCoreNativeItems.ResolvedPath)"
\r
220 Condition="'%(_NETCoreNativeItems.FileName)%(_NETCoreNativeItems.Extension)' == '$(_DotNetAppHostExecutableName)'"/>
\r
223 <PropertyGroup Condition="'@(NativeRestoredAppHostNETCore)' != '' ">
\r
224 <AppHostDestinationDirectoryPath>$(BaseIntermediateOutputPath)\$(TargetFramework)\$(RuntimeIdentifier)\host</AppHostDestinationDirectoryPath>
\r
227 <NETSdkError Condition="'@(NativeRestoredAppHostNETCore->Count())' > 1"
\r
228 ResourceName="MultipleFilesResolved"
\r
229 FormatArguments="$(_DotNetAppHostExecutableName)" />
\r
231 <EmbedAppNameInHost AppHostSourcePath="@(NativeRestoredAppHostNETCore)"
\r
232 AppHostDestinationDirectoryPath="$(AppHostDestinationDirectoryPath)"
\r
233 AppBinaryName="$(AssemblyName)$(TargetExt)"
\r
234 Condition="'@(NativeRestoredAppHostNETCore)' != '' ">
\r
236 <Output TaskParameter="ModifiedAppHostPath" ItemName="NativeAppHostNETCore" />
\r
237 </EmbedAppNameInHost>
\r
239 <ItemGroup Condition="'@(NativeAppHostNETCore)' == '' ">
\r
240 <NativeAppHostNETCore Include="%(_NETCoreNativeItems.ResolvedPath)"
\r
241 Condition="'%(_NETCoreNativeItems.FileName)%(_NETCoreNativeItems.Extension)' == '$(_DotNetHostExecutableName)'" />
\r
244 <NETSdkError Condition="'@(NativeAppHostNETCore->Count())' > 1"
\r
245 ResourceName="MultipleFilesResolved"
\r
246 FormatArguments="@(NativeAppHostNETCore)" />
\r
248 <ItemGroup Condition="'@(NativeAppHostNETCore)' != '' ">
\r
249 <NativeNETCoreCopyLocalItems Include="@(NativeAppHostNETCore)">
\r
250 <!-- Rename the host executable to the app's name -->
\r
251 <Link>$(AssemblyName)%(NativeAppHostNETCore.Extension)</Link>
\r
252 </NativeNETCoreCopyLocalItems>
\r
255 <ItemGroup Condition="'$(RuntimeIdentifier)' != '' and '$(OutputType)' == 'Exe'">
\r
256 <AllNETCoreCopyLocalItems Include="@(NativeNETCoreCopyLocalItems)">
\r
257 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
\r
258 <CopyToPublishDirectory>Never</CopyToPublishDirectory>
\r
259 </AllNETCoreCopyLocalItems>
\r
262 <!-- Use 'None' so we can rename files using the 'Link' metadata as necessary -->
\r
263 <None Include="@(AllNETCoreCopyLocalItems)" />
\r
269 ============================================================
\r
272 The ProcessStart information that can be used to run this project.
\r
273 ============================================================
\r
277 <RunWorkingDirectory Condition="'$(RunWorkingDirectory)' == ''">$(StartWorkingDirectory)</RunWorkingDirectory>
\r
281 <When Condition="'$(StartAction)' == 'Program'">
\r
283 <RunCommand Condition="'$(RunCommand)' == ''">$(StartProgram)</RunCommand>
\r
284 <RunArguments Condition="'$(RunArguments)' == ''">$(StartArguments)</RunArguments>
\r
288 <When Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(OutputType)' == 'Exe'">
\r
289 <PropertyGroup Condition="'$(RuntimeIdentifier)' == ''">
\r
290 <!-- TODO: https://github.com/dotnet/sdk/issues/20 Need to get the DotNetHost path from MSBuild -->
\r
291 <RunCommand Condition="'$(RunCommand)' == ''">dotnet</RunCommand>
\r
293 <_NetCoreRunArguments>exec "$(TargetPath)"</_NetCoreRunArguments>
\r
294 <RunArguments Condition="'$(RunArguments)' == '' and '$(StartArguments)' != ''">$(_NetCoreRunArguments) $(StartArguments)</RunArguments>
\r
295 <RunArguments Condition="'$(RunArguments)' == ''">$(_NetCoreRunArguments)</RunArguments>
\r
298 <PropertyGroup Condition="'$(RuntimeIdentifier)' != ''">
\r
299 <RunCommand Condition="'$(RunCommand)' == ''">$(TargetDir)$(AssemblyName)$(_NativeExecutableExtension)</RunCommand>
\r
300 <RunArguments Condition="'$(RunArguments)' == ''">$(StartArguments)</RunArguments>
\r
304 <When Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' and '$(OutputType)' == 'Exe'">
\r
306 <RunCommand Condition="'$(RunCommand)' == ''">$(TargetPath)</RunCommand>
\r
307 <RunArguments Condition="'$(RunArguments)' == ''">$(StartArguments)</RunArguments>
\r
313 <!-- Ensure $(RunWorkingDirectory) is a full path -->
\r
314 <RunWorkingDirectory Condition="'$(RunWorkingDirectory)' != '' and '$([System.IO.Path]::IsPathRooted($(RunWorkingDirectory)))' != 'true'">$([System.IO.Path]::GetFullPath($([System.IO.Path]::Combine('$(MSBuildProjectDirectory)', '$(RunWorkingDirectory)'))))</RunWorkingDirectory>
\r
318 ============================================================
\r
319 CoreGenerateSatelliteAssemblies
\r
320 ============================================================
\r
323 <CreateSatelliteAssembliesDependsOn>
\r
324 $(CreateSatelliteAssembliesDependsOn);
\r
325 CoreGenerateSatelliteAssemblies
\r
326 </CreateSatelliteAssembliesDependsOn>
\r
329 <Target Name="CoreGenerateSatelliteAssemblies"
\r
330 DependsOnTargets="ResolveAssemblyReferences;GenerateAssemblyInfo"
\r
331 Inputs="$(MSBuildAllProjects);@(_SatelliteAssemblyResourceInputs);$(IntermediateOutputPath)$(TargetName)$(TargetExt)"
\r
332 Outputs="$(IntermediateOutputPath)%(Culture)\$(TargetName).resources.dll"
\r
333 Condition="'@(_SatelliteAssemblyResourceInputs)' != '' and '$(GenerateSatelliteAssembliesForCore)' == 'true' ">
\r
335 <MakeDir Directories="@(_SatelliteAssemblyResourceInputs->'$(IntermediateOutputPath)%(Culture)')" />
\r
338 <_AssemblyInfoFile>$(IntermediateOutputPath)%(_SatelliteAssemblyResourceInputs.Culture)\$(TargetName).resources.cs</_AssemblyInfoFile>
\r
339 <_OutputAssembly>$(IntermediateOutputPath)%(_SatelliteAssemblyResourceInputs.Culture)\$(TargetName).resources.dll</_OutputAssembly>
\r
343 <SatelliteAssemblyAttribute Include="@(AssemblyAttribute)" />
\r
344 <SatelliteAssemblyAttribute Include="System.Reflection.AssemblyCultureAttribute" Condition="'%(_SatelliteAssemblyResourceInputs.Culture)' != ''">
\r
345 <_Parameter1>%(_SatelliteAssemblyResourceInputs.Culture)</_Parameter1>
\r
346 </SatelliteAssemblyAttribute>
\r
349 <WriteCodeFragment AssemblyAttributes="@(SatelliteAssemblyAttribute)" Language="$(Language)" OutputFile="$(_AssemblyInfoFile)">
\r
350 <Output TaskParameter="OutputFile" ItemName="FileWrites" />
\r
351 </WriteCodeFragment>
\r
353 <Csc Resources="@(_SatelliteAssemblyResourceInputs)"
\r
354 Sources="$(_AssemblyInfoFile)"
\r
355 OutputAssembly="$(_OutputAssembly)"
\r
356 References="@(ReferencePath)"
\r
357 KeyContainer="$(KeyContainerName)"
\r
358 KeyFile="$(KeyOriginatorFile)"
\r
359 PublicSign="$(PublicSign)"
\r
360 DelaySign="$(DelaySign)"
\r
361 Deterministic="$(Deterministic)"
\r
362 TargetType="Library"
\r
363 ToolExe="$(CscToolExe)"
\r
364 ToolPath="$(CscToolPath)">
\r
366 <Output TaskParameter="OutputAssembly" ItemName="FileWrites"/>
\r
371 ============================================================
\r
372 _DefaultMicrosoftNETPlatformLibrary
\r
374 .NET Core apps can have shared frameworks that are pre-installed on the target machine, thus the app is "portable"
\r
375 to any machine that already has the shared framework installed. In order to enable this, a "platform" library
\r
376 has to be declared. The platform library and its dependencies will be excluded from the runtime assemblies.
\r
377 ============================================================
\r
379 <Target Name="_DefaultMicrosoftNETPlatformLibrary">
\r
381 <PropertyGroup Condition="'$(MicrosoftNETPlatformLibrary)' == ''">
\r
382 <MicrosoftNETPlatformLibrary Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">Microsoft.NETCore.App</MicrosoftNETPlatformLibrary>
\r
388 ============================================================
\r
389 GetAllRuntimeIdentifiers
\r
390 ============================================================
\r
392 <Target Name="GetAllRuntimeIdentifiers"
\r
393 Returns="$(RuntimeIdentifiers);$(RuntimeIdentifier)" />
\r
396 ============================================================
\r
397 Project Capabilities
\r
398 ============================================================
\r
401 <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(OutputType)' == 'Exe'">
\r
402 <ProjectCapability Include="CrossPlatformExecutable" />
\r
405 <!-- Reference Manager capabilities -->
\r
406 <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
\r
407 <ProjectCapability Remove="ReferenceManagerAssemblies" />
\r
408 <ProjectCapability Remove="ReferenceManagerCOM" />
\r
411 <!-- Publish capabilities -->
\r
413 <ProjectCapability Include="FolderPublish" />
\r
416 <Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.DisableStandardFrameworkResolution.targets" Condition="'$(DisableStandardFrameworkResolution)' == 'true'" />
\r
417 <Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.GenerateAssemblyInfo.targets" />
\r
418 <Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.ComposeCache.targets" />
\r
419 <Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.CrossGen.targets" />
\r
420 <Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.Publish.targets" />
\r
421 <Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.PreserveCompilationContext.targets" />
\r
422 <Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.Sdk.CSharp.targets" Condition="'$(Language)' == 'C#'" />
\r
423 <Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.Sdk.VisualBasic.targets" Condition="'$(Language)' == 'VB'" />
\r
426 ============================================================
\r
427 Temporary Workarounds
\r
428 ============================================================
\r
431 <!-- Override the ImplicitlyExpandDesignTimeFacades target with a fix for https://github.com/Microsoft/msbuild/issues/1345 until
\r
432 the issue is fixed in MSBuild -->
\r
434 <!-- Implicitly references all portable design-time facades if the user is referencing a System.Runtime-based portable library -->
\r
435 <Target Name="ImplicitlyExpandDesignTimeFacades" Condition="'$(ImplicitlyExpandDesignTimeFacades)' == 'true'" DependsOnTargets="$(ImplicitlyExpandDesignTimeFacadesDependsOn)">
\r
438 <!-- Does one of our dependencies reference a System.Runtime-based portable library? -->
\r
439 <_HasReferenceToSystemRuntime Condition="'$(DependsOnSystemRuntime)' == 'true' or '%(_ResolvedProjectReferencePaths.TargetPlatformIdentifier)' == 'Portable'">true</_HasReferenceToSystemRuntime>
\r
442 <ItemGroup Condition="'$(_HasReferenceToSystemRuntime)' == 'true'">
\r
443 <_DesignTimeFacadeAssemblies Include="%(DesignTimeFacadeDirectories.Identity)*.dll"/>
\r
445 <_DesignTimeFacadeAssemblies_Names Include="@(_DesignTimeFacadeAssemblies->'%(FileName)')">
\r
446 <OriginalIdentity>%(_DesignTimeFacadeAssemblies.Identity)</OriginalIdentity>
\r
447 </_DesignTimeFacadeAssemblies_Names>
\r
449 <_ReferencePath_Names Include="@(ReferencePath->'%(FileName)')">
\r
450 <OriginalIdentity>%(ReferencePath.Identity)</OriginalIdentity>
\r
451 </_ReferencePath_Names>
\r
453 <_DesignTimeFacadeAssemblies_Names Remove="@(_ReferencePath_Names)"/>
\r
455 <ReferencePath Include="@(_DesignTimeFacadeAssemblies_Names->'%(OriginalIdentity)')">
\r
456 <WinMDFile>false</WinMDFile>
\r
457 <CopyLocal>false</CopyLocal>
\r
458 <ResolvedFrom>ImplicitlyExpandDesignTimeFacades</ResolvedFrom>
\r
461 <_ResolveAssemblyReferenceResolvedFiles Include="@(ReferencePath)" Condition="'%(ReferencePath.ResolvedFrom)' == 'ImplicitlyExpandDesignTimeFacades'" />
\r
464 <Message Importance="Low" Text="Including @(ReferencePath)" Condition="'%(ReferencePath.ResolvedFrom)' == 'ImplicitlyExpandDesignTimeFacades'" />
\r