Advertisement
Guest User

Microsoft.Common.CurrentVersion.targets

a guest
Dec 18th, 2019
2,387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 315.63 KB | None | 0 0
  1. <!--
  2. ***********************************************************************************************
  3. Microsoft.Common.CurrentVersion.targets
  4.  
  5. WARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
  6.           created a backup copy.  Incorrect changes to this file will make it
  7.           impossible to load or build your projects from the command-line or the IDE.
  8.  
  9. This file defines the steps in the standard build process for .NET projects.  It
  10. contains all the steps that are common among the different .NET languages, such as
  11. Visual Basic, and Visual C#.
  12.  
  13. Copyright (C) Microsoft Corporation. All rights reserved.
  14. ***********************************************************************************************
  15. -->
  16.  
  17. <Project DefaultTargets="Build" TreatAsLocalProperty="OutDir" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  18.  
  19.   <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="'$(MicrosoftCommonPropsHasBeenImported)' != 'true' and Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  20.  
  21.   <PropertyGroup>
  22.     <ImportByWildcardBeforeMicrosoftCommonTargets Condition="'$(ImportByWildcardBeforeMicrosoftCommonTargets)' == ''">true</ImportByWildcardBeforeMicrosoftCommonTargets>
  23.     <ImportByWildcardAfterMicrosoftCommonTargets Condition="'$(ImportByWildcardAfterMicrosoftCommonTargets)' == ''">true</ImportByWildcardAfterMicrosoftCommonTargets>
  24.     <ImportUserLocationsByWildcardBeforeMicrosoftCommonTargets Condition="'$(ImportUserLocationsByWildcardBeforeMicrosoftCommonTargets)' == ''">true</ImportUserLocationsByWildcardBeforeMicrosoftCommonTargets>
  25.     <ImportUserLocationsByWildcardAfterMicrosoftCommonTargets Condition="'$(ImportUserLocationsByWildcardAfterMicrosoftCommonTargets)' == ''">true</ImportUserLocationsByWildcardAfterMicrosoftCommonTargets>
  26.   </PropertyGroup>
  27.  
  28.   <Import Project="$(MSBuildUserExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.targets\ImportBefore\*" Condition="'$(ImportUserLocationsByWildcardBeforeMicrosoftCommonTargets)' == 'true' and exists('$(MSBuildUserExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.targets\ImportBefore')"/>
  29.   <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.targets\ImportBefore\*" Condition="'$(ImportByWildcardBeforeMicrosoftCommonTargets)' == 'true' and exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.targets\ImportBefore')"/>
  30.  
  31.   <Import Project="$(MSBuildProjectFullPath).user" Condition="Exists('$(MSBuildProjectFullPath).user')"/>
  32.  
  33.  
  34.   <!-- VS10 without SP1 and without VS11 will not have VisualStudioVersion set, so do that here -->
  35.   <PropertyGroup>
  36.     <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
  37.   </PropertyGroup>
  38.  
  39.   <PropertyGroup>
  40.     <CustomBeforeMicrosoftCommonTargets Condition="'$(CustomBeforeMicrosoftCommonTargets)'==''">$(MSBuildExtensionsPath)\v$(MSBuildToolsVersion)\Custom.Before.Microsoft.Common.targets</CustomBeforeMicrosoftCommonTargets>
  41.     <CustomAfterMicrosoftCommonTargets Condition="'$(CustomAfterMicrosoftCommonTargets)'==''">$(MSBuildExtensionsPath)\v$(MSBuildToolsVersion)\Custom.After.Microsoft.Common.targets</CustomAfterMicrosoftCommonTargets>
  42.     <ReportingServicesTargets Condition="'$(ReportingServicesTargets)'==''">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\ReportingServices\Microsoft.ReportingServices.targets</ReportingServicesTargets>
  43.   </PropertyGroup>
  44.  
  45.   <Import Project="$(CustomBeforeMicrosoftCommonTargets)" Condition="'$(CustomBeforeMicrosoftCommonTargets)' != '' and Exists('$(CustomBeforeMicrosoftCommonTargets)')"/>
  46.  
  47.   <!-- By default, we are creating a managed app because .NET 2.0 projects did not have this property. -->
  48.   <PropertyGroup Condition="'$(TargetRuntime)' == ''">
  49.     <TargetRuntime>Managed</TargetRuntime>
  50.   </PropertyGroup>
  51.  
  52.   <!-- Because .NET 2.0 apps did not set TargetFrameworkIdentifier, we need to set it for them here by default.  If
  53.        the runtime is set to Managed, we also need to set these.  Otherwise they should be blank (for instance Javascript or
  54.        Native apps) because they do not target a .NET Framework. -->
  55.   <PropertyGroup Condition="'$(TargetRuntime)' == 'Managed'">
  56.     <TargetFrameworkIdentifier Condition="'$(TargetFrameworkIdentifier)' == ''">.NETFramework</TargetFrameworkIdentifier>
  57.     <TargetFrameworkVersion Condition=" '$(TargetFrameworkVersion)' == '' ">v4.0</TargetFrameworkVersion>
  58.   </PropertyGroup>
  59.  
  60.   <!-- AvailablePlatforms is the list of platform targets available. -->
  61.   <PropertyGroup>
  62.     <AvailablePlatforms Condition="'$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == ''">Any CPU,x86,x64,Itanium</AvailablePlatforms>
  63.     <AvailablePlatforms Condition="'$(VisualStudioVersion)' != '' and '$(VisualStudioVersion)' > '10.0'">Any CPU,x86,x64</AvailablePlatforms>
  64.   </PropertyGroup>
  65.  
  66.   <!-- Import does NOT apply to .NETCore -->
  67.   <Import Project="Microsoft.NETFramework.props" Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' or '$(TargetFrameworkIdentifier)' == 'Silverlight'"/>
  68.  
  69.   <PropertyGroup>
  70.     <!-- Yield optimization properties -->
  71.     <YieldDuringToolExecution Condition="'$(YieldDuringToolExecution)' == ''">true</YieldDuringToolExecution>
  72.   </PropertyGroup>
  73.  
  74.   <PropertyGroup Condition="'$(TargetFrameworkIdentifier)' != '' and '$(TargetFrameworkVersion)' != ''">
  75.     <TargetFrameworkMoniker Condition="'$(TargetFrameworkMoniker)' == '' and '$([System.String]::IsNullOrWhitespace($(TargetFrameworkProfile)))' != 'true'">$(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion),Profile=$(TargetFrameworkProfile)</TargetFrameworkMoniker>
  76.     <TargetFrameworkMoniker Condition="'$(TargetFrameworkMoniker)' == ''">$(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion)</TargetFrameworkMoniker>
  77.  
  78.     <!-- When working off a packaged reference assemblies, do not go to machine-global locations. This property is target-framework-specific, so it cannot be overridden in msbuild.exe.config once and for all. -->
  79.     <FrameworkPathOverride Condition="'$(EnableFrameworkPathOverride)' != 'false' And '$(FrameworkPathOverride)' == '' And Exists('$(TargetFrameworkRootPath)$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)')">$(TargetFrameworkRootPath)$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)</FrameworkPathOverride>
  80.     <!-- The FrameworkPathOverride is required for the inproc visual basic compiler to initialize when targeting target frameworks less than 4.0. If .net 2.0 is not installed then the property value above will not provide the location
  81.              of mscorlib. This is also true if the build author overrides this property to some other directory which does not contain mscorlib.dll. In the case we cannot find mscorlib.dll at the correct location
  82.              we need to find a directory which does contain mscorlib to allow the inproc compiler to initialize and give us the chance to show certain dialogs in the IDE (which only happen after initialization).-->
  83.     <FrameworkPathOverride Condition="'$(EnableFrameworkPathOverride)' != 'false' And '$(FrameworkPathOverride)' == ''">$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPathToStandardLibraries($(TargetFrameworkIdentifier), $(TargetFrameworkVersion), $(TargetFrameworkProfile), $(PlatformTarget), $(TargetFrameworkRootPath), $(TargetFrameworkFallbackSearchPaths)))</FrameworkPathOverride>
  84.     <FrameworkPathOverride Condition="'$(EnableFrameworkPathOverride)' != 'false' And !Exists('$(FrameworkPathOverride)\mscorlib.dll')">$(MSBuildFrameworkToolsPath)</FrameworkPathOverride>
  85.   </PropertyGroup>
  86.  
  87.   <PropertyGroup>
  88.     <TargetPlatformIdentifier Condition="'$(TargetPlatformIdentifier)' == ''">Windows</TargetPlatformIdentifier>
  89.     <TargetPlatformVersion Condition="'$(TargetPlatformVersion)' == ''">7.0</TargetPlatformVersion>
  90.     <TargetPlatformSdkPath Condition="'$(TargetPlatformSdkPath)' == '' and '$(TargetPlatformSdkRootOverride)' != ''">$(TargetPlatformSdkRootOverride)\</TargetPlatformSdkPath>
  91.     <TargetPlatformSdkPath Condition="'$(TargetPlatformSdkPath)' == '' and '$(TargetPlatformIdentifier)' == 'Windows' and '$(OS)' == 'Windows_NT' and '$(MSBuildRuntimeType)' != 'Core'">$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SDKs\Windows\v$(TargetPlatformVersion)', InstallationFolder, null, RegistryView.Registry32, RegistryView.Default))</TargetPlatformSdkPath>
  92.     <TargetPlatformSdkPath Condition="'$(TargetPlatformSdkPath)' == ''">$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformSDKLocation($(TargetPlatformIdentifier), $(TargetPlatformVersion)))</TargetPlatformSdkPath>
  93.     <TargetPlatformSdkMetadataLocation Condition="'$(TargetPlatformSdkMetadataLocation)' == '' and Exists('$(TargetPlatformSdkPath)')">$(TargetPlatformSdkPath)Windows Metadata</TargetPlatformSdkMetadataLocation>
  94.     <TargetPlatformSdkMetadataLocation Condition="Exists('$(TargetPlatformSdkPath)') and ('$(TargetPlatformSdkMetadataLocation)' == '' or !Exists('$(TargetPlatformSdkMetadataLocation)'))">$(TargetPlatformSdkPath)References\CommonConfiguration\Neutral</TargetPlatformSdkMetadataLocation>
  95.     <TargetPlatformWinMDLocation Condition="'$(TargetPlatformWinMDLocation)' == '' and Exists('$(TargetPlatformSdkMetadataLocation)')">$(TargetPlatformSdkMetadataLocation)</TargetPlatformWinMDLocation>
  96.     <UseOSWinMdReferences Condition="'$(UseOSWinMdReferences)' == '' and ('$(TargetPlatformWinMDLocation)' == '' and '$(TargetPlatformIdentifier)' == 'Windows' and '$(TargetPlatformVersion)' &gt; '7.0')">true</UseOSWinMdReferences>
  97.     <TargetPlatformWinMDLocation Condition="'$(UseOsWinMdReferences)' == 'true'">$(WinDir)\System32\WinMetadata</TargetPlatformWinMDLocation>
  98.     <TargetPlatformMoniker Condition="'$(TargetPlatformMoniker)' == ''">$(TargetPlatformIdentifier),Version=$(TargetPlatformVersion)</TargetPlatformMoniker>
  99.     <TargetPlatformDisplayName Condition="'$(TargetPlatformDisplayName)' == ''">$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformSDKDisplayName($(TargetPlatformIdentifier), $(TargetPlatformVersion)))</TargetPlatformDisplayName>
  100.   </PropertyGroup>
  101.  
  102.   <!--
  103.     Several properties must be set in the main project file, before using this .TARGETS file.
  104.     However, if the properties are not set, we pick some defaults.
  105.  
  106.     OutDir:
  107.     Indicates the final output location for the project or solution. When building a solution,
  108.     OutDir can be used to gather multiple project outputs in one location. In addition,
  109.     OutDir is included in AssemblySearchPaths used for resolving references.
  110.  
  111.     OutputPath:
  112.     This property is usually specified in the project file and is used to initialize OutDir.
  113.     OutDir and OutputPath are distinguished for legacy reasons, and OutDir should be used if at all possible.
  114.  
  115.     BaseIntermediateOutputPath:
  116.     This is the top level folder where all configuration specific intermediate output folders will be created.
  117.     Default value is obj\
  118.  
  119.     IntermediateOutputPath:
  120.     This is the full intermediate Output Path, and is derived from BaseIntermediateOutputPath, if none specified
  121.     (eg. obj\debug). If this property is overridden, then setting BaseIntermediateOutputPath has no effect.
  122.     -->
  123.  
  124.   <PropertyGroup>
  125.     <!-- Ensure any OutputPath has a trailing slash, so it can be concatenated -->
  126.     <OutputPath Condition="'$(OutputPath)' != '' and !HasTrailingSlash('$(OutputPath)')">$(OutputPath)\</OutputPath>
  127.     <AssemblyName Condition=" '$(AssemblyName)'=='' ">$(MSBuildProjectName)</AssemblyName>
  128.     <!--
  129.         Be careful not to give OutputPath a default value in the case of an invalid Configuration/Platform.
  130.         We use OutputPath specifically to check for invalid configurations/platforms.
  131.         -->
  132.     <OutputPath Condition=" '$(Platform)'=='' and '$(Configuration)'=='' and '$(OutputPath)'=='' ">bin\Debug\</OutputPath>
  133.     <_OriginalConfiguration>$(Configuration)</_OriginalConfiguration>
  134.     <_OriginalPlatform>$(Platform)</_OriginalPlatform>
  135.     <Configuration Condition=" '$(Configuration)'=='' ">Debug</Configuration>
  136.     <ConfigurationName Condition=" '$(ConfigurationName)' == '' ">$(Configuration)</ConfigurationName>
  137.     <!-- Example, Debug -->
  138.     <Platform Condition=" '$(Platform)'=='' ">AnyCPU</Platform>
  139.  
  140.     <OutputType Condition=" '$(TargetType)' != ''">$(TargetType)</OutputType>
  141.     <OutputType Condition=" '$(TargetType)' == 'Container' or '$(TargetType)' == 'DocumentContainer' ">library</OutputType>
  142.     <OutputType Condition=" '$(OutputType)' == '' ">exe</OutputType>
  143.  
  144.     <DebugSymbols Condition=" '$(ConfigurationName)' == 'Debug' and '$(DebugSymbols)' == '' and '$(DebugType)'==''">true</DebugSymbols>
  145.  
  146.     <!-- Whether or not a .pdb file is produced. -->
  147.     <_DebugSymbolsProduced>false</_DebugSymbolsProduced>
  148.     <_DebugSymbolsProduced Condition="'$(DebugSymbols)'=='true'">true</_DebugSymbolsProduced>
  149.     <_DebugSymbolsProduced Condition="'$(DebugType)'=='none'">false</_DebugSymbolsProduced>
  150.     <_DebugSymbolsProduced Condition="'$(DebugType)'=='pdbonly'">true</_DebugSymbolsProduced>
  151.     <_DebugSymbolsProduced Condition="'$(DebugType)'=='full'">true</_DebugSymbolsProduced>
  152.     <_DebugSymbolsProduced Condition="'$(DebugType)'=='portable'">true</_DebugSymbolsProduced>
  153.     <_DebugSymbolsProduced Condition="'$(DebugType)'=='embedded'">false</_DebugSymbolsProduced>
  154.  
  155.     <!-- Whether or not a .xml file is produced. -->
  156.     <_DocumentationFileProduced>true</_DocumentationFileProduced>
  157.     <_DocumentationFileProduced Condition="'$(DocumentationFile)'==''">false</_DocumentationFileProduced>
  158.  
  159.     <!-- Whether or not a reference assembly is produced. -->
  160.     <ProduceReferenceAssembly Condition="'$(ProduceReferenceAssembly)' == ''">false</ProduceReferenceAssembly>
  161.   </PropertyGroup>
  162.  
  163.   <PropertyGroup Condition=" '$(OutputPath)' == '' ">
  164.     <!--
  165.         A blank OutputPath at this point means that the user passed in an invalid Configuration/Platform
  166.         combination.  Whether this is considered an error or a warning depends on the value of
  167.         $(SkipInvalidConfigurations).
  168.         -->
  169.     <_InvalidConfigurationError Condition=" '$(SkipInvalidConfigurations)' != 'true' ">true</_InvalidConfigurationError>
  170.     <_InvalidConfigurationWarning Condition=" '$(SkipInvalidConfigurations)' == 'true' ">true</_InvalidConfigurationWarning>
  171.   </PropertyGroup>
  172.  
  173.   <!--
  174.     IDE Macros available from both integrated builds and from command line builds.
  175.     The following properties are 'macros' that are available via IDE for
  176.     pre and post build steps.
  177.     -->
  178.   <PropertyGroup>
  179.     <TargetExt Condition="'$(TargetExt)' == '' and '$(OutputType)'=='exe'">.exe</TargetExt>
  180.     <TargetExt Condition="'$(TargetExt)' == '' and '$(OutputType)'=='winexe'">.exe</TargetExt>
  181.     <TargetExt Condition="'$(TargetExt)' == '' and '$(OutputType)'=='appcontainerexe'">.exe</TargetExt>
  182.     <TargetExt Condition="'$(TargetExt)' == '' and '$(OutputType)'=='library'">.dll</TargetExt>
  183.     <TargetExt Condition="'$(TargetExt)' == '' and '$(OutputType)'=='module'">.netmodule</TargetExt>
  184.     <TargetExt Condition="'$(TargetExt)' == '' and '$(OutputType)'=='winmdobj'">.winmdobj</TargetExt>
  185.   </PropertyGroup>
  186.  
  187.   <PropertyGroup>
  188.  
  189.     <!-- Required for enabling Team Build for packaging app package-generating projects -->
  190.     <OutDirWasSpecified Condition=" '$(OutDir)'!='' and '$(OutDirWasSpecified)'=='' ">true</OutDirWasSpecified>
  191.  
  192.     <OutDir Condition=" '$(OutDir)' == '' ">$(OutputPath)</OutDir>
  193.     <!-- Example, bin\Debug\ -->
  194.     <!-- Ensure OutDir has a trailing slash, so it can be concatenated -->
  195.     <OutDir Condition="'$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)')">$(OutDir)\</OutDir>
  196.     <ProjectName Condition=" '$(ProjectName)' == '' ">$(MSBuildProjectName)</ProjectName>
  197.     <!-- Example, MyProject -->
  198.  
  199.     <!-- For projects that generate app packages or ones that want a per-project output directory, update OutDir to include the project name -->
  200.     <OutDir Condition="'$(OutDir)' != '' and '$(OutDirWasSpecified)' == 'true' and (('$(WindowsAppContainer)' == 'true' and '$(GenerateProjectSpecificOutputFolder)' != 'false') or '$(GenerateProjectSpecificOutputFolder)' == 'true')">$(OutDir)$(ProjectName)\</OutDir>
  201.  
  202.     <TargetName Condition="'$(TargetName)' == '' and '$(OutputType)' == 'winmdobj' and '$(RootNamespace)' != ''">$(RootNamespace)</TargetName>
  203.     <TargetName Condition=" '$(TargetName)' == '' ">$(AssemblyName)</TargetName>
  204.     <!-- Example, MyAssembly -->
  205.     <ProjectFileName Condition=" '$(ProjectFileName)' == '' ">$(MSBuildProjectFile)</ProjectFileName>
  206.     <!-- Example, MyProject.csproj -->
  207.     <ProjectExt Condition=" '$(ProjectExt)' == '' ">$(MSBuildProjectExtension)</ProjectExt>
  208.     <!-- Example, .csproj -->
  209.     <WinMDExpOutputWindowsMetadataFilename Condition="'$(WinMDExpOutputWindowsMetadataFilename)' == '' and '$(OutputType)' == 'winmdobj'">$(TargetName).winmd</WinMDExpOutputWindowsMetadataFilename>
  210.     <TargetFileName Condition=" '$(TargetFileName)' == '' and '$(OutputType)' == 'winmdobj'">$(WinMDExpOutputWindowsMetadataFilename)</TargetFileName>
  211.     <TargetFileName Condition=" '$(TargetFileName)' == '' ">$(TargetName)$(TargetExt)</TargetFileName>
  212.  
  213.     <!-- Example, MyAssembly.dll -->
  214.   </PropertyGroup>
  215.  
  216.   <PropertyGroup>
  217.     <!--
  218.         The PublishableProject property is used when invoking the publish target on a solution that
  219.         contains multiple projects. The property determines which projects should be published, and
  220.         which projects should be skipped in the publish target. By default any "Windows Application"
  221.         or "Console Application" project type is publishable. However, a project that would otherwise
  222.         be published can be skipped by defining the PublishableProject property in the project itself.
  223.         -->
  224.     <_DeploymentPublishableProjectDefault Condition="'$(OutputType)'=='winexe' or '$(OutputType)'=='exe' or '$(OutputType)'=='appcontainerexe'">true</_DeploymentPublishableProjectDefault>
  225.     <PublishableProject Condition="'$(PublishableProject)'==''">$(_DeploymentPublishableProjectDefault)</PublishableProject>
  226.  
  227.     <_DeploymentTargetApplicationManifestFileName Condition="'$(OutputType)'=='library'">Native.$(AssemblyName).manifest</_DeploymentTargetApplicationManifestFileName>
  228.     <!-- Example, Native.MyAssembly.manifest -->
  229.     <_DeploymentTargetApplicationManifestFileName Condition="'$(OutputType)'=='winexe'">$(TargetFileName).manifest</_DeploymentTargetApplicationManifestFileName>
  230.     <!-- Example, MyAssembly.exe.manifest -->
  231.     <_DeploymentTargetApplicationManifestFileName Condition="'$(OutputType)'=='exe'">$(TargetFileName).manifest</_DeploymentTargetApplicationManifestFileName>
  232.     <!-- Example, MyAssembly.exe.manifest -->
  233.     <_DeploymentTargetApplicationManifestFileName Condition="'$(OutputType)'=='appcontainerexe'">$(TargetFileName).manifest</_DeploymentTargetApplicationManifestFileName>
  234.     <!-- Example, MyAssembly.exe.manifest -->
  235.     <TargetDeployManifestFileName Condition="'$(TargetDeployManifestFileName)' == '' and '$(HostInBrowser)' != 'true'">$(AssemblyName).application</TargetDeployManifestFileName>
  236.     <!-- Example, MyAssembly.application -->
  237.     <TargetDeployManifestFileName Condition="'$(TargetDeployManifestFileName)' == '' and '$(HostInBrowser)' == 'true'">$(AssemblyName).xbap</TargetDeployManifestFileName>
  238.     <!-- Example, MyAssembly.xbap -->
  239.     <GenerateClickOnceManifests Condition="'$(OutputType)'=='winexe' or '$(OutputType)'=='exe' or '$(OutputType)'=='appcontainerexe'">$(GenerateManifests)</GenerateClickOnceManifests>
  240.  
  241.     <_DeploymentApplicationManifestIdentity Condition="'$(OutputType)'=='library'">Native.$(AssemblyName)</_DeploymentApplicationManifestIdentity>
  242.     <_DeploymentApplicationManifestIdentity Condition="'$(OutputType)'=='winexe'">$(AssemblyName).exe</_DeploymentApplicationManifestIdentity>
  243.     <_DeploymentApplicationManifestIdentity Condition="'$(OutputType)'=='exe'">$(AssemblyName).exe</_DeploymentApplicationManifestIdentity>
  244.     <_DeploymentApplicationManifestIdentity Condition="'$(OutputType)'=='appcontainerexe'">$(AssemblyName).exe</_DeploymentApplicationManifestIdentity>
  245.     <_DeploymentDeployManifestIdentity Condition="'$(HostInBrowser)' != 'true'">$(AssemblyName).application</_DeploymentDeployManifestIdentity>
  246.     <_DeploymentDeployManifestIdentity Condition="'$(HostInBrowser)' == 'true'">$(AssemblyName).xbap</_DeploymentDeployManifestIdentity>
  247.  
  248.     <_DeploymentFileMappingExtension Condition="'$(MapFileExtensions)'=='true'">.deploy</_DeploymentFileMappingExtension>
  249.     <_DeploymentFileMappingExtension Condition="'$(MapFileExtensions)'!='true'"></_DeploymentFileMappingExtension>
  250.  
  251.     <_DeploymentBuiltUpdateInterval Condition="'$(UpdatePeriodically)'=='true'">$(UpdateInterval)</_DeploymentBuiltUpdateInterval>
  252.     <_DeploymentBuiltUpdateIntervalUnits Condition="'$(UpdatePeriodically)'=='true'">$(UpdateIntervalUnits)</_DeploymentBuiltUpdateIntervalUnits>
  253.     <_DeploymentBuiltUpdateInterval Condition="'$(UpdatePeriodically)'!='true'">0</_DeploymentBuiltUpdateInterval>
  254.     <_DeploymentBuiltUpdateIntervalUnits Condition="'$(UpdatePeriodically)'!='true'">Days</_DeploymentBuiltUpdateIntervalUnits>
  255.     <_DeploymentBuiltMinimumRequiredVersion Condition="'$(UpdateRequired)'=='true' and '$(Install)'=='true'">$(MinimumRequiredVersion)</_DeploymentBuiltMinimumRequiredVersion>
  256.  
  257.     <MaxTargetPath Condition="'$(MaxTargetPath)'==''">100</MaxTargetPath>
  258.   </PropertyGroup>
  259.  
  260.   <PropertyGroup>
  261.     <!--
  262.         By default, GenerateApplicationManifest puts all satellite assemblies to the manifest
  263.         record by default by setting TargetCulture to *.
  264.         -->
  265.     <TargetCulture Condition="'$(TargetCulture)'==''">*</TargetCulture>
  266.     <FallbackCulture Condition="'$(UICulture)'!='' and '$(FallbackCulture)'==''">$(UICulture)</FallbackCulture>
  267.   </PropertyGroup>
  268.  
  269.   <ItemGroup>
  270.     <!-- Not used any more-->
  271.     <_OutputPathItem Include="$(OutDir)"/>
  272.  
  273.     <_UnmanagedRegistrationCache Include="$(BaseIntermediateOutputPath)$(MSBuildProjectFile).UnmanagedRegistration.cache"/>
  274.     <_ResolveComReferenceCache Include="$(IntermediateOutputPath)$(MSBuildProjectFile).ResolveComReference.cache"/>
  275.   </ItemGroup>
  276.  
  277.   <PropertyGroup>
  278.     <!-- Example, c:\MyProjects\MyProject\bin\debug\ -->
  279.     <!--
  280.         Condition intentionally omitted on this one, because it causes problems
  281.         when we pick up the value of an environment variable named TargetDir
  282.         -->
  283.     <TargetDir Condition="'$(OutDir)' != ''">$([MSBuild]::Escape($([System.IO.Path]::GetFullPath(`$([System.IO.Path]::Combine(`$(MSBuildProjectDirectory)`, `$(OutDir)`))`))))</TargetDir>
  284.  
  285.     <!-- Example, c:\MyProjects\MyProject\bin\debug\MyAssembly.dll -->
  286.     <TargetPath Condition=" '$(TargetPath)' == '' ">$(TargetDir)$(TargetFileName)</TargetPath>
  287.  
  288.     <TargetRefPath Condition=" '$(TargetRefPath)' == '' and '$(ProduceReferenceAssembly)' == 'true' ">$([MSBuild]::NormalizePath($(TargetDir), 'ref', $(TargetFileName)))</TargetRefPath>
  289.  
  290.     <!-- Example, c:\MyProjects\MyProject\ -->
  291.     <ProjectDir Condition=" '$(ProjectDir)' == '' ">$(MSBuildProjectDirectory)\</ProjectDir>
  292.  
  293.     <!-- Example, c:\MyProjects\MyProject\MyProject.csproj -->
  294.     <ProjectPath Condition=" '$(ProjectPath)' == '' ">$(ProjectDir)$(ProjectFileName)</ProjectPath>
  295.  
  296.     <!-- Example, AnyCPU -->
  297.     <PlatformName Condition=" '$(PlatformName)' == '' ">$(Platform)</PlatformName>
  298.   </PropertyGroup>
  299.  
  300.   <ItemGroup>
  301.     <!-- This is not used here but remains for backwards compatibility -->
  302.     <AppConfigFileDestination Include="$(OutDir)$(TargetFileName).config"/>
  303.   </ItemGroup>
  304.  
  305.   <!--
  306.     IDE Macros available only from integrated builds.
  307.     The following properties are 'macros' that are available via IDE for
  308.     pre and post build steps. However, they are not defined when directly building
  309.     a project from the command line, only when building a solution.
  310.     -->
  311.   <PropertyGroup>
  312.     <DevEnvDir Condition="'$(DevEnvDir)'==''">*Undefined*</DevEnvDir>
  313.     <SolutionName Condition="'$(SolutionName)'==''">*Undefined*</SolutionName>
  314.     <!-- Example, MySolution -->
  315.     <SolutionFileName Condition="'$(SolutionFileName)'==''">*Undefined*</SolutionFileName>
  316.     <!-- Example, MySolution.sln -->
  317.     <SolutionPath Condition="'$(SolutionPath)'==''">*Undefined*</SolutionPath>
  318.     <!-- Example, f:\MySolutions\MySolution\MySolution.sln -->
  319.     <SolutionDir Condition="'$(SolutionDir)'==''">*Undefined*</SolutionDir>
  320.     <!-- Example, f:\MySolutions\MySolution\ -->
  321.     <SolutionExt Condition="'$(SolutionExt)'==''">*Undefined*</SolutionExt>
  322.     <!-- Example, .sln -->
  323.   </PropertyGroup>
  324.  
  325.   <PropertyGroup>
  326.     <GenerateBindingRedirectsOutputType Condition="'$(OutputType)'=='exe' or '$(OutputType)'=='winexe'">true</GenerateBindingRedirectsOutputType>
  327.     <!-- It would be a breaking change to automatically turn on binding redirects for existing projects, so turn them on only when opting into a new framework. -->
  328.     <AutoGenerateBindingRedirects Condition="'$(AutoGenerateBindingRedirects)' == '' and '$(TargetFrameworkIdentifier)' == '.NETFramework' and '$(TargetFrameworkVersion.TrimStart(vV))' >= '4.7.2'">true</AutoGenerateBindingRedirects>
  329.   </PropertyGroup>
  330.   <PropertyGroup Condition="'$(AutoUnifyAssemblyReferences)' == ''">
  331.     <AutoUnifyAssemblyReferences>true</AutoUnifyAssemblyReferences>
  332.     <AutoUnifyAssemblyReferences Condition="'$(GenerateBindingRedirectsOutputType)' == 'true' and '$(AutoGenerateBindingRedirects)' != 'true'">false</AutoUnifyAssemblyReferences>
  333.   </PropertyGroup>
  334.   <PropertyGroup>
  335.     <BaseIntermediateOutputPath Condition="!HasTrailingSlash('$(BaseIntermediateOutputPath)')">$(BaseIntermediateOutputPath)\</BaseIntermediateOutputPath>
  336.     <CleanFile Condition="'$(CleanFile)'==''">$(MSBuildProjectFile).FileListAbsolute.txt</CleanFile>
  337.     <!-- During DesignTime Builds, skip project reference build as Design time is only queueing information.-->
  338.     <BuildProjectReferences Condition="'$(BuildProjectReferences)' == '' and '$(DesignTimeBuild)' == 'true'">false</BuildProjectReferences>
  339.     <!-- By default we will build (and if applicable, clean) all project references. But this can be used to disable that-->
  340.     <BuildProjectReferences Condition="'$(BuildProjectReferences)' == ''">true</BuildProjectReferences>
  341.     <BuildInParallel Condition="'$(BuildInParallel)' == ''">true</BuildInParallel>
  342.     <_ResolveReferenceDependencies Condition="'$(_ResolveReferenceDependencies)' == ''">false</_ResolveReferenceDependencies>
  343.     <_GetChildProjectCopyToOutputDirectoryItems Condition="'$(_GetChildProjectCopyToOutputDirectoryItems)' == ''">true</_GetChildProjectCopyToOutputDirectoryItems>
  344.     <OverwriteReadOnlyFiles Condition="'$(OverwriteReadOnlyFiles)' == ''">false</OverwriteReadOnlyFiles>
  345.     <ComReferenceNoClassMembers Condition="'$(ComReferenceNoClassMembers)' == ''">false</ComReferenceNoClassMembers>
  346.   </PropertyGroup>
  347.  
  348.   <PropertyGroup Condition=" $(IntermediateOutputPath) == '' ">
  349.     <IntermediateOutputPath Condition=" '$(PlatformName)' == 'AnyCPU' ">$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath>
  350.     <IntermediateOutputPath Condition=" '$(PlatformName)' != 'AnyCPU' ">$(BaseIntermediateOutputPath)$(PlatformName)\$(Configuration)\</IntermediateOutputPath>
  351.   </PropertyGroup>
  352.   <PropertyGroup>
  353.     <IntermediateOutputPath Condition="!HasTrailingSlash('$(IntermediateOutputPath)')">$(IntermediateOutputPath)\</IntermediateOutputPath>
  354.     <_GenerateBindingRedirectsIntermediateAppConfig>$(IntermediateOutputPath)$(TargetFileName).config</_GenerateBindingRedirectsIntermediateAppConfig>
  355.   </PropertyGroup>
  356.   <ItemGroup>
  357.     <IntermediateAssembly Include="$(IntermediateOutputPath)$(TargetName)$(TargetExt)"/>
  358.     <FinalDocFile Include="@(DocFileItem->'$(OutDir)%(Filename)%(Extension)')"/>
  359.     <CopyUpToDateMarker Include="$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '$(IntermediateOutputPath)', '$(MSBuildProjectFile).CopyComplete'))" />
  360.   </ItemGroup>
  361.  
  362.   <ItemGroup Condition="'$(ProduceReferenceAssembly)' == 'true'">
  363.     <IntermediateRefAssembly Include="$(IntermediateOutputPath)ref\$(TargetName)$(TargetExt)" Condition="'@(IntermediateRefAssembly)' == ''" />
  364.     <CreateDirectory Include="@(IntermediateRefAssembly->'%(RootDir)%(Directory)')" />
  365.     <CreateDirectory Include="$(OutDir)ref" />
  366.   </ItemGroup>
  367.  
  368.   <ItemGroup Condition="'$(_DebugSymbolsProduced)' == 'true'">
  369.     <_DebugSymbolsIntermediatePath Include="$(IntermediateOutputPath)$(TargetName).compile.pdb" Condition="'$(OutputType)' == 'winmdobj' and '@(_DebugSymbolsIntermediatePath)' == ''"/>
  370.     <_DebugSymbolsIntermediatePath Include="$(IntermediateOutputPath)$(TargetName).pdb" Condition="'$(OutputType)' != 'winmdobj' and '@(_DebugSymbolsIntermediatePath)' == ''"/>
  371.     <_DebugSymbolsOutputPath Include="@(_DebugSymbolsIntermediatePath->'$(OutDir)%(Filename)%(Extension)')" />
  372.   </ItemGroup>
  373.  
  374.   <PropertyGroup Condition="'$(_DebugSymbolsProduced)' == 'true' and '$(OutputType)' == 'winmdobj'">
  375.     <WinMDExpOutputPdb Condition="'$(WinMDExpOutputPdb)' == ''">$(IntermediateOutputPath)$(TargetName).pdb</WinMDExpOutputPdb>
  376.     <_WinMDDebugSymbolsOutputPath>$([System.IO.Path]::Combine('$(OutDir)', $([System.IO.Path]::GetFileName('$(WinMDExpOutputPdb)'))))</_WinMDDebugSymbolsOutputPath>
  377.   </PropertyGroup>
  378.  
  379.   <PropertyGroup Condition="'$(OutputType)' == 'winmdobj' and '$(DocumentationFile)'!=''">
  380.     <WinMDOutputDocumentationFile Condition="'$(WinMDOutputDocumentationFile)' == ''">$(IntermediateOutputPath)$(TargetName).xml</WinMDOutputDocumentationFile>
  381.     <_WinMDDocFileOutputPath>$([System.IO.Path]::Combine('$(OutDir)', $([System.IO.Path]::GetFileName('$(WinMDOutputDocumentationFile)'))))</_WinMDDocFileOutputPath>
  382.   </PropertyGroup>
  383.  
  384.   <PropertyGroup Condition="'$(WinMDExpOutputWindowsMetadataFilename)' != ''">
  385.     <_IntermediateWindowsMetadataPath>$(IntermediateOutputPath)$(WinMDExpOutputWindowsMetadataFilename)</_IntermediateWindowsMetadataPath>
  386.     <_WindowsMetadataOutputPath>$(OutDir)$(WinMDExpOutputWindowsMetadataFilename)</_WindowsMetadataOutputPath>
  387.   </PropertyGroup>
  388.  
  389.   <ItemGroup>
  390.     <!-- Create an item for entry point of the ClickOnce application (Example: WindowsApplication1.exe) -->
  391.     <_DeploymentManifestEntryPoint Include="@(IntermediateAssembly)">
  392.       <TargetPath>$(TargetFileName)</TargetPath>
  393.     </_DeploymentManifestEntryPoint>
  394.  
  395.     <!-- Create an item for the application icon if one exists in the project (Example: app.ico) -->
  396.     <!-- NOTE: The item Include and the Exists function are operating relative to the PROJECT (.csproj, .vbproj etc.) directory in this case -->
  397.     <_DeploymentManifestIconFile Include="$(ApplicationIcon)" Condition="Exists('$(ApplicationIcon)')">
  398.       <TargetPath>$(ApplicationIcon)</TargetPath>
  399.     </_DeploymentManifestIconFile>
  400.  
  401.     <!-- Create an item for the output application manifest (Example: WindowsApplication1.exe.manifeset) -->
  402.     <ApplicationManifest Include="$(IntermediateOutputPath)$(_DeploymentTargetApplicationManifestFileName)">
  403.       <TargetPath>$(_DeploymentTargetApplicationManifestFileName)</TargetPath>
  404.     </ApplicationManifest>
  405.  
  406.     <!-- Create an item for the final application manifest (Example: WindowsApplication1.exe.manifeset)
  407.              This item represents the final output application manifest used for project-to-project
  408.              references and for copying to the publish output location. -->
  409.     <_ApplicationManifestFinal Include="$(OutDir)$(_DeploymentTargetApplicationManifestFileName)">
  410.       <TargetPath>$(_DeploymentTargetApplicationManifestFileName)</TargetPath>
  411.     </_ApplicationManifestFinal>
  412.  
  413.     <!-- Create an item for the output deploy manifest (Example: WindowsApplication1.application) -->
  414.     <DeployManifest Include="$(IntermediateOutputPath)$(TargetDeployManifestFileName)">
  415.       <TargetPath>$(TargetDeployManifestFileName)</TargetPath>
  416.     </DeployManifest>
  417.  
  418.     <!-- Create an item for the intermediate trust info file -->
  419.     <_DeploymentIntermediateTrustInfoFile Include="$(IntermediateOutputPath)$(TargetName).TrustInfo.xml" Condition="'$(TargetZone)'!=''"/>
  420.   </ItemGroup>
  421.  
  422.   <!--
  423.     Determine the <deploymentProvider> (_DeploymentUrl) for the ClickOnce deployment manifest.
  424.     Prefer the UpdateUrl, falling back to InstallUrl or PublishUrl if not specified.
  425.     If the UpdateUrl is specified then _DeploymentUrl is always set to the UpdateUrl.
  426.     Otherwise, only set the _DeploymentUrl if it's an installed app and updates are enabled.
  427.    -->
  428.  <PropertyGroup>
  429.    <_DeploymentUrl Condition="'$(_DeploymentUrl)'==''">$(UpdateUrl)</_DeploymentUrl>
  430.    <_DeploymentUrl Condition="'$(_DeploymentUrl)'==''">$(InstallUrl)</_DeploymentUrl>
  431.    <_DeploymentUrl Condition="'$(_DeploymentUrl)'==''">$(PublishUrl)</_DeploymentUrl>
  432.    <_DeploymentUrl Condition="!('$(UpdateUrl)'=='') and '$(Install)'=='false'"></_DeploymentUrl>
  433.    <_DeploymentUrl Condition="'$(_DeploymentUrl)'!=''">$(_DeploymentUrl)$(TargetDeployManifestFileName)</_DeploymentUrl>
  434.    <!--
  435.        Need to explicitly blank out the _DeploymentUrl when it's not used. Otherwise an
  436.         inappropriate value may be used. For example a local path from the PublishUrl
  437.         is something we never want to see in the manifest because it means you could
  438.         only install the app from that machine.
  439.         -->
  440.     <_DeploymentUrl Condition="'$(UpdateUrl)'=='' and !('$(Install)'=='true' and '$(UpdateEnabled)'=='true')"></_DeploymentUrl>
  441.     <_DeploymentUrl Condition="'$(ExcludeDeploymentUrl)'=='true'"></_DeploymentUrl>
  442.   </PropertyGroup>
  443.  
  444.   <!-- Determine the URLs for the bootstrapper. -->
  445.   <PropertyGroup>
  446.     <_DeploymentApplicationUrl Condition="'$(IsWebBootstrapper)'=='true'">$(InstallUrl)</_DeploymentApplicationUrl>
  447.     <_DeploymentApplicationUrl Condition="'$(IsWebBootstrapper)'=='true' and '$(InstallUrl)'==''">$(PublishUrl)</_DeploymentApplicationUrl>
  448.     <_DeploymentComponentsUrl Condition="'$(BootstrapperComponentsLocation)'=='Absolute'">$(BootstrapperComponentsUrl)</_DeploymentComponentsUrl>
  449.   </PropertyGroup>
  450.  
  451.   <!-- Output location for publish target. -->
  452.   <PropertyGroup>
  453.     <PublishDir Condition="'$(PublishDir)' != '' and !HasTrailingSlash('$(PublishDir)')">$(PublishDir)\</PublishDir>
  454.     <PublishDir Condition="'$(PublishDir)'==''">$(OutputPath)app.publish\</PublishDir>
  455.   </PropertyGroup>
  456.  
  457.   <!--
  458.     ProcessorArchitecture is the target processor architecture.
  459.     -->
  460.   <PropertyGroup Condition="'$(ProcessorArchitecture)'==''">
  461.     <!--
  462.         If ProcessorArchitecture is not set, set it to PlatformTarget
  463.         Note: if $(PlatformTarget) is also blank resolve assembly reference defaults to msil which is the
  464.         desired behavior in this case
  465.         -->
  466.     <ProcessorArchitecture>$(PlatformTarget)</ProcessorArchitecture>
  467.  
  468.     <!--
  469.         If Processor architecture is not set and PlatformTarget is a known target translate the
  470.         PlatformTarget into something ResolveAssemblyReference knows about
  471.         -->
  472.     <ProcessorArchitecture Condition=" '$(PlatformTarget)' == 'AnyCpu' ">msil</ProcessorArchitecture>
  473.     <ProcessorArchitecture Condition=" '$(PlatformTarget)' == 'x64' ">amd64</ProcessorArchitecture>
  474.     <ProcessorArchitecture Condition=" '$(PlatformTarget)' == 'Itanium' ">ia64</ProcessorArchitecture>
  475.     <ProcessorArchitecture Condition=" '$(PlatformTarget)' == 'x86' ">x86</ProcessorArchitecture>
  476.     <ProcessorArchitecture Condition=" '$(PlatformTarget)' == 'ARM' ">arm</ProcessorArchitecture>
  477.   </PropertyGroup>
  478.  
  479.  <PropertyGroup>
  480.     <ConsiderPlatformAsProcessorArchitecture Condition="'$(ConsiderPlatformAsProcessorArchitecture)' == ''">true</ConsiderPlatformAsProcessorArchitecture>
  481.  </PropertyGroup>
  482.  
  483.  <PropertyGroup Condition="'$(ProcessorArchitecture)' == '' and '$(ConsiderPlatformAsProcessorArchitecture)' == 'true'">
  484.     <!-- We need to do this here because if we were to just compare against platform visual would parse them out as available platforms which may not be the case -->
  485.     <ProcessorArchitectureAsPlatform>$(Platform)</ProcessorArchitectureAsPlatform>
  486.     <ProcessorArchitecture Condition=" '$(ProcessorArchitectureAsPlatform)' == 'AnyCpu' or '$(ProcessorArchitectureAsPlatform)' == 'Any Cpu'">msil</ProcessorArchitecture>
  487.     <ProcessorArchitecture Condition=" '$(ProcessorArchitectureAsPlatform)' == 'x64' or '$(ProcessorArchitectureAsPlatform)' == 'amd64'">amd64</ProcessorArchitecture>
  488.     <ProcessorArchitecture Condition=" '$(ProcessorArchitectureAsPlatform)' == 'Itanium' ">ia64</ProcessorArchitecture>
  489.     <ProcessorArchitecture Condition=" '$(ProcessorArchitectureAsPlatform)' == 'x86' or '$(ProcessorArchitectureAsPlatform)' == 'win32'">x86</ProcessorArchitecture>
  490.     <ProcessorArchitecture Condition=" '$(ProcessorArchitectureAsPlatform)' == 'ARM' ">arm</ProcessorArchitecture>
  491.  
  492.     <!--For compatibility with the 4.0 behavior, if not set above, default to the environment. To override this, set ProcessorArchitecture explicitly. We also need to disable the warning since we do not know if what the environment is set to is correct-->
  493.     <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch Condition="'$(ProcessorArchitecture)'==''">None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
  494.     <ProcessorArchitecture Condition="'$(ProcessorArchitecture)'==''">$(PROCESSOR_ARCHITECTURE)</ProcessorArchitecture>
  495.   </PropertyGroup>
  496.  
  497.  
  498.   <!-- Sensible defaults for the most-commonly-desired MSBuildRuntime and MSBuildArchitecture values -->
  499.   <PropertyGroup Condition="'$(DisableOutOfProcTaskHost)' == ''">
  500.     <TargetFrameworkAsMSBuildRuntime Condition="'$(TargetFrameworkVersion)' == 'v2.0' or '$(TargetFrameworkVersion)' == 'v3.0' or '$(TargetFrameworkVersion)' == 'v3.5'">CLR2</TargetFrameworkAsMSBuildRuntime>
  501.     <TargetFrameworkAsMSBuildRuntime Condition="'$(TargetFrameworkVersion)' == 'v4.0' or '$(TargetFrameworkVersion)' == 'v4.5'">CLR4</TargetFrameworkAsMSBuildRuntime>
  502.     <TargetFrameworkAsMSBuildRuntime Condition="'$(TargetFrameworkAsMSBuildRuntime)' == ''">CurrentRuntime</TargetFrameworkAsMSBuildRuntime>
  503.  
  504.     <PlatformTargetAsMSBuildArchitectureExplicitlySet Condition="'$(PlatformTargetAsMSBuildArchitecture)' != ''">true</PlatformTargetAsMSBuildArchitectureExplicitlySet>
  505.     <PlatformTargetAsMSBuildArchitectureExplicitlySet Condition="'$(PlatformTargetAsMSBuildArchitecture)' == ''">false</PlatformTargetAsMSBuildArchitectureExplicitlySet>
  506.  
  507.     <PlatformTargetAsMSBuildArchitecture Condition="'$(PlatformTarget)' == 'x86' or ('$(PlatformTarget)' == 'x64' and '$(MSBuildExtensionsPath64)' != '')">$(PlatformTarget)</PlatformTargetAsMSBuildArchitecture>
  508.     <PlatformTargetAsMSBuildArchitecture Condition="'$(PlatformTarget)' == 'arm'">x86</PlatformTargetAsMSBuildArchitecture>
  509.     <PlatformTargetAsMSBuildArchitecture Condition="('$(PlatformTarget)' == 'ia64' and '$(MSBuildExtensionsPath64)' != '')">x64</PlatformTargetAsMSBuildArchitecture>
  510.     <PlatformTargetAsMSBuildArchitecture Condition="'$(PlatformTargetAsMSBuildArchitecture)' == ''">CurrentArchitecture</PlatformTargetAsMSBuildArchitecture>
  511.   </PropertyGroup>
  512.  
  513.   <!-- Flavor is the project flavor. For example, Client, Smart Devices, SQL Server, etc. -->
  514.   <PropertyGroup>
  515.     <ProjectFlavor Condition="'$(ProjectFlavor)'==''">Client</ProjectFlavor>
  516.   </PropertyGroup>
  517.  
  518.   <!--
  519.     The default for compilers is to not delay-sign. If $(DelaySign) is false, let the compiler
  520.     use its default rather than forcing a no-delay-sign flag to be passed in. This is so that
  521.     attributes in the source code can override this decision.
  522.     -->
  523.   <PropertyGroup>
  524.     <DelaySign Condition="'$(SignAssembly)' != 'true'">false</DelaySign>
  525.     <DelaySign Condition="'$(DelaySign)'!='true'"></DelaySign>
  526.   </PropertyGroup>
  527.  
  528.   <!-- These properties control web reference proxy generation. -->
  529.   <PropertyGroup>
  530.     <WebReference_EnableProperties Condition=" '$(WebReference_EnableProperties)' == '' ">true</WebReference_EnableProperties>
  531.     <WebReference_EnableSQLTypes Condition=" '$(WebReference_EnableSQLTypes)' == '' ">true</WebReference_EnableSQLTypes>
  532.     <WebReference_EnableLegacyEventingModel Condition=" '$(WebReference_EnableLegacyEventingModel)' == '' ">false</WebReference_EnableLegacyEventingModel>
  533.   </PropertyGroup>
  534.  
  535.   <!--
  536.     These parameters control where to look in the registry for directories to search for
  537.     assemblies in the assembly resolution tasks.
  538.     -->
  539.   <PropertyGroup>
  540.     <AssemblyFoldersSuffix Condition=" '$(AssemblyFoldersSuffix)' == '' ">AssemblyFoldersEx</AssemblyFoldersSuffix>
  541.     <FrameworkRegistryBase Condition=" '$(FrameworkRegistryBase)' == '' ">Software\Microsoft\$(TargetFrameworkIdentifier)</FrameworkRegistryBase>
  542.     <TargetPlatformRegistryBase Condition="'$(TargetPlatformRegistryBase)' == ''">Software\Microsoft\Microsoft SDKs\$(TargetPlatformIdentifier)</TargetPlatformRegistryBase>
  543.     <AssemblyFoldersConfigFile Condition="'$(AssemblyFoldersConfigFile)' == ''">$(MSBuildToolsPath32)\AssemblyFolders.config</AssemblyFoldersConfigFile>
  544.     <AssemblyFoldersConfigFileSearchPath Condition="Exists('$(AssemblyFoldersConfigFile)')">{AssemblyFoldersFromConfig:$(AssemblyFoldersConfigFile),$(TargetFrameworkVersion)};</AssemblyFoldersConfigFileSearchPath>
  545.     <!--
  546.         The SearchPaths property is set to find assemblies in the following order:
  547.  
  548.             (1) Files from current project - indicated by {CandidateAssemblyFiles}
  549.             (2) $(ReferencePath) - the reference path property, which comes from the .USER file.
  550.             (3) The hintpath from the referenced item itself, indicated by {HintPathFromItem}.
  551.             (4) The directory of MSBuild's "target" runtime from GetFrameworkPath.
  552.                The "target" runtime folder is the folder of the runtime that MSBuild is a part of.
  553.            (5) Registered assembly folders, indicated by {Registry:*,*,*}
  554.            (6) Assembly folders from AssemblyFolders.config file (provided by Visual Studio Dev15+).
  555.            (7) Legacy registered assembly folders, indicated by {AssemblyFolders}
  556.            (8) Resolve to the GAC.
  557.            (9) Treat the reference's Include as if it were a real file name.
  558.             (10) Look in the application's output folder (like bin\debug)
  559.        -->
  560.    <AssemblySearchPaths Condition=" '$(AssemblySearchPaths)' == ''">
  561.      {CandidateAssemblyFiles};
  562.      $(ReferencePath);
  563.      {HintPathFromItem};
  564.      {TargetFrameworkDirectory};
  565.      $(AssemblyFoldersConfigFileSearchPath)
  566.      {Registry:$(FrameworkRegistryBase),$(TargetFrameworkVersion),$(AssemblyFoldersSuffix)$(AssemblyFoldersExConditions)};
  567.      {AssemblyFolders};
  568.      {GAC};
  569.      {RawFileName};
  570.      $(OutDir)
  571.    </AssemblySearchPaths>
  572.  
  573.    <!--
  574.        These are the extensions that assembly reference resolution will consider for resolution.
  575.        Add new extensions here if you want to add new file types to consider (for example, .metadata_dll).
  576.        Put the most likely extensions first for reference resolution speed.
  577.        -->
  578.    <AllowedReferenceAssemblyFileExtensions Condition=" '$(AllowedReferenceAssemblyFileExtensions)' == '' ">
  579.      .winmd;
  580.      .dll;
  581.      .exe
  582.    </AllowedReferenceAssemblyFileExtensions>
  583.  
  584.    <!--
  585.        These are the extensions that reference resolution will consider when looking for files related
  586.        to resolved references.  Add new extensions here if you want to add new file types to consider.
  587.        -->
  588.    <AllowedReferenceRelatedFileExtensions Condition=" '$(AllowedReferenceRelatedFileExtensions)' == '' ">
  589.      .pdb;
  590.      .xml;
  591.      .pri;
  592.      .dll.config;
  593.      .exe.config
  594.    </AllowedReferenceRelatedFileExtensions>
  595.  
  596.    <!--
  597.        These names are used when determining which TargetFramework subset to use. If the any of the FullReferenceAssemblyNames
  598.        are seen in the list of client subsets, RAR will assume that no client subset is being used. The list is semicolon seperated
  599.        For example :   Full;Complete;AllThere
  600.        -->
  601.    <FullReferenceAssemblyNames Condition="'$(FullReferenceAssemblyNames)' == ''">Full</FullReferenceAssemblyNames>
  602.  </PropertyGroup>
  603.  
  604.  <!-- ContinueOnError takes 3 values:  WarnAndContinue (true), ErrorAndStop (false), and ErrorAndContinue.
  605.         Default to ErrorAndStop, since that matches the behaviour in previous versions, and what users
  606.         typically expect -->
  607.  <PropertyGroup>
  608.    <ContinueOnError Condition="'$(ContinueOnError)' == ''">false</ContinueOnError>
  609.  </PropertyGroup>
  610.  
  611.  <!-- Common Project System support -->
  612.  <PropertyGroup>
  613.    <CommonXamlResourcesDirectory Condition=" '$(CommonXamlResourcesDirectory)' == '' ">$(MSBuildThisFileDirectory)$(LangName)\</CommonXamlResourcesDirectory>
  614.  </PropertyGroup>
  615.  
  616.  <!-- We need to fallback to en-US in case the xaml rules are not localized (possibly happen on community languages).  -->
  617.  <PropertyGroup Condition="!Exists('$(CommonXamlResourcesDirectory)')">
  618.    <CommonXamlResourcesDirectory>$(MSBuildThisFileDirectory)en-US\</CommonXamlResourcesDirectory>
  619.  </PropertyGroup>
  620.  
  621.  <ItemGroup Condition=" '$(DefineCommonItemSchemas)' == 'true' ">
  622.    <PropertyPageSchema Include="$(CommonXamlResourcesDirectory)ProjectItemsSchema.xaml"/>
  623.  
  624.    <PropertyPageSchema Include="
  625.                        $(CommonXamlResourcesDirectory)General.xaml;
  626.                        $(CommonXamlResourcesDirectory)Debugger_General.xaml">
  627.      <Context>Project</Context>
  628.    </PropertyPageSchema>
  629.  
  630.    <PropertyPageSchema Include="$(CommonXamlResourcesDirectory)General.BrowseObject.xaml">
  631.      <Context>BrowseObject</Context>
  632.    </PropertyPageSchema>
  633.  
  634.    <PropertyPageSchema Include="$(CommonXamlResourcesDirectory)General_File.xaml">
  635.      <Context>File</Context>
  636.    </PropertyPageSchema>
  637.  
  638.    <PropertyPageSchema Include="$(CommonXamlResourcesDirectory)SCC.xaml">
  639.      <Context>Invisible</Context>
  640.    </PropertyPageSchema>
  641.  
  642.    <PropertyPageSchema Include="
  643.                        $(CommonXamlResourcesDirectory)Folder.xaml;
  644.                        $(CommonXamlResourcesDirectory)None.xaml;
  645.                        $(CommonXamlResourcesDirectory)Content.xaml;
  646.                        $(CommonXamlResourcesDirectory)EmbeddedResource.xaml;
  647.                        ">
  648.      <Context>File;BrowseObject</Context>
  649.    </PropertyPageSchema>
  650.  
  651.    <PropertyPageSchema Include="$(CommonXamlResourcesDirectory)SpecialFolder.xaml;">
  652.      <Context>File;ProjectSubscriptionService</Context>
  653.    </PropertyPageSchema>
  654.  </ItemGroup>
  655.  
  656.  <PropertyGroup>
  657.    <DefineCommonReferenceSchemas Condition=" '$(DefineCommonReferenceSchemas)' == '' ">$(DefineCommonItemSchemas)</DefineCommonReferenceSchemas>
  658.  </PropertyGroup>
  659.  
  660.  <ItemGroup Condition=" '$(DefineCommonReferenceSchemas)' == 'true' ">
  661.    <!-- Assembly references -->
  662.    <PropertyPageSchema Include="$(CommonXamlResourcesDirectory)assemblyreference.xaml">
  663.      <Context>;BrowseObject</Context>
  664.    </PropertyPageSchema>
  665.    <PropertyPageSchema Include="$(CommonXamlResourcesDirectory)ResolvedAssemblyReference.xaml">
  666.      <Context>ProjectSubscriptionService;BrowseObject</Context>
  667.    </PropertyPageSchema>
  668.  
  669.    <!-- COM references -->
  670.    <PropertyPageSchema Include="$(CommonXamlResourcesDirectory)COMReference.xaml">
  671.      <Context>;BrowseObject</Context>
  672.    </PropertyPageSchema>
  673.    <PropertyPageSchema Include="$(CommonXamlResourcesDirectory)ResolvedCOMReference.xaml">
  674.      <Context>ProjectSubscriptionService;BrowseObject</Context>
  675.    </PropertyPageSchema>
  676.  
  677.    <!-- Project references -->
  678.    <PropertyPageSchema Include="$(CommonXamlResourcesDirectory)ProjectReference.xaml">
  679.      <Context>;BrowseObject</Context>
  680.    </PropertyPageSchema>
  681.    <PropertyPageSchema Include="$(CommonXamlResourcesDirectory)ResolvedProjectReference.xaml">
  682.      <Context>ProjectSubscriptionService;BrowseObject</Context>
  683.    </PropertyPageSchema>
  684.  </ItemGroup>
  685.  
  686.  <ItemGroup Condition=" '$(DefineCommonCapabilities)' == 'true' ">
  687.    <ProjectCapability Include="
  688.                          AssemblyReferences;
  689.                          COMReferences;
  690.                          ProjectReferences;
  691.                          SharedProjectReferences;
  692.                          OutputGroups;
  693.                          AllTargetOutputGroups;
  694.                          VisualStudioWellKnownOutputGroups;
  695.                          SingleFileGenerators;
  696.                          DeclaredSourceItems;
  697.                          UserSourceItems;
  698.                           " />
  699.    <ProjectCapability Condition=" '$(TargetPlatformIdentifier)' == 'Windows' and '$(TargetPlatformVersion)' &lt; 8.0 "
  700.                       Include="BuildWindowsDesktopTarget" />
  701.  </ItemGroup>
  702.  
  703.  <ItemDefinitionGroup Condition=" '$(DefineExplicitDefaults)' == 'true' ">
  704.    <None>
  705.      <CopyToOutputDirectory>Never</CopyToOutputDirectory>
  706.    </None>
  707.    <Content>
  708.      <CopyToOutputDirectory>Never</CopyToOutputDirectory>
  709.    </Content>
  710.    <Compile>
  711.      <CopyToOutputDirectory>Never</CopyToOutputDirectory>
  712.    </Compile>
  713.    <EmbeddedResource>
  714.      <CopyToOutputDirectory>Never</CopyToOutputDirectory>
  715.    </EmbeddedResource>
  716.  </ItemDefinitionGroup>
  717.  
  718.  <!--
  719.    Target that allows targets consuming source control confirmation to establish a dependency on targets producing this information.
  720.  
  721.    Any target that reads SourceRevisionId, PrivateRepositoryUrl, SourceRoot, and other source control properties and items
  722.    should depend on this target and be conditioned on '$(SourceControlInformationFeatureSupported)' == 'true'.
  723.  
  724.    SourceRevisionId property uniquely identifies the source control revision of the repository the project belongs to.
  725.    For Git repositories this id is a commit hash, for TFVC repositories it's the changeset number, etc.
  726.  
  727.     PrivateRepositoryUrl property stores the URL of the repository supplied by the CI server or retrieved from source control manager.
  728.     Targets consuming this property shall not publish its value implicitly as it might inadvertently reveal an internal URL.
  729.     Instead, they shall only do so if the project sets PublishRepositoryUrl property to true. For example, the NuGet Pack target
  730.     may include the repository URL in the nuspec file generated for NuGet package produced by the project if PublishRepositoryUrl is true.
  731.  
  732.     SourceRoot item group lists all source roots that the project source files reside under and their mapping to source control server URLs,
  733.     if available. This includes both source files under source control as well as source files in source packages. SourceRoot items are
  734.     used by compilers to determine path map in deterministic build and by SourceLink provider, which maps local paths to URLs of source files
  735.     stored on the source control server.
  736.  
  737.     Source control information provider that sets these properties and items shall execute before this target (by including
  738.     InitializeSourceControlInformation in its BeforeTargets) and set source control properties and items that haven't been initialized yet.
  739.  -->
  740.  <Target Name="InitializeSourceControlInformation" />
  741.  
  742.  <PropertyGroup>
  743.    <SourceControlInformationFeatureSupported>true</SourceControlInformationFeatureSupported>
  744.  </PropertyGroup>
  745.  
  746.  <!--
  747.    ***********************************************************************************************
  748.    ***********************************************************************************************
  749.                                                                Build Section
  750.    ***********************************************************************************************
  751.    ***********************************************************************************************
  752.    -->
  753.  
  754.  <!--
  755.    ============================================================
  756.                                        _CheckForInvalidConfigurationAndPlatform
  757.  
  758.    This target checks for errors in statically defined properties.  By setting BeforeTargets, we try
  759.    to ensure that the target runs before any build related targets.
  760.    If your target requires this check and is running as a BeforeTargets of one of the first targets
  761.    of $(BuildDependsOn), $(RebuildDependsOn), or $(CleanDependsOn) you will need to set your DependsOn
  762.    to this target.
  763.    ============================================================
  764.    -->
  765.  <Target
  766.      Name="_CheckForInvalidConfigurationAndPlatform"
  767.      BeforeTargets="$(BuildDependsOn);Build;$(RebuildDependsOn);Rebuild;$(CleanDependsOn);Clean">
  768.  
  769.    <PropertyGroup>
  770.      <_InvalidConfigurationMessageText>The OutputPath property is not set for project '$(MSBuildProjectFile)'.  Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.  Configuration='$(_OriginalConfiguration)'  Platform='$(_OriginalPlatform)'.</_InvalidConfigurationMessageText>
  771.      <_InvalidConfigurationMessageText Condition="'$(BuildingInsideVisualStudio)' == 'true'">$(_InvalidConfigurationMessageText)  This error may also appear if some other project is trying to follow a project-to-project reference to this project, this project has been unloaded or is not included in the solution, and the referencing project does not build using the same or an equivalent Configuration or Platform.</_InvalidConfigurationMessageText>
  772.      <_InvalidConfigurationMessageText Condition="'$(BuildingInsideVisualStudio)' != 'true'">$(_InvalidConfigurationMessageText)  You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project.</_InvalidConfigurationMessageText>
  773.     </PropertyGroup>
  774.  
  775.     <Error Condition=" '$(_InvalidConfigurationError)' == 'true' " Text="$(_InvalidConfigurationMessageText)"/>
  776.     <Warning Condition=" '$(_InvalidConfigurationWarning)' == 'true' " Text="$(_InvalidConfigurationMessageText)"/>
  777.  
  778.     <Message Condition="'$(DesignTimeBuild)' != 'true'" Text="Configuration=$(Configuration)" Importance="Low" />
  779.     <Message Condition="'$(DesignTimeBuild)' != 'true'" Text="Platform=$(Platform)" Importance="Low" />
  780.  
  781.     <!-- Although we try to ensure a trailing slash, it's possible to circumvent this if the property is set on the command line -->
  782.    <Error Condition="'$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)')" Text="The OutDir property must end with a trailing slash." />
  783.    <Error Condition="'$(BaseIntermediateOutputPath)' != '' and !HasTrailingSlash('$(BaseIntermediateOutputPath)')" Text="The BaseIntermediateOutputPath must end with a trailing slash." />
  784.    <Error Condition="'$(IntermediateOutputPath)' != '' and !HasTrailingSlash('$(IntermediateOutputPath)')" Text="The IntermediateOutputPath must end with a trailing slash." />
  785.  
  786.    <!-- Also update the value of PlatformTargetAsMSBuildArchitecture per the value of Prefer32Bit.  We are doing
  787.         this here because Prefer32Bit may be set anywhere in the targets, so we can't depend on it having the
  788.          correct value when we're trying to figure out PlatformTargetAsMSBuildArchitecture -->
  789.    <PropertyGroup Condition="'$(Prefer32Bit)' == 'true' and ('$(PlatformTarget)' == 'AnyCPU' or '$(PlatformTarget)' == '') and '$(PlatformTargetAsMSBuildArchitectureExplicitlySet)' != 'true'">
  790.      <PlatformTargetAsMSBuildArchitecture>x86</PlatformTargetAsMSBuildArchitecture>
  791.    </PropertyGroup>
  792.  
  793.    <!--
  794.      Log an error if the user set MSBuildProjectExtensionsPath in the body of a project. In an SDK style project
  795.      if you set a value in the body, the value is not used by the top implicit import but is used by the bottom.
  796.      This can lead to confusing behavior and builds can fail for obscure reasons.
  797.    -->
  798.    <Error Condition=" '$(_InitialMSBuildProjectExtensionsPath)' != '' And '$(MSBuildProjectExtensionsPath)' != '$(_InitialMSBuildProjectExtensionsPath)' "
  799.           Code="MSB3540"
  800.           Text="The value of the property &quot;MSBuildProjectExtensionsPath&quot; was modified after it was used by MSBuild which can lead to unexpected build results.  To set this property, you must do so before Microsoft.Common.props is imported, for example by using Directory.Build.props.  For more information, please visit https://go.microsoft.com/fwlink/?linkid=869650"
  801.            />
  802.  
  803.    <!--
  804.      Log a warning if:
  805.        1. $(EnableBaseIntermediateOutputPathMismatchWarning) is 'true'
  806.        2. $(BaseIntermediateOutputPath) was set in the body of a project after its default value was set in Microsoft.Common.props
  807.        3. $(BaseIntermediateOutputPath) is not the same as $(MSBuildProjectExtensionsPath)
  808.  
  809.      Similar to the error above, there are cases when users set $(BaseIntermediateOutputPath) in the body of their project and things build but only by coincidence.
  810.      MSBuild does not know if $(BaseIntermediateOutputPath) changing would cause problems so tools like NuGet must set $(EnableBaseIntermediateOutputPathMismatchWarning)
  811.      to 'true'.
  812.    -->
  813.    <Warning Condition=" '$(EnableBaseIntermediateOutputPathMismatchWarning)' == 'true' And '$(_InitialBaseIntermediateOutputPath)' != '$(BaseIntermediateOutputPath)' And '$(BaseIntermediateOutputPath)' != '$(MSBuildProjectExtensionsPath)' "
  814.             Code="MSB3539"
  815.             Text="The value of the property &quot;BaseIntermediateOutputPath&quot; was modified after it was used by MSBuild which can lead to unexpected build results. Tools such as NuGet will write outputs to the path specified by the &quot;MSBuildProjectExtensionsPath&quot; instead. To set this property, you must do so before Microsoft.Common.props is imported, for example by using Directory.Build.props.  For more information, please visit https://go.microsoft.com/fwlink/?linkid=869650"
  816.             />
  817.  </Target>
  818.  
  819.  <!--
  820.    ============================================================
  821.                                        Build
  822.  
  823.    The main build entry point.
  824.    ============================================================
  825.    -->
  826.  <PropertyGroup>
  827.    <BuildDependsOn>
  828.      BeforeBuild;
  829.      CoreBuild;
  830.      AfterBuild
  831.    </BuildDependsOn>
  832.  </PropertyGroup>
  833.  
  834.  <Target
  835.      Name="Build"
  836.      Condition=" '$(_InvalidConfigurationWarning)' != 'true' "
  837.      DependsOnTargets="$(BuildDependsOn)"
  838.      Returns="@(TargetPathWithTargetPlatformMoniker)" />
  839.  
  840.  <!--
  841.    ============================================================
  842.                                        BeforeBuild
  843.  
  844.    Redefine this target in your project in order to run tasks just before Build
  845.    ============================================================
  846.    -->
  847.  <Target Name="BeforeBuild"/>
  848.  
  849.  <!--
  850.    ============================================================
  851.                                        AfterBuild
  852.  
  853.    Redefine this target in your project in order to run tasks just after Build
  854.    ============================================================
  855.    -->
  856.  <Target Name="AfterBuild"/>
  857.  
  858.  <!--
  859.    ============================================================
  860.                                        CoreBuild
  861.  
  862.    The core build step calls each of the build targets.
  863.    ============================================================
  864.    -->
  865.  <PropertyGroup>
  866.    <CoreBuildDependsOn>
  867.      BuildOnlySettings;
  868.      PrepareForBuild;
  869.      PreBuildEvent;
  870.      ResolveReferences;
  871.      PrepareResources;
  872.      ResolveKeySource;
  873.      Compile;
  874.      ExportWindowsMDFile;
  875.      UnmanagedUnregistration;
  876.      GenerateSerializationAssemblies;
  877.      CreateSatelliteAssemblies;
  878.      GenerateManifests;
  879.      GetTargetPath;
  880.      PrepareForRun;
  881.      UnmanagedRegistration;
  882.      IncrementalClean;
  883.      PostBuildEvent
  884.    </CoreBuildDependsOn>
  885.  </PropertyGroup>
  886.  <Target
  887.      Name="CoreBuild"
  888.      DependsOnTargets="$(CoreBuildDependsOn)">
  889.  
  890.    <OnError ExecuteTargets="_TimeStampAfterCompile;PostBuildEvent" Condition="'$(RunPostBuildEvent)'=='Always' or '$(RunPostBuildEvent)'=='OnOutputUpdated'"/>
  891.    <OnError ExecuteTargets="_CleanRecordFileWrites"/>
  892.  
  893.  </Target>
  894.  
  895.  <!--
  896.    ============================================================
  897.                                        Rebuild
  898.  
  899.    Delete all intermediate and final build outputs, and then build the project from scratch.
  900.    ============================================================
  901.    -->
  902.  <PropertyGroup>
  903.  
  904.    <_ProjectDefaultTargets Condition="'$(MSBuildProjectDefaultTargets)' != ''">$(MSBuildProjectDefaultTargets)</_ProjectDefaultTargets>
  905.    <_ProjectDefaultTargets Condition="'$(MSBuildProjectDefaultTargets)' == ''">Build</_ProjectDefaultTargets>
  906.  
  907.    <RebuildDependsOn>
  908.      BeforeRebuild;
  909.      Clean;
  910.      $(_ProjectDefaultTargets);
  911.      AfterRebuild;
  912.    </RebuildDependsOn>
  913.  
  914.    <RebuildDependsOn Condition=" '$(MSBuildProjectDefaultTargets)' == 'Rebuild' " >
  915.      BeforeRebuild;
  916.      Clean;
  917.      Build;
  918.      AfterRebuild;
  919.    </RebuildDependsOn>
  920.  </PropertyGroup>
  921.  
  922.  <Target
  923.      Name="Rebuild"
  924.      Condition=" '$(_InvalidConfigurationWarning)' != 'true' "
  925.      DependsOnTargets="$(RebuildDependsOn)"
  926.      Returns="$(TargetPath)"/>
  927.  
  928.  <!--
  929.    ============================================================
  930.                                        BeforeRebuild
  931.  
  932.    Redefine this target in your project in order to run tasks just before Rebuild
  933.    ============================================================
  934.    -->
  935.  <Target Name="BeforeRebuild"/>
  936.  
  937.  <!--
  938.    ============================================================
  939.                                        AfterRebuild
  940.  
  941.    Redefine this target in your project in order to run tasks just after Rebuild
  942.    ============================================================
  943.    -->
  944.  <Target Name="AfterRebuild"/>
  945.  
  946.  <!--
  947.    ============================================================
  948.                                        BuildGenerateSources
  949.  
  950.    Redefine this target in your project in order to run tasks for BuildGenerateSources
  951.  
  952.    Set BuildPassReferences to enable P2P builds
  953.    ============================================================
  954.    -->
  955.  <PropertyGroup>
  956.    <BuildGenerateSourcesAction>Build</BuildGenerateSourcesAction>
  957.  </PropertyGroup>
  958.  
  959.  <Target Name="BuildGenerateSources" DependsOnTargets="BuildGenerateSourcesTraverse;$(BuildGenerateSourcesAction)" />
  960.  
  961.  <Target Name="BuildGenerateSourcesTraverse" DependsOnTargets="PrepareProjectReferences">
  962.    <MSBuild
  963.        Projects="@(_MSBuildProjectReferenceExistent)"
  964.        Targets="BuildGenerateSources"
  965.        BuildInParallel="$(BuildInParallel)"
  966.        Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform); %(_MSBuildProjectReferenceExistent.SetTargetFramework);"
  967.        Condition="'$(BuildPassReferences)' == 'true' and '@(ProjectReferenceWithConfiguration)' != '' and '@(_MSBuildProjectReferenceExistent)' != '' and '%(_MSBuildProjectReferenceExistent.BuildReference)' == 'true'"
  968.        ContinueOnError="!$(BuildingProject)"
  969.        RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
  970.    </MSBuild>
  971.  </Target>
  972.  
  973.  <!--
  974.    ============================================================
  975.                                        BuildCompile
  976.  
  977.    Redefine this target in your project in order to run tasks for BuildCompile
  978.    ============================================================
  979.    -->
  980.  <PropertyGroup>
  981.    <BuildCompileAction>Build</BuildCompileAction>
  982.  </PropertyGroup>
  983.  
  984.  <Target Name="BuildCompile" DependsOnTargets="BuildCompileTraverse;$(BuildCompileAction)" />
  985.  
  986.  <Target Name="BuildCompileTraverse" DependsOnTargets="PrepareProjectReferences">
  987.    <MSBuild
  988.        Projects="@(_MSBuildProjectReferenceExistent)"
  989.        Targets="BuildCompile"
  990.        BuildInParallel="$(BuildInParallel)"
  991.        Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform); %(_MSBuildProjectReferenceExistent.SetTargetFramework)"
  992.        Condition="'$(BuildPassReferences)' == 'true' and '@(ProjectReferenceWithConfiguration)' != '' and '@(_MSBuildProjectReferenceExistent)' != ''  and '%(_MSBuildProjectReferenceExistent.BuildReference)' == 'true'"
  993.        ContinueOnError="!$(BuildingProject)"
  994.        RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
  995.    </MSBuild>
  996.  </Target>
  997.  
  998.  <!--
  999.    ============================================================
  1000.                                        BuildLink
  1001.  
  1002.    Redefine this target in your project in order to run tasks for BuildLink
  1003.    ============================================================
  1004.    -->
  1005.  <PropertyGroup>
  1006.    <BuildLinkAction>Build</BuildLinkAction>
  1007.  </PropertyGroup>
  1008.  
  1009.  <Target Name="BuildLink" DependsOnTargets="BuildLinkTraverse;$(BuildLinkAction)" />
  1010.  
  1011.  <Target Name="BuildLinkTraverse" DependsOnTargets="PrepareProjectReferences" >
  1012.    <MSBuild
  1013.        Projects="@(_MSBuildProjectReferenceExistent)"
  1014.        Targets="BuildLink"
  1015.        BuildInParallel="$(BuildInParallel)"
  1016.        Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform); %(_MSBuildProjectReferenceExistent.SetTargetFramework)"
  1017.        Condition="'$(BuildPassReferences)' == 'true' and '@(ProjectReferenceWithConfiguration)' != '' and '@(_MSBuildProjectReferenceExistent)' != ''  and '%(_MSBuildProjectReferenceExistent.BuildReference)' == 'true'"
  1018.        ContinueOnError="!$(BuildingProject)"
  1019.        RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
  1020.    </MSBuild>
  1021.  </Target>
  1022.  
  1023.  <!--
  1024.    ============================================================
  1025.                                        CopyRunEnvironmentFiles
  1026.  
  1027.    Copy environment files necessary to run the user's app to the final directory.
  1028.     This is a public target that can be invoked by an IDE.
  1029.  
  1030.     This may be used by an IDE to make the app.config file available for running
  1031.     the target app.
  1032.     ============================================================
  1033.     -->
  1034.   <Target
  1035.       Name="CopyRunEnvironmentFiles"
  1036.       DependsOnTargets="PrepareForBuild;SetWin32ManifestProperties;_CopyAppConfigFile;_CleanRecordFileWrites"/>
  1037.  
  1038.   <!--
  1039.     ============================================================
  1040.                                         Run
  1041.  
  1042.     Run the final build output if it is a .EXE
  1043.     ============================================================
  1044.     -->
  1045.   <PropertyGroup>
  1046.     <RunDependsOn></RunDependsOn>
  1047.   </PropertyGroup>
  1048.   <Target
  1049.       Name="Run"
  1050.       DependsOnTargets="$(RunDependsOn)">
  1051.  
  1052.     <Error Text="Cannot run '$(TargetPath)' because project output type is not '.exe'" Condition="'$(TargetExt)'!='.exe'"/>
  1053.     <Exec Command="$(TargetPath) $(StartArguments)" WorkingDirectory="$(OutDir)" Condition=" '$(StartWorkingDirectory)' == '' "/>
  1054.     <Exec Command="$(TargetPath) $(StartArguments)" WorkingDirectory="$(StartWorkingDirectory)" Condition=" '$(StartWorkingDirectory)' != '' "/>
  1055.  
  1056.   </Target>
  1057.  
  1058.  
  1059.  
  1060.  
  1061.   <!--
  1062.     ***********************************************************************************************
  1063.     ***********************************************************************************************
  1064.                                                                 BuildOnlySettings Section
  1065.     ***********************************************************************************************
  1066.     ***********************************************************************************************
  1067.     -->
  1068.  
  1069.   <!--
  1070.     ============================================================
  1071.                                         BuildOnlySettings
  1072.  
  1073.     This target is called only when doing a real build.  It is specifically not called during project load.
  1074.     ============================================================
  1075.     -->
  1076.   <PropertyGroup>
  1077.     <BuildingProject>false</BuildingProject>
  1078.   </PropertyGroup>
  1079.   <Target
  1080.       Name="BuildOnlySettings">
  1081.     <PropertyGroup>
  1082.       <BuildingProject>true</BuildingProject>
  1083.     </PropertyGroup>
  1084.   </Target>
  1085.  
  1086.  
  1087.  
  1088.  
  1089.   <!--
  1090.     ***********************************************************************************************
  1091.     ***********************************************************************************************
  1092.                                                                 PrepareForBuild Section
  1093.     ***********************************************************************************************
  1094.     ***********************************************************************************************
  1095.     -->
  1096.  
  1097.   <!--
  1098.     ============================================================
  1099.                                         PrepareForBuild
  1100.  
  1101.     Prepare the prerequisites for building.
  1102.     ============================================================
  1103.     -->
  1104.   <PropertyGroup>
  1105.     <PrepareForBuildDependsOn>GetFrameworkPaths;GetReferenceAssemblyPaths;AssignLinkMetadata</PrepareForBuildDependsOn>
  1106.   </PropertyGroup>
  1107.   <Target
  1108.       Name="PrepareForBuild"
  1109.       DependsOnTargets="$(PrepareForBuildDependsOn)">
  1110.  
  1111.     <ItemGroup>
  1112.       <AppConfigWithTargetPath Include="$(AppConfig)" Condition="'$(AppConfig)'!=''">
  1113.         <TargetPath>$(TargetFileName).config</TargetPath>
  1114.       </AppConfigWithTargetPath>
  1115.     </ItemGroup>
  1116.  
  1117.     <FindAppConfigFile PrimaryList="@(None)" SecondaryList="@(Content)" TargetPath="$(TargetFileName).config" Condition="'$(AppConfig)'==''">
  1118.       <Output TaskParameter="AppConfigFile" ItemName="AppConfigWithTargetPath"/>
  1119.       <Output TaskParameter="AppConfigFile" PropertyName="AppConfig"/>
  1120.     </FindAppConfigFile>
  1121.  
  1122.     <!-- Create the directories for intermediate and final build products, and any other arbitrary directories. -->
  1123.     <!-- We are going to continue on error here so that if the tree is read only we will still get intellisense -->
  1124.     <MakeDir Directories="$(OutDir);$(IntermediateOutputPath);@(DocFileItem->'%(RelativeDir)');@(CreateDirectory)" ContinueOnError="True"/>
  1125.  
  1126.   </Target>
  1127.  
  1128.   <!--
  1129.     ============================================================
  1130.                                         GetFrameworkPaths
  1131.  
  1132.     Get the paths for the .NET Framework installation directory
  1133.  
  1134.     These paths are not used directly by this .targets file but are available for pre and
  1135.     post build steps.
  1136.     ============================================================
  1137.     -->
  1138.   <PropertyGroup>
  1139.     <Framework40Dir>@(_TargetFramework40DirectoryItem)</Framework40Dir>
  1140.     <Framework35Dir>@(_TargetFramework35DirectoryItem)</Framework35Dir>
  1141.     <Framework30Dir>@(_TargetFramework30DirectoryItem)</Framework30Dir>
  1142.     <Framework20Dir>@(_TargetFramework20DirectoryItem)</Framework20Dir>
  1143.     <!-- Note we need to make the 4.0 FrameworkDir point to the 2.0 location by default since we shipped msbuild 4.0 that way and to change it would be a breaking change.-->
  1144.     <FrameworkDir Condition="'$(FrameworkDir)' == '' and ('$(TargetFrameworkVersion)' == 'v2.0' or '$(TargetFrameworkVersion)' == 'v3.5' or '$(TargetFrameworkVersion)' == 'v4.0')">@(_TargetFramework20DirectoryItem)</FrameworkDir>
  1145.     <FrameworkDir Condition="'$(FrameworkDir)' == ''">@(_TargetFramework40DirectoryItem)</FrameworkDir>
  1146.     <TargetedFrameworkDir Condition="'$(TargetedFrameworkDir)' == ''">@(_TargetedFrameworkDirectoryItem)</TargetedFrameworkDir>
  1147.     <FrameworkSDKDir Condition="'$(FrameworkSDKDir)' == ''">@(_TargetFrameworkSDKDirectoryItem)</FrameworkSDKDir>
  1148.     <GetFrameworkPathsDependsOn></GetFrameworkPathsDependsOn>
  1149.   </PropertyGroup>
  1150.  
  1151.   <!-- This is a generally overriden target, for example it is overriden in the Microsoft.NETFramework.targets file -->
  1152.   <Target Name="GetFrameworkPaths"/>
  1153.  
  1154.   <!--
  1155.     ============================================================
  1156.                                         GetReferenceAssemblyPaths
  1157.  
  1158.     Get the paths for the Reference Assemblies for the known versions of the
  1159.     .NET Framework.
  1160.  
  1161.     These paths are used by the build process in order to resolve the correct
  1162.     assemblies from the various directories, and to support multi-targeting
  1163.     ============================================================
  1164.     -->
  1165.   <Target
  1166.       Name="GetReferenceAssemblyPaths"
  1167.       DependsOnTargets="$(GetReferenceAssemblyPathsDependsOn);GetFrameworkPaths">
  1168.  
  1169.     <!-- if TargetFrameworkDirectory doesn't have a custom value, clear it out; that way we can get reference paths and target framework directories all in the right order -->
  1170.    <PropertyGroup>
  1171.      <TargetFrameworkDirectory Condition="'@(_CombinedTargetFrameworkDirectoriesItem)' == '$(TargetFrameworkDirectory)'"/>
  1172.    </PropertyGroup>
  1173.  
  1174.    <!-- By default if there is no root path set then the task will assume it is Program Files\Reference Assemblies\Microsoft\Framework-->
  1175.    <GetReferenceAssemblyPaths
  1176.        Condition="'$(TargetFrameworkMoniker)' != '' and ('$(_TargetFrameworkDirectories)' == '' or '$(_FullFrameworkReferenceAssemblyPaths)' == '')"
  1177.        TargetFrameworkMoniker="$(TargetFrameworkMoniker)"
  1178.        RootPath="$(TargetFrameworkRootPath)"
  1179.        TargetFrameworkFallbackSearchPaths="$(TargetFrameworkFallbackSearchPaths)"
  1180.        BypassFrameworkInstallChecks="$(BypassFrameworkInstallChecks)"
  1181.        >
  1182.      <Output TaskParameter="ReferenceAssemblyPaths" PropertyName="_TargetFrameworkDirectories"/>
  1183.      <Output TaskParameter="FullFrameworkReferenceAssemblyPaths" PropertyName="_FullFrameworkReferenceAssemblyPaths"/>
  1184.      <Output TaskParameter="TargetFrameworkMonikerDisplayName" PropertyName="TargetFrameworkMonikerDisplayName" Condition="'$(TargetFrameworkMonikerDisplayName)' == ''"/>
  1185.    </GetReferenceAssemblyPaths>
  1186.  
  1187.    <PropertyGroup>
  1188.      <TargetFrameworkDirectory>$(_TargetFrameworkDirectories);$(TargetFrameworkDirectory);$(WinFXAssemblyDirectory)</TargetFrameworkDirectory>
  1189.      <TargetFrameworkDirectory Condition="'$(TargetPlatformWinMDLocation)' != '' and Exists('$(TargetPlatformWinMDLocation)')">$(TargetFrameworkDirectory);$(TargetPlatformWinMDLocation)</TargetFrameworkDirectory>
  1190.    </PropertyGroup>
  1191.  
  1192.    <!-- Remove the AssemblyFolders if no target framework directories could be found. This is to prevent us from
  1193.             resolving from the assemblyfolders global location if we are not acutally targeting a framework-->
  1194.  
  1195.    <PropertyGroup>
  1196.      <RemoveAssemblyFoldersIfNoTargetFramework Condition="'$(RemoveAssemblyFoldersIfNoTargetFramework)' == ''">true</RemoveAssemblyFoldersIfNoTargetFramework>
  1197.    </PropertyGroup>
  1198.  
  1199.    <PropertyGroup Condition="'$(_TargetFrameworkDirectories)' == '' and '$(AssemblySearchPaths)' != '' and '$(RemoveAssemblyFoldersIfNoTargetFramework)' == 'true'">
  1200.      <AssemblySearchPaths>$(AssemblySearchPaths.Replace('{AssemblyFolders}', '').Split(';'))</AssemblySearchPaths>
  1201.    </PropertyGroup>
  1202.  
  1203.    <ItemGroup Condition="'$(ImplicitlyExpandDesignTimeFacades)' == 'true'">
  1204.      <DesignTimeFacadeDirectoryRoots Include="$(TargetFrameworkDirectory)" />
  1205.      <DesignTimeFacadeDirectories Include="%(DesignTimeFacadeDirectoryRoots.Identity)Facades\" Condition="Exists('%(DesignTimeFacadeDirectoryRoots.Identity)Facades\')" />
  1206.    </ItemGroup>
  1207.  
  1208.    <PropertyGroup Condition="'@(DesignTimeFacadeDirectories)' != ''">
  1209.      <TargetFrameworkDirectory>$(TargetFrameworkDirectory);@(DesignTimeFacadeDirectories)</TargetFrameworkDirectory>
  1210.    </PropertyGroup>
  1211.  
  1212.    <PropertyGroup Condition="'$(_TargetFrameworkDirectories)' == ''">
  1213.      <TargetFrameworkProfile/>
  1214.    </PropertyGroup>
  1215.  </Target>
  1216.  
  1217.   <!-- Returns target framework moniker. E.g. ".NETFramework,Version=v4.0.1" -->
  1218.  <Target Name="GetTargetFrameworkMoniker"
  1219.          Returns="$(TargetFrameworkMoniker)"/>
  1220.  
  1221.  <!-- Returns target framework moniker display name. E.g. ".NET Framework 4 Platform Update 1 (KB2478063)" -->
  1222.  <Target Name="GetTargetFrameworkMonikerDisplayName"
  1223.          DependsOnTargets="GetFrameworkPaths;GetReferenceAssemblyPaths"
  1224.          Returns="$(TargetFrameworkMonikerDisplayName)"/>
  1225.  
  1226.  <!-- Returns semicolon separated list of target framework directories.
  1227.  E.g "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0.1\;C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\" -->
  1228.  <Target Name="GetTargetFrameworkDirectories"
  1229.          DependsOnTargets="GetFrameworkPaths;GetReferenceAssemblyPaths"
  1230.          Returns="$(TargetFrameworkDirectory)"/>
  1231.  
  1232.  <!--
  1233.    ============================================================
  1234.                                        AssignLinkMetadata
  1235.  
  1236.       For items of a certain set of whitelisted types, make sure that
  1237.       if they are defined in a file other than the project file, that
  1238.       they have "Link" metadata set to an appropriate default.
  1239.    ============================================================
  1240.    -->
  1241.  <Target Name="AssignLinkMetadata" Condition=" '$(SynthesizeLinkMetadata)' == 'true' ">
  1242.    <!-- NONE ITEMS -->
  1243.    <AssignLinkMetadata Items="@(None)"
  1244.                        Condition="'@(None)' != '' and '%(None.DefiningProjectFullPath)' != '$(MSBuildProjectFullPath)'">
  1245.      <Output TaskParameter="OutputItems" ItemName="_Temp" />
  1246.    </AssignLinkMetadata>
  1247.  
  1248.    <ItemGroup>
  1249.      <None Remove="@(_Temp)" />
  1250.      <None Include="@(_Temp)" />
  1251.      <_Temp Remove="@(_Temp)" />
  1252.    </ItemGroup>
  1253.  
  1254.    <!-- CONTENT ITEMS -->
  1255.    <AssignLinkMetadata Items="@(Content)"
  1256.                        Condition="'@(Content)' != '' and '%(Content.DefiningProjectFullPath)' != '$(MSBuildProjectFullPath)'">
  1257.      <Output TaskParameter="OutputItems" ItemName="_Temp" />
  1258.    </AssignLinkMetadata>
  1259.  
  1260.    <ItemGroup>
  1261.      <Content Remove="@(_Temp)" />
  1262.      <Content Include="@(_Temp)" />
  1263.      <_Temp Remove="@(_Temp)" />
  1264.    </ItemGroup>
  1265.  
  1266.  
  1267.    <!-- PAGE ITEMS -->
  1268.    <AssignLinkMetadata Items="@(Page)"
  1269.                        Condition="'@(Page)' != '' and '%(Page.DefiningProjectFullPath)' != '$(MSBuildProjectFullPath)'">
  1270.      <Output TaskParameter="OutputItems" ItemName="_Temp" />
  1271.    </AssignLinkMetadata>
  1272.  
  1273.    <ItemGroup>
  1274.      <Page Remove="@(_Temp)" />
  1275.      <Page Include="@(_Temp)" />
  1276.      <_Temp Remove="@(_Temp)" />
  1277.    </ItemGroup>
  1278.  
  1279.  
  1280.    <!-- APPLICATIONDEFINITION ITEMS -->
  1281.    <AssignLinkMetadata Items="@(ApplicationDefinition)"
  1282.                        Condition="'@(ApplicationDefinition)' != '' and '%(ApplicationDefinition.DefiningProjectFullPath)' != '$(MSBuildProjectFullPath)'">
  1283.      <Output TaskParameter="OutputItems" ItemName="_Temp" />
  1284.    </AssignLinkMetadata>
  1285.  
  1286.    <ItemGroup>
  1287.      <ApplicationDefinition Remove="@(_Temp)" />
  1288.      <ApplicationDefinition Include="@(_Temp)" />
  1289.      <_Temp Remove="@(_Temp)" />
  1290.    </ItemGroup>
  1291.  
  1292.    <!-- EMBEDDEDRESOURCE ITEMS -->
  1293.    <AssignLinkMetadata Items="@(EmbeddedResource)"
  1294.                        Condition="'@(EmbeddedResource)' != '' and '%(EmbeddedResource.DefiningProjectFullPath)' != '$(MSBuildProjectFullPath)'">
  1295.      <Output TaskParameter="OutputItems" ItemName="_Temp" />
  1296.    </AssignLinkMetadata>
  1297.  
  1298.    <ItemGroup>
  1299.      <EmbeddedResource Remove="@(_Temp)" />
  1300.      <EmbeddedResource Include="@(_Temp)" />
  1301.      <_Temp Remove="@(_Temp)" />
  1302.    </ItemGroup>
  1303.  </Target>
  1304.  
  1305.  <!--
  1306.    ***********************************************************************************************
  1307.    ***********************************************************************************************
  1308.                                                                PreBuildEvent Section
  1309.    ***********************************************************************************************
  1310.    ***********************************************************************************************
  1311.    -->
  1312.  
  1313.  <!--
  1314.    ============================================================
  1315.                                        PreBuildEvent
  1316.  
  1317.    Run the pre-build event if there is one.
  1318.    ============================================================
  1319.    -->
  1320.  <PropertyGroup>
  1321.    <PreBuildEventDependsOn></PreBuildEventDependsOn>
  1322.  </PropertyGroup>
  1323.  <Target
  1324.      Name="PreBuildEvent"
  1325.      Condition="'$(PreBuildEvent)'!=''"
  1326.      DependsOnTargets="$(PreBuildEventDependsOn)">
  1327.  
  1328.    <Exec WorkingDirectory="$(OutDir)" Command="$(PreBuildEvent)" />
  1329.  
  1330.  </Target>
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  <!--
  1336.    ***********************************************************************************************
  1337.    ***********************************************************************************************
  1338.                                                                UnmanagedUnregistration Section
  1339.    ***********************************************************************************************
  1340.    ***********************************************************************************************
  1341.    -->
  1342.  
  1343.  <!--
  1344.    ============================================================
  1345.                                        UnmanagedUnregistration
  1346.  
  1347.    If the main assembly had previously been registered for COM interop, unregister it now.
  1348.    We will re-register the new version after it has been built.
  1349.    ============================================================
  1350.    -->
  1351.  <PropertyGroup>
  1352.    <UnmanagedUnregistrationDependsOn></UnmanagedUnregistrationDependsOn>
  1353.  </PropertyGroup>
  1354.  <Target
  1355.      Name="UnmanagedUnregistration"
  1356.      Condition="(('$(_AssemblyTimestampBeforeCompile)' != '$(_AssemblyTimestampAfterCompile)' or '$(RegisterForComInterop)' != 'true' or '$(OutputType)' != 'library') or
  1357.                    ('$(_AssemblyTimestampBeforeCompile)' == '')) and
  1358.                   Exists('@(_UnmanagedRegistrationCache)')"
  1359.      DependsOnTargets="$(UnmanagedUnregistrationDependsOn)">
  1360.  
  1361.    <PropertyGroup>
  1362.      <UnregisterAssemblyMSBuildArchitecture Condition="'$(UnregisterAssemblyMSBuildArchitecture)' == ''">$(PlatformTargetAsMSBuildArchitecture)</UnregisterAssemblyMSBuildArchitecture>
  1363.    </PropertyGroup>
  1364.  
  1365.    <PropertyGroup Condition="'$(TargetFrameworkAsMSBuildRuntime)' != '' and '$(UnregisterAssemblyMSBuildArchitecture)' != ''">
  1366.      <!-- Falling back to the current runtime if we are targeting CLR2 and the task host doesn't exist will lead to
  1367.            incorrect behavior in some cases, but it's the same incorrect behavior as Visual Studio 2010, and thus better
  1368.           than causing build breaks on upgrade to Win8 the way not doing so would.  For more details, see the
  1369.           corresponding comment in GenerateResource. -->
  1370.      <UnregisterAssemblyMSBuildRuntime
  1371.          Condition="'$(UnregisterAssemblyMSBuildRuntime)' == '' and
  1372.                     $([MSBuild]::DoesTaskHostExist(`$(TargetFrameworkAsMSBuildRuntime)`, `$(UnregisterAssemblyMSBuildArchitecture)`))">$(TargetFrameworkAsMSBuildRuntime)</UnregisterAssemblyMSBuildRuntime>
  1373.  
  1374.      <!-- If the targeted runtime doesn't exist, fall back to current -->
  1375.       <UnregisterAssemblyMSBuildRuntime Condition="'$(UnregisterAssemblyMSBuildRuntime)' == ''">CurrentRuntime</UnregisterAssemblyMSBuildRuntime>
  1376.     </PropertyGroup>
  1377.  
  1378.  
  1379.     <UnregisterAssembly AssemblyListFile="@(_UnmanagedRegistrationCache)"
  1380.                         MSBuildArchitecture="$(UnregisterAssemblyMSBuildArchitecture)"
  1381.                         MSBuildRuntime="$(UnregisterAssemblyMSBuildRuntime)" />
  1382.  
  1383.   </Target>
  1384.  
  1385.  
  1386.  
  1387.  
  1388.   <!--
  1389.     ***********************************************************************************************
  1390.     ***********************************************************************************************
  1391.                                                                 ResolveReferences Section
  1392.     ***********************************************************************************************
  1393.     ***********************************************************************************************
  1394.     -->
  1395.   <!--
  1396.     ============================================================
  1397.                      GetTargetFrameworkVersion
  1398.  
  1399.     This stand-alone target returns the target framework version (i.e. v3.5, v4.0, etc.)
  1400.     that would be used if we built this project.
  1401.  
  1402.     ============================================================
  1403.     -->
  1404.  
  1405.   <Target
  1406.      Name="GetTargetFrameworkVersion"
  1407.      Returns="$(TargetFrameworkVersion)">
  1408.   </Target>
  1409.  
  1410.   <!--
  1411.     ============================================================
  1412.                                         ResolveReferences
  1413.     ============================================================
  1414.     -->
  1415.   <PropertyGroup>
  1416.     <ResolveReferencesDependsOn>
  1417.       BeforeResolveReferences;
  1418.       AssignProjectConfiguration;
  1419.       ResolveProjectReferences;
  1420.       FindInvalidProjectReferences;
  1421.       ResolveNativeReferences;
  1422.       ResolveAssemblyReferences;
  1423.       GenerateBindingRedirects;
  1424.       ResolveComReferences;
  1425.       AfterResolveReferences
  1426.     </ResolveReferencesDependsOn>
  1427.   </PropertyGroup>
  1428.  
  1429.   <Target
  1430.       Name="ResolveReferences"
  1431.       Returns="@(ReferencePath)"
  1432.       DependsOnTargets="$(ResolveReferencesDependsOn)"/>
  1433.  
  1434.   <!--
  1435.     ============================================================
  1436.                                         BeforeResolveReferences
  1437.  
  1438.     Redefine this target in your project in order to run tasks just before ResolveReferences
  1439.     ============================================================
  1440.     -->
  1441.   <Target Name="BeforeResolveReferences"/>
  1442.  
  1443.   <!--
  1444.     ============================================================
  1445.                                         AfterResolveReferences
  1446.  
  1447.     Redefine this target in your project in order to run tasks just after ResolveReferences
  1448.     ============================================================
  1449.     -->
  1450.   <Target Name="AfterResolveReferences"/>
  1451.  
  1452.   <!--
  1453.     ============================================================
  1454.                                         AssignProjectConfiguration
  1455.  
  1456.     Assigns the appropriate configuration to each project in the list of project references passed in.
  1457.     Adds to the project references passed in any project references implied by dependencies expressed in the solution file, if any.
  1458.  
  1459.         [IN]
  1460.         @(ProjectReference) - the list of all project references
  1461.  
  1462.         [OUT]
  1463.         @(ProjectReferenceWithConfiguration) - the list of project references (MSBuild and potentially VSIP projects)
  1464.                                                with metadata values FullConfiguration, Configuration, Platform,
  1465.                                                SetConfiguration, and SetPlatform
  1466.     ============================================================
  1467.     -->
  1468.   <Target
  1469.       Name="AssignProjectConfiguration"
  1470.       Condition="'$(CurrentSolutionConfigurationContents)' != '' or '@(ProjectReference)'!=''">
  1471.  
  1472.     <PropertyGroup>
  1473.       <OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration Condition="'$(OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration)' == ''">true</OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration>
  1474.       <ShouldUnsetParentConfigurationAndPlatform Condition="'$(ShouldUnsetParentConfigurationAndPlatform)' == '' and ('$(BuildingInsideVisualStudio)' == 'true' or '$(BuildingSolutionFile)' == 'true')">true</ShouldUnsetParentConfigurationAndPlatform>
  1475.       <ShouldUnsetParentConfigurationAndPlatform Condition="'$(ShouldUnsetParentConfigurationAndPlatform)' == ''">false</ShouldUnsetParentConfigurationAndPlatform>
  1476.  
  1477.       <!-- Web Application projects can "secretly" reference Silverlight projects, which can take project dependencies on that same Web Application.  If the project
  1478.            dependencies are promoted to project references, this ends up creating a situation where we have a circular reference between the two projects.  We don't
  1479.           want this to happen, so just turn off synthetic project reference generation for Silverlight projects. -->
  1480.      <AddSyntheticProjectReferencesForSolutionDependencies Condition="'$(AddSyntheticProjectReferencesForSolutionDependencies)' == '' and '$(TargetFrameworkIdentifier)' == 'Silverlight'">false</AddSyntheticProjectReferencesForSolutionDependencies>
  1481.  
  1482.      <!-- Inside VS, we do not need to add synthetic references, as VS already organizes the build per any solution-level dependencies; we only do this on the command line-->
  1483.      <AddSyntheticProjectReferencesForSolutionDependencies Condition="'$(AddSyntheticProjectReferencesForSolutionDependencies)' == '' and '$(BuildingInsideVisualStudio)' != 'true'">true</AddSyntheticProjectReferencesForSolutionDependencies>
  1484.    </PropertyGroup>
  1485.  
  1486.    <!-- Assign a project configuration to each project reference if we're building a solution file. -->
  1487.     <AssignProjectConfiguration
  1488.         ProjectReferences="@(ProjectReference)"
  1489.         CurrentProject="$(MSBuildProjectFullPath)"
  1490.         CurrentProjectConfiguration="$(Configuration)"
  1491.         CurrentProjectPlatform="$(Platform)"
  1492.         DefaultToVcxPlatformMapping="$(DefaultToVcxPlatformMapping)"
  1493.         VcxToDefaultPlatformMapping="$(VcxToDefaultPlatformMapping)"
  1494.         OutputType="$(OutputType)"
  1495.         ResolveConfigurationPlatformUsingMappings="false"
  1496.         SolutionConfigurationContents="$(CurrentSolutionConfigurationContents)"
  1497.         AddSyntheticProjectReferencesForSolutionDependencies="$(AddSyntheticProjectReferencesForSolutionDependencies)"
  1498.         OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration = "$(OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration)"
  1499.         ShouldUnsetParentConfigurationAndPlatform = "$(ShouldUnsetParentConfigurationAndPlatform)" >
  1500.  
  1501.       <!-- EMITTED FOR COMPATIBILITY REASONS ONLY. CONSUME PROJECTREFERENCEWITHCONFIGURATION INSTEAD -->
  1502.       <Output TaskParameter="AssignedProjects" ItemName="_ProjectReferenceWithConfiguration"/>
  1503.       <Output TaskParameter="UnassignedProjects" ItemName="_ProjectReferenceWithConfiguration"/>
  1504.  
  1505.       <Output TaskParameter="AssignedProjects" ItemName="ProjectReferenceWithConfiguration"/>
  1506.       <Output TaskParameter="UnassignedProjects" ItemName="ProjectReferenceWithConfiguration"/>
  1507.     </AssignProjectConfiguration>
  1508.  
  1509.     <ItemGroup>
  1510.       <_ProjectReferenceWithConfiguration>
  1511.         <BuildReference Condition="'%(_ProjectReferenceWithConfiguration.BuildReference)' == ''">true</BuildReference>
  1512.         <ReferenceOutputAssembly Condition="'%(_ProjectReferenceWithConfiguration.ReferenceOutputAssembly)' == ''">true</ReferenceOutputAssembly>
  1513.       </_ProjectReferenceWithConfiguration>
  1514.       <ProjectReferenceWithConfiguration>
  1515.         <BuildReference Condition="'%(ProjectReferenceWithConfiguration.BuildReference)' == ''">true</BuildReference>
  1516.         <ReferenceOutputAssembly Condition="'%(ProjectReferenceWithConfiguration.ReferenceOutputAssembly)' == ''">true</ReferenceOutputAssembly>
  1517.       </ProjectReferenceWithConfiguration>
  1518.     </ItemGroup>
  1519.   </Target>
  1520.  
  1521.   <!--
  1522.     ============================================================
  1523.                                         _SplitProjectReferencesByFileExistence
  1524.  
  1525.     Split referenced projects into two lists: those that exist on
  1526.     disk and those that don't.
  1527.    ============================================================
  1528.    -->
  1529.  
  1530.  <Target
  1531.    Name="_SplitProjectReferencesByFileExistence">
  1532.  
  1533.    <!--
  1534.        Use this task for matching projects with pre-resolved project outputs set by the IDE
  1535.        if building inside the IDE.  The IDE only includes non-MSBuild projects in the output list.  We'll
  1536.         use MSBuild to resolve MSBuild projects.
  1537.         This task will resolve VSIP (3rd party) project references and create a new item list with only project references
  1538.         to projects in the MSBuild format.
  1539.         -->
  1540.     <ResolveNonMSBuildProjectOutput
  1541.         ProjectReferences="@(ProjectReferenceWithConfiguration)"
  1542.         PreresolvedProjectOutputs="$(VSIDEResolvedNonMSBuildProjectOutputs)"
  1543.         Condition="'$(BuildingInsideVisualStudio)'=='true' and '@(ProjectReferenceWithConfiguration)'!=''">
  1544.  
  1545.       <Output TaskParameter="ResolvedOutputPaths" ItemName="_ResolvedProjectReferencePaths"/>
  1546.       <Output TaskParameter="UnresolvedProjectReferences" ItemName="_MSBuildProjectReference"/>
  1547.  
  1548.     </ResolveNonMSBuildProjectOutput>
  1549.  
  1550.     <!--
  1551.        If building from the command line, simply copy the ProjectReferenceWithConfiguration item list to _MSBuildProjectReference,
  1552.        since we have to assume all projects are in the MSBuild format. We have no way of building
  1553.        VSIP (3rd party) projects from the command line.
  1554.        -->
  1555.     <ItemGroup>
  1556.       <_MSBuildProjectReference Include="@(ProjectReferenceWithConfiguration)" Condition="'$(BuildingInsideVisualStudio)'!='true' and '@(ProjectReferenceWithConfiguration)'!=''"/>
  1557.     </ItemGroup>
  1558.  
  1559.     <!-- Break the project list into two lists: those that exist on disk and those that don't. -->
  1560.    <ItemGroup>
  1561.      <_MSBuildProjectReferenceExistent Include="@(_MSBuildProjectReference)" Condition="Exists('%(Identity)')"/>
  1562.      <_MSBuildProjectReferenceNonexistent Include="@(_MSBuildProjectReference)" Condition="!Exists('%(Identity)')"/>
  1563.    </ItemGroup>
  1564.  
  1565.  </Target>
  1566.  
  1567.  <!--
  1568.    ====================================================================================
  1569.                                        _GetProjectReferenceTargetFrameworkProperties
  1570.  
  1571.    Builds the GetTargetFrameworks target of all existent project references to get a list
  1572.    of all supported TargetFrameworks of the referenced projects. Calls the
  1573.    GetReferenceNearestTargetFrameworkTask to determine the closest match for each project.
  1574.    This allows a cross-targeting project to select how it should be configured to build
  1575.    against the most appropriate target for the referring target framework.
  1576.  
  1577.    ======================================================================================
  1578.  -->
  1579.  <Target Name="_GetProjectReferenceTargetFrameworkProperties">
  1580.    <!--
  1581.      Select the moniker to send to each project reference  if not already set. NugetTargetMoniker (NTM) is preferred by default over
  1582.      TargetFrameworkMoniker (TFM) because it is required to disambiguate the UWP case where TFM is fixed at .NETCore,Version=v5.0 and
  1583.      has floating NTM=UAP,Version=vX.Y.Z. However, in other cases (classic PCLs), NTM contains multiple values and that will cause the MSBuild
  1584.      invocation below to fail by passing invalid properties. Therefore we do not use the NTM if it contains a semicolon.
  1585.    -->
  1586.    <PropertyGroup Condition="'$(ReferringTargetFrameworkForProjectReferences)' == ''">
  1587.      <ReferringTargetFrameworkForProjectReferences Condition="'$(NuGetTargetMoniker)' != '' and !$(NuGetTargetMoniker.Contains(';'))">$(NuGetTargetMoniker)</ReferringTargetFrameworkForProjectReferences>
  1588.      <ReferringTargetFrameworkForProjectReferences Condition="'$(NuGetTargetMoniker)' == ''">$(TargetFrameworkMoniker)</ReferringTargetFrameworkForProjectReferences>
  1589.    </PropertyGroup>
  1590.  
  1591.    <!--
  1592.      Honor SkipGetTargetFrameworkProperties=true metadata on project references
  1593.      to mean that the project reference is known not to target multiple frameworks
  1594.      and the mechanism here for selecting the best one can be skipped as an optimization.
  1595.  
  1596.      We give this treatment to .vcxproj by default since no .vcxproj can target more
  1597.      than one framework.
  1598.   -->
  1599.   <ItemGroup>
  1600.      <_MSBuildProjectReferenceExistent Condition="'%(_MSBuildProjectReferenceExistent.SkipGetTargetFrameworkProperties)' == '' and ('%(Extension)' == '.vcxproj' or '%(Extension)' == '.nativeproj')">
  1601.        <SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
  1602.      </_MSBuildProjectReferenceExistent>
  1603.   </ItemGroup>
  1604.  
  1605.    <!--
  1606.       Allow project references to specify which target framework properties to set and their values
  1607.       without consulting the referenced project. This has two use cases:
  1608.  
  1609.       1. A caller may wish to pick a compatible but sub-optimal target framework. For example,
  1610.          to unit test the .NETStandard implementation using a .NETFramework caller even though
  1611.          there is also a .NETFramework implementation.
  1612.  
  1613.       2. As an escape hatch for cases where the compatibility check performed by
  1614.          GetTargetFrameworkProperties is faulty.
  1615.    -->
  1616.    <ItemGroup>
  1617.      <_MSBuildProjectReferenceExistent Condition="'%(_MSBuildProjectReferenceExistent.SetTargetFramework)' != ''">
  1618.        <SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
  1619.      </_MSBuildProjectReferenceExistent>
  1620.    </ItemGroup>
  1621.  
  1622.    <!--
  1623.       Get reference target framework lists.
  1624.       Note: A future optimization could cache the closest match and set the target framework on
  1625.       this MSBuild task invocation. This would (optimistically) save an evaluation of the referenced
  1626.       project when the answer is the same.
  1627.    -->
  1628.    <MSBuild
  1629.        Projects="@(_MSBuildProjectReferenceExistent)"
  1630.        Targets="GetTargetFrameworks"
  1631.        BuildInParallel="$(BuildInParallel)"
  1632.        Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform)"
  1633.        ContinueOnError="!$(BuildingProject)"
  1634.        RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove);TargetFramework;RuntimeIdentifier"
  1635.        Condition="'%(_MSBuildProjectReferenceExistent.SkipGetTargetFrameworkProperties)' != 'true'"
  1636.        SkipNonexistentTargets="true">
  1637.      <Output TaskParameter="TargetOutputs" ItemName="_ProjectReferenceTargetFrameworkPossibilities" />
  1638.    </MSBuild>
  1639.  
  1640.    <ItemGroup>
  1641.      <!--
  1642.        Preserve the ItemSpec value on the _ProjectReferenceTargetFrameworkPossibilities. Because relative paths in another project
  1643.        context would be incorrect, the MSBuild task invocation needs expands the project reference paths in the MSBuild task above.
  1644.        This is generally OK, but if the list is copied the OriginalItemSpec can become the expanded value and cause issues correlating
  1645.        a project reference back to an Item instance.
  1646.      -->
  1647.      <_ProjectReferenceTargetFrameworkPossibilitiesOriginalItemSpec Include="@(_ProjectReferenceTargetFrameworkPossibilities->'%(OriginalItemSpec)')"/>
  1648.      <_ProjectReferenceTargetFrameworkPossibilities Remove="@(_ProjectReferenceTargetFrameworkPossibilities)"  />
  1649.      <_ProjectReferenceTargetFrameworkPossibilities Include="@(_ProjectReferenceTargetFrameworkPossibilitiesOriginalItemSpec)"/>
  1650.    </ItemGroup>
  1651.  
  1652.    <!-- For each reference, get closest match -->
  1653.    <GetReferenceNearestTargetFrameworkTask AnnotatedProjectReferences="@(_ProjectReferenceTargetFrameworkPossibilities)"
  1654.                                            CurrentProjectTargetFramework="$(ReferringTargetFrameworkForProjectReferences)"
  1655.                                            CurrentProjectName="$(MSBuildProjectName)"
  1656.                                            FallbackTargetFrameworks="$(AssetTargetFallback)"
  1657.                                            Condition="'@(_ProjectReferenceTargetFrameworkPossibilities->Count())' != '0' and '$(ReferringTargetFrameworkForProjectReferences)' != ''">
  1658.      <Output ItemName="AnnotatedProjects" TaskParameter="AssignedProjects" />
  1659.    </GetReferenceNearestTargetFrameworkTask>
  1660.  
  1661.    <ItemGroup>
  1662.      <!--
  1663.         If the task was skipped or the current TargetFramework is empty, AnnotatedProjects will be empty.
  1664.         In this case, copy _ProjectReferenceTargetFrameworkPossibilities as is. See:
  1665.            https://github.com/dotnet/sdk/issues/416
  1666.      -->
  1667.      <AnnotatedProjects Include="@(_ProjectReferenceTargetFrameworkPossibilities)"
  1668.                         Condition="'$(ReferringTargetFrameworkForProjectReferences)' == ''" />
  1669.      <!-- If the NearestTargetFramework property was set and the project multi-targets, SetTargetFramework must be set. -->
  1670.      <AnnotatedProjects Condition="'@(AnnotatedProjects)' == '%(Identity)' and '%(AnnotatedProjects.NearestTargetFramework)' != '' and '%(AnnotatedProjects.HasSingleTargetFramework)' != 'true'">
  1671.        <SetTargetFramework>TargetFramework=%(AnnotatedProjects.NearestTargetFramework)</SetTargetFramework>
  1672.      </AnnotatedProjects>
  1673.  
  1674.      <!--
  1675.         If the NearestTargetFramework property was not set or the project has a single TargetFramework, we need to Undefine
  1676.         TargetFramework to avoid another project evaluation.
  1677.      -->
  1678.      <AnnotatedProjects Condition="'@(AnnotatedProjects)' == '%(Identity)' and ('%(AnnotatedProjects.NearestTargetFramework)' == '' or '%(AnnotatedProjects.HasSingleTargetFramework)' == 'true')">
  1679.        <UndefineProperties>%(AnnotatedProjects.UndefineProperties);TargetFramework</UndefineProperties>
  1680.      </AnnotatedProjects>
  1681.  
  1682.      <!-- If the project is RID agnostic, undefine the RuntimeIdentifier property to avoid another evaluation. -->
  1683.      <AnnotatedProjects Condition="'@(AnnotatedProjects)' == '%(Identity)' and '%(AnnotatedProjects.IsRidAgnostic)' == 'true'">
  1684.        <UndefineProperties>%(AnnotatedProjects.UndefineProperties);RuntimeIdentifier</UndefineProperties>
  1685.      </AnnotatedProjects>
  1686.  
  1687.      <!--
  1688.         Remove the items we've touched from _MSBuildProjectReferenceExistent. This will leave all projects where
  1689.          SkipGetTargetFrameworkProperties was set. Then add all AnnotatedProjects back.
  1690.       -->
  1691.       <_MSBuildProjectReferenceExistent Remove="@(_MSBuildProjectReferenceExistent)" Condition="'%(_MSBuildProjectReferenceExistent.SkipGetTargetFrameworkProperties)' != 'true'" />
  1692.       <_MSBuildProjectReferenceExistent Include="@(AnnotatedProjects)" />
  1693.     </ItemGroup>
  1694.   </Target>
  1695.  
  1696.   <Target Name="GetTargetFrameworks"
  1697.           Returns="@(_ThisProjectBuildMetadata)">
  1698.     <ItemGroup>
  1699.       <_ThisProjectBuildMetadata Include="$(MSBuildProjectFullPath)">
  1700.         <TargetFrameworks Condition="'$(TargetFrameworks)' != ''">$(TargetFrameworks)</TargetFrameworks>
  1701.         <TargetFrameworks Condition="'$(TargetFrameworks)' == ''">$(TargetFramework)</TargetFrameworks>
  1702.         <HasSingleTargetFramework>true</HasSingleTargetFramework>
  1703.         <HasSingleTargetFramework Condition="'$(IsCrossTargetingBuild)' == 'true'">false</HasSingleTargetFramework>
  1704.         <!-- indicate to caller that project is RID agnostic so that a global property RuntimeIdentifier value can be removed -->
  1705.       <IsRidAgnostic>false</IsRidAgnostic>
  1706.       <IsRidAgnostic Condition=" '$(RuntimeIdentifier)' == '' and '$(RuntimeIdentifiers)' == '' ">true</IsRidAgnostic>
  1707.       </_ThisProjectBuildMetadata>
  1708.     </ItemGroup>
  1709.   </Target>
  1710.  
  1711.   <!--
  1712.     ============================================================
  1713.                                     GetTargetFrameworkProperties
  1714.  
  1715.     Overrridden by cross-targeting projects to return the set of
  1716.     properties (in the form "key1=value1;...keyN=valueN") needed
  1717.     to build it with the best target for the referring project's
  1718.    target framework.
  1719.  
  1720.    The referring project's $(TargetFrameworkMoniker) is passed
  1721.     in as $(ReferringTargetFramework)
  1722.   -->
  1723.   <Target Name="GetTargetFrameworkProperties" />
  1724.  
  1725.   <!--
  1726.     ============================================================
  1727.                                         PrepareProjectReferences
  1728.  
  1729.     Prepares project references for consumption by other targets.
  1730.  
  1731.         [IN]
  1732.         @(ProjectReference) - The list of project references.
  1733.  
  1734.         [OUT]
  1735.         @(ProjectReferenceWithConfiguration)   - Project references with apporpriate metadata
  1736.         @(_MSBuildProjectReferenceExistent)    - Subset of @(ProjectReferenceWithConfiguration) that exist
  1737.                                                  with added SetTargetFramework metadata for cross-targeting
  1738.         @(_MSBuildProjectReferenceNonExistent) - Subset of  @(ProjectReferenceWithConfiguration) that do not exist
  1739.     ============================================================
  1740.   -->
  1741.   <PropertyGroup>
  1742.     <PrepareProjectReferencesDependsOn>
  1743.       AssignProjectConfiguration;
  1744.       _SplitProjectReferencesByFileExistence;
  1745.       _GetProjectReferenceTargetFrameworkProperties
  1746.     </PrepareProjectReferencesDependsOn>
  1747.   </PropertyGroup>
  1748.   <Target Name="PrepareProjectReferences" DependsOnTargets="$(PrepareProjectReferencesDependsOn)" />
  1749.  
  1750.   <!--
  1751.     ============================================================
  1752.                                         ResolveProjectReferences
  1753.  
  1754.     Build referenced projects:
  1755.  
  1756.         [IN]
  1757.         @(ProjectReferenceWithConfiguration) - The list of project references.
  1758.  
  1759.         [OUT]
  1760.         @(_ResolvedNativeProjectReferencePaths) - Paths to referenced native projects.
  1761.         @(_ResolvedProjectReferencePaths) - Paths to referenced managed projects.
  1762.     ============================================================
  1763.     -->
  1764.   <!-- By default, the outputs of project references are passed to the compiler -->
  1765.   <ItemDefinitionGroup>
  1766.     <ProjectReference>
  1767.       <!-- Target to build in the project reference; by default, this property is blank, indicating the default targets-->
  1768.       <Targets>$(ProjectReferenceBuildTargets)</Targets>
  1769.       <!-- Extra item type to emit outputs of the destination into. Defaults to blank. To emit only into this list, set the ReferenceOutputAssembly metadata to false as well. -->
  1770.       <OutputItemType/>
  1771.       <ReferenceSourceTarget>ProjectReference</ReferenceSourceTarget>
  1772.     </ProjectReference>
  1773.   </ItemDefinitionGroup>
  1774.  
  1775.   <Target
  1776.       Name="ResolveProjectReferences"
  1777.       DependsOnTargets="PrepareProjectReferences"
  1778.       Returns="@(_ResolvedNativeProjectReferencePaths);@(_ResolvedProjectReferencePaths)">
  1779.  
  1780.     <!--
  1781.         When building this project from the IDE, just gather the referenced build outputs.
  1782.         The IDE will already have built the project, so there's no need to do it again here.
  1783.  
  1784.        The ContinueOnError setting is here so that, during project load, as
  1785.        much information as possible will be passed to the compilers.
  1786.        -->
  1787.  
  1788.    <MSBuild
  1789.        Projects="@(_MSBuildProjectReferenceExistent)"
  1790.        Targets="GetTargetPath"
  1791.        BuildInParallel="$(BuildInParallel)"
  1792.        Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform); %(_MSBuildProjectReferenceExistent.SetTargetFramework)"
  1793.        Condition="'%(_MSBuildProjectReferenceExistent.BuildReference)' == 'true' and '@(ProjectReferenceWithConfiguration)' != '' and ('$(BuildingInsideVisualStudio)' == 'true' or '$(BuildProjectReferences)' != 'true') and '$(VisualStudioVersion)' != '10.0' and '@(_MSBuildProjectReferenceExistent)' != ''"
  1794.        ContinueOnError="!$(BuildingProject)"
  1795.        RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
  1796.  
  1797.      <Output TaskParameter="TargetOutputs" ItemName="_ResolvedProjectReferencePaths" Condition="'%(_MSBuildProjectReferenceExistent.ReferenceOutputAssembly)'=='true'"/>
  1798.      <Output TaskParameter="TargetOutputs" ItemName="%(_MSBuildProjectReferenceExistent.OutputItemType)" Condition="'%(_MSBuildProjectReferenceExistent.OutputItemType)' != ''"/>
  1799.  
  1800.    </MSBuild>
  1801.  
  1802.    <!--
  1803.        QUIRKING FOR DEV10
  1804.  
  1805.        In the 4.0 version of the targets, we built the targets specified in the Targets metadata in addition to
  1806.        GetTargetPath when building in the IDE.  In 4.5, we changed this to just GetTargetPath because it was
  1807.        causing performance trouble with certain systems that specified targets that did a significant amount of
  1808.        work in the Targets metadata, expecting them to only build when doing a real build.
  1809.  
  1810.        However, that change broke C++ unit testing in Dev10 + 4.5 scenarios, because they required use of the
  1811.        Targets metadata in order to get design time builds to work properly.  Thus, we need to make sure we
  1812.        restore the Dev10 behavior when building on Dev10.
  1813.        -->
  1814.  
  1815.    <MSBuild
  1816.        Projects="@(_MSBuildProjectReferenceExistent)"
  1817.        Targets="%(_MSBuildProjectReferenceExistent.Targets);GetTargetPath"
  1818.        BuildInParallel="$(BuildInParallel)"
  1819.        Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform); %(_MSBuildProjectReferenceExistent.SetTargetFramework)"
  1820.        Condition="'%(_MSBuildProjectReferenceExistent.BuildReference)' == 'true' and '@(ProjectReferenceWithConfiguration)' != '' and ('$(BuildingInsideVisualStudio)' == 'true' or '$(BuildProjectReferences)' != 'true') and '$(VisualStudioVersion)' == '10.0' and '@(_MSBuildProjectReferenceExistent)' != ''"
  1821.        ContinueOnError="!$(BuildingProject)"
  1822.        RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
  1823.  
  1824.      <Output TaskParameter="TargetOutputs" ItemName="_ResolvedProjectReferencePaths" Condition="'%(_MSBuildProjectReferenceExistent.ReferenceOutputAssembly)'=='true'"/>
  1825.      <Output TaskParameter="TargetOutputs" ItemName="%(_MSBuildProjectReferenceExistent.OutputItemType)" Condition="'%(_MSBuildProjectReferenceExistent.OutputItemType)' != ''"/>
  1826.  
  1827.    </MSBuild>
  1828.  
  1829.    <!--
  1830.        Build referenced projects when building from the command line.
  1831.        -->
  1832.    <MSBuild
  1833.        Projects="@(_MSBuildProjectReferenceExistent)"
  1834.        Targets="%(_MSBuildProjectReferenceExistent.Targets)"
  1835.        BuildInParallel="$(BuildInParallel)"
  1836.        Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform);  %(_MSBuildProjectReferenceExistent.SetTargetFramework)"
  1837.        Condition="'%(_MSBuildProjectReferenceExistent.BuildReference)' == 'true' and '@(ProjectReferenceWithConfiguration)' != '' and '$(BuildingInsideVisualStudio)' != 'true' and '$(BuildProjectReferences)' == 'true' and '@(_MSBuildProjectReferenceExistent)' != ''"
  1838.        ContinueOnError="$(ContinueOnError)"
  1839.        RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
  1840.  
  1841.      <Output TaskParameter="TargetOutputs" ItemName="_ResolvedProjectReferencePaths" Condition="'%(_MSBuildProjectReferenceExistent.ReferenceOutputAssembly)'=='true' or '$(DesignTimeBuild)' == 'true'"/>
  1842.      <Output TaskParameter="TargetOutputs" ItemName="%(_MSBuildProjectReferenceExistent.OutputItemType)" Condition="'%(_MSBuildProjectReferenceExistent.OutputItemType)' != ''"/>
  1843.  
  1844.    </MSBuild>
  1845.  
  1846.    <!--
  1847.        Get manifest items from the (non-exe) built project references (to feed them into ResolveNativeReference).
  1848.        -->
  1849.    <MSBuild
  1850.        Projects="@(_MSBuildProjectReferenceExistent)"
  1851.        Targets="GetNativeManifest"
  1852.        BuildInParallel="$(BuildInParallel)"
  1853.        Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform); %(_MSBuildProjectReferenceExistent.SetTargetFramework)"
  1854.        Condition="'%(_MSBuildProjectReferenceExistent.BuildReference)' == 'true' and '@(ProjectReferenceWithConfiguration)' != '' and '$(BuildingProject)' == 'true' and '@(_MSBuildProjectReferenceExistent)' != ''"
  1855.        ContinueOnError="$(ContinueOnError)"
  1856.        SkipNonexistentTargets="true"
  1857.        RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
  1858.  
  1859.      <Output TaskParameter="TargetOutputs" ItemName="NativeReference" Condition="'%(_MSBuildProjectReferenceExistent.ReferenceOutputAssembly)' == 'true'"/>
  1860.    </MSBuild>
  1861.  
  1862.    <ItemGroup>
  1863.      <_ResolvedProjectReferencePaths Remove="@(_ResolvedProjectReferencePaths)" Condition="'%(_ResolvedProjectReferencePaths.ResolveableAssembly)' == 'false'" />
  1864.      <!--
  1865.          Copy OriginalItemSpec to OriginalProjectReferenceItemSpec, so that when ResolveAssemblyReferences
  1866.          takes these items and resolves them to ReferencePath, we can still recover the _real_ OriginalItemSpec
  1867.          for the unresolved reference items.
  1868.          -->
  1869.      <_ResolvedProjectReferencePaths>
  1870.        <OriginalProjectReferenceItemSpec>%(_ResolvedProjectReferencePaths.OriginalItemSpec)</OriginalProjectReferenceItemSpec>
  1871.      </_ResolvedProjectReferencePaths>
  1872.    </ItemGroup>
  1873.  
  1874.    <!-- Issue a warning for each non-existent project. -->
  1875.    <Warning
  1876.        Text="The referenced project '%(_MSBuildProjectReferenceNonexistent.Identity)' does not exist."
  1877.        Condition="'@(ProjectReferenceWithConfiguration)' != '' and '@(_MSBuildProjectReferenceNonexistent)' != ''"/>
  1878.  
  1879.  </Target>
  1880.  
  1881.  <Target
  1882.    Name="ResolveProjectReferencesDesignTime"
  1883.    Returns="@(_ProjectReferencesFromRAR);@(_ResolvedNativeProjectReferencePaths)"
  1884.    DependsOnTargets="ResolveProjectReferences;ResolveAssemblyReferences">
  1885.    <!-- We need to do this here because we only want project references which have passed through rar and have not been unresolved due to violating some MT rule
  1886.        which means we need to pull the project references out of the referencepath item because they will only exist there if they were correctly resolved.
  1887.    -->
  1888.    <ItemGroup>
  1889.      <_ProjectReferencesFromRAR Include="@(ReferencePath->WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))">
  1890.        <OriginalItemSpec>%(ReferencePath.ProjectReferenceOriginalItemSpec)</OriginalItemSpec>
  1891.      </_ProjectReferencesFromRAR>
  1892.    </ItemGroup>
  1893.  </Target>
  1894.  
  1895.  <Target
  1896.   Name="ExpandSDKReferencesDesignTime"
  1897.   Returns="@(ReferencesFromSDK)"
  1898.   DependsOnTargets="ExpandSDKReferences"/>
  1899.  
  1900.  <!--
  1901.    ============================================================
  1902.                                        GetTargetPath
  1903.  
  1904.    This target returns an item containing the build product (i.e. EXE, DLL)
  1905.    that would be produced if we built this project, with some relevant
  1906.    metadata.
  1907.    ============================================================
  1908.    -->
  1909.  <PropertyGroup>
  1910.    <GetTargetPathDependsOn>$(GetTargetPathDependsOn)</GetTargetPathDependsOn>
  1911.  </PropertyGroup>
  1912.  
  1913.  <Target
  1914.      Name="GetTargetPath"
  1915.      DependsOnTargets="$(GetTargetPathDependsOn)"
  1916.      Returns="@(TargetPathWithTargetPlatformMoniker)" />
  1917.  
  1918.  <!--
  1919.    ============================================================
  1920.                                        GetTargetPathWithTargetPlatformMoniker
  1921.  
  1922.    This stand-alone target returns the name and version of the target platform for this project.
  1923.  
  1924.    NOTE: The ProjectReference protocol uses only GetTargetPath. Computing the item
  1925.    in this target allows projects to override GetTargetPath without having to reimplement
  1926.    the details of the metadata computation.
  1927.    ============================================================
  1928.    -->
  1929.  <PropertyGroup>
  1930.    <GetTargetPathWithTargetPlatformMonikerDependsOn>$(GetTargetPathDependsOn)</GetTargetPathWithTargetPlatformMonikerDependsOn>
  1931.  </PropertyGroup>
  1932.  
  1933.  <!--NOTE: since an overridden GetTargetPath might not include a DependsOn
  1934.      for this target, it's safer to establish the dependency here with a
  1935.       BeforeTargets. -->
  1936.   <Target
  1937.       Name="GetTargetPathWithTargetPlatformMoniker"
  1938.       BeforeTargets="GetTargetPath"
  1939.       DependsOnTargets="$(GetTargetPathWithTargetPlatformMonikerDependsOn)"
  1940.       Returns="@(TargetPathWithTargetPlatformMoniker)">
  1941.     <ItemGroup>
  1942.       <TargetPathWithTargetPlatformMoniker Include="$(TargetPath)">
  1943.         <TargetPlatformMoniker>$(TargetPlatformMoniker)</TargetPlatformMoniker>
  1944.         <TargetPlatformIdentifier>$(TargetPlatformIdentifier)</TargetPlatformIdentifier>
  1945.         <TargetFrameworkIdentifier>$(TargetFrameworkIdentifier)</TargetFrameworkIdentifier>
  1946.         <TargetFrameworkVersion>$(TargetFrameworkVersion.TrimStart('vV'))</TargetFrameworkVersion>
  1947.         <ReferenceAssembly Condition="'$(ProduceReferenceAssembly)' == 'true'">$(TargetRefPath)</ReferenceAssembly>
  1948.         <CopyUpToDateMarker>@(CopyUpToDateMarker)</CopyUpToDateMarker>
  1949.       </TargetPathWithTargetPlatformMoniker>
  1950.     </ItemGroup>
  1951.   </Target>
  1952.  
  1953.   <!--
  1954.     ============================================================
  1955.                                         GetNativeManifest
  1956.  
  1957.     Compute the manifest item for this project.
  1958.  
  1959.         [IN]
  1960.         $(_DeploymentApplicationManifestIdentity) - the manifest identity
  1961.         @(ApplicationManifest)         - the original application manifest item
  1962.  
  1963.         [OUT]
  1964.         @(ComputedApplicationManifest) - application manifest item with full hint path, if generated
  1965.     ============================================================
  1966.     -->
  1967.   <Target
  1968.       Name="GetNativeManifest"
  1969.       Returns="@(ComputedApplicationManifest)">
  1970.  
  1971.     <ItemGroup>
  1972.       <ComputedApplicationManifest Include="$(_DeploymentApplicationManifestIdentity)" Condition="'$(OutputType)'!='winexe' and '$(OutputType)'!='exe' and '$(OutputType)'!='appcontainerexe' and Exists('%(_ApplicationManifestFinal.FullPath)')">
  1973.         <HintPath>%(_ApplicationManifestFinal.FullPath)</HintPath>
  1974.       </ComputedApplicationManifest>
  1975.     </ItemGroup>
  1976.  
  1977.   </Target>
  1978.  
  1979.   <!--
  1980.     ============================================================
  1981.                                         ResolveNativeReferences
  1982.  
  1983.     Resolve native references
  1984.  
  1985.         [IN]
  1986.         @(NativeReference) - The manifest reference (or list of manifest references)
  1987.  
  1988.         [OUT]
  1989.         @(NativeReferenceFile)  - List of manifest files referenced.
  1990.         @(_DeploymentNativePrerequisite)   - List of native assembly prerequisites contained in the manifest.
  1991.         @(ComClassReference)    - List of COM components contained in the manifest.
  1992.         @(COMReferenceFromNative) List of type libraries contained in the manifest.
  1993.         @(COMFileReference)     - List of loose files contained in the manifest.
  1994.         @(_DeploymentLooseManifestFile)    - List of extra files that should be published.
  1995.     ============================================================
  1996.     -->
  1997.   <Target
  1998.       Name="ResolveNativeReferences"
  1999.       Condition="'@(NativeReference)'!=''"
  2000.       DependsOnTargets="ResolveProjectReferences">
  2001.  
  2002.     <ResolveNativeReference
  2003.         NativeReferences="@(NativeReference)"
  2004.         AdditionalSearchPaths="$(ReferencePath);$(OutDir)"
  2005.             >
  2006.       <Output TaskParameter="ContainingReferenceFiles" ItemName="NativeReferenceFile"/>
  2007.       <Output TaskParameter="ContainedPrerequisiteAssemblies" ItemName="_DeploymentNativePrerequisite"/>
  2008.       <Output TaskParameter="ContainedComComponents" ItemName="ComClassReference"/>
  2009.       <Output TaskParameter="ContainedTypeLibraries" ItemName="COMReferenceFromNative"/>
  2010.       <Output TaskParameter="ContainedLooseTlbFiles" ItemName="COMFileReference"/>
  2011.       <Output TaskParameter="ContainedLooseEtcFiles" ItemName="_DeploymentLooseManifestFile"/>
  2012.     </ResolveNativeReference>
  2013.  
  2014.   </Target>
  2015.  
  2016.   <!--
  2017.     ============================================================
  2018.  
  2019.                                         ResolveAssemblyReferences
  2020.  
  2021.     Given the list of assemblies, find the closure of all assemblies that they depend on. These are
  2022.     what we need to copy to the output directory.
  2023.  
  2024.         [IN]
  2025.         @(Reference) - List of assembly references as fusion names.
  2026.         @(_ResolvedProjectReferencePaths) - List of project references produced by projects that this project depends on.
  2027.  
  2028.             The 'Private' attribute on the reference corresponds to the Copy Local flag in IDE.
  2029.             The 'Private' flag can have three possible values:
  2030.                 - 'True' means the reference should be Copied Local
  2031.                 - 'False' means the reference should not be Copied Local
  2032.                 - [Missing] means this task will decide whether to treat this reference as CopyLocal or not.
  2033.  
  2034.         [OUT]
  2035.         @(ReferencePath) - Paths to resolved primary files.
  2036.         @(ReferenceDependencyPaths) - Paths to resolved dependency files.
  2037.         @(_ReferenceRelatedPaths) - Paths to .xmls and .pdbs.
  2038.         @(ReferenceSatellitePaths) - Paths to satellites.
  2039.         @(_ReferenceSerializationAssemblyPaths) - Paths to XML serialization assemblies created by sgen.
  2040.         @(_ReferenceScatterPaths) - Paths to scatter files.
  2041.         @(ReferenceCopyLocalPaths) - Paths to files that should be copied to the local directory.
  2042.     ============================================================
  2043.     -->
  2044.   <PropertyGroup>
  2045.     <ResolveAssemblyReferencesDependsOn>
  2046.       ResolveProjectReferences;
  2047.       FindInvalidProjectReferences;
  2048.       GetFrameworkPaths;
  2049.       GetReferenceAssemblyPaths;
  2050.       PrepareForBuild;
  2051.       ResolveSDKReferences;
  2052.       ExpandSDKReferences;
  2053.     </ResolveAssemblyReferencesDependsOn>
  2054.   </PropertyGroup>
  2055.   <Target
  2056.       Name="ResolveAssemblyReferences"
  2057.       Returns="@(ReferencePath)"
  2058.       DependsOnTargets="$(ResolveAssemblyReferencesDependsOn)">
  2059.  
  2060.     <ItemGroup>
  2061.       <_ReferenceInstalledAssemblyDirectory Include="$(TargetFrameworkDirectory)" />
  2062.       <_ReferenceInstalledAssemblySubsets Include="$(TargetFrameworkSubset)" />
  2063.     </ItemGroup>
  2064.  
  2065.     <!--
  2066.         Only read and write cache file at build time, skip it for load time because its more
  2067.         expensive to write the newly created cache file.
  2068.         -->
  2069.     <PropertyGroup>
  2070.       <ResolveAssemblyReferencesStateFile Condition="'$(DisableRarCache)'!='true' and '$(ResolveAssemblyReferencesStateFile)' == ''">$(IntermediateOutputPath)$(MSBuildProjectFile)AssemblyReference.cache</ResolveAssemblyReferencesStateFile>
  2071.     </PropertyGroup>
  2072.  
  2073.     <!-- Make an App.Config item that exists when AutoUnify is false. -->
  2074.     <ItemGroup>
  2075.       <_ResolveAssemblyReferencesApplicationConfigFileForExes Include="@(AppConfigWithTargetPath)" Condition="'$(AutoGenerateBindingRedirects)'=='true' or '$(AutoUnifyAssemblyReferences)'=='false'"/>
  2076.     </ItemGroup>
  2077.  
  2078.     <PropertyGroup>
  2079.       <!-- Default in task is true -->
  2080.       <_FindDependencies Condition="'$(BuildingProject)' != 'true' and '$(_ResolveReferenceDependencies)' != 'true'">false</_FindDependencies>
  2081.       <ResolveAssemblyReferencesSilent Condition="'$(ResolveAssemblyReferencesSilent)' == '' and '$(TraceDesignTime)' != 'true' and '$(BuildingProject)' == 'false'">true</ResolveAssemblyReferencesSilent>
  2082.       <ResolveAssemblyReferencesSilent Condition="'$(ResolveAssemblyReferencesSilent)' == ''">false</ResolveAssemblyReferencesSilent>
  2083.       <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch Condition="'$(ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch)' == ''">Warning</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
  2084.     </PropertyGroup>
  2085.  
  2086.     <ItemGroup>
  2087.       <!-- Remove any references which we have added as explicit reference so that we do not get duplicates. We need to make sure we do not have duplicates
  2088.              because this confuses the IDE  when it tries to compare the list of references passed in to the list of resolved references. If it does not match then the
  2089.              ide will show one of the references as not resolved, this will not break the build but is a display issue -->
  2090.       <Reference Remove="$(AdditionalExplicitAssemblyReferences)"/>
  2091.       <Reference Include="$(AdditionalExplicitAssemblyReferences)">
  2092.         <Implicit>true</Implicit>
  2093.       </Reference>
  2094.     </ItemGroup>
  2095.  
  2096.     <!--
  2097.       Normally, as an optimization, finding dependencies of references marked with ExternallyResolved=true metadata is skipped.
  2098.       However, skipping that step breaks binding redirect generation when there are conflicting versions within the externally
  2099.       resolved graph.
  2100.     -->
  2101.     <PropertyGroup Condition="'$(FindDependenciesOfExternallyResolvedReferences)' == ''">
  2102.        <FindDependenciesOfExternallyResolvedReferences>false</FindDependenciesOfExternallyResolvedReferences>
  2103.        <FindDependenciesOfExternallyResolvedReferences Condition="'$(AutoGenerateBindingRedirects)' == 'true'">true</FindDependenciesOfExternallyResolvedReferences>
  2104.     </PropertyGroup>
  2105.  
  2106.     <ResolveAssemblyReference
  2107.         Assemblies="@(Reference)"
  2108.         AssemblyFiles="@(_ResolvedProjectReferencePaths);@(_ExplicitReference)"
  2109.         TargetFrameworkDirectories="@(_ReferenceInstalledAssemblyDirectory)"
  2110.         InstalledAssemblyTables="@(InstalledAssemblyTables);@(RedistList)"
  2111.         IgnoreDefaultInstalledAssemblyTables="$(IgnoreDefaultInstalledAssemblyTables)"
  2112.         IgnoreDefaultInstalledAssemblySubsetTables="$(IgnoreInstalledAssemblySubsetTables)"
  2113.         CandidateAssemblyFiles="@(Content);@(None)"
  2114.         SearchPaths="$(AssemblySearchPaths)"
  2115.         AllowedAssemblyExtensions="$(AllowedReferenceAssemblyFileExtensions)"
  2116.         AllowedRelatedFileExtensions="$(AllowedReferenceRelatedFileExtensions)"
  2117.         TargetProcessorArchitecture="$(ProcessorArchitecture)"
  2118.         AppConfigFile="@(_ResolveAssemblyReferencesApplicationConfigFileForExes)"
  2119.         AutoUnify="$(AutoUnifyAssemblyReferences)"
  2120.         SupportsBindingRedirectGeneration="$(GenerateBindingRedirectsOutputType)"
  2121.         IgnoreVersionForFrameworkReferences="$(IgnoreVersionForFrameworkReferences)"
  2122.         FindDependencies="$(_FindDependencies)"
  2123.         FindSatellites="$(BuildingProject)"
  2124.         FindSerializationAssemblies="$(BuildingProject)"
  2125.         FindRelatedFiles="$(BuildingProject)"
  2126.         Silent="$(ResolveAssemblyReferencesSilent)"
  2127.         TargetFrameworkVersion="$(TargetFrameworkVersion)"
  2128.         TargetFrameworkMoniker="$(TargetFrameworkMoniker)"
  2129.         TargetFrameworkMonikerDisplayName="$(TargetFrameworkMonikerDisplayName)"
  2130.         TargetedRuntimeVersion="$(TargetedRuntimeVersion)"
  2131.         StateFile="$(ResolveAssemblyReferencesStateFile)"
  2132.         InstalledAssemblySubsetTables="@(InstalledAssemblySubsetTables)"
  2133.         TargetFrameworkSubsets="@(_ReferenceInstalledAssemblySubsets)"
  2134.         FullTargetFrameworkSubsetNames="$(FullReferenceAssemblyNames)"
  2135.         FullFrameworkFolders="$(_FullFrameworkReferenceAssemblyPaths)"
  2136.         FullFrameworkAssemblyTables="@(FullFrameworkAssemblyTables)"
  2137.         ProfileName="$(TargetFrameworkProfile)"
  2138.         LatestTargetFrameworkDirectories="@(LatestTargetFrameworkDirectories)"
  2139.         CopyLocalDependenciesWhenParentReferenceInGac="$(CopyLocalDependenciesWhenParentReferenceInGac)"
  2140.         DoNotCopyLocalIfInGac="$(DoNotCopyLocalIfInGac)"
  2141.         ResolvedSDKReferences="@(ResolvedSDKReference)"
  2142.         WarnOrErrorOnTargetArchitectureMismatch="$(ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch)"
  2143.         IgnoreTargetFrameworkAttributeVersionMismatch ="$(ResolveAssemblyReferenceIgnoreTargetFrameworkAttributeVersionMismatch)"
  2144.         FindDependenciesOfExternallyResolvedReferences="$(FindDependenciesOfExternallyResolvedReferences)"
  2145.         ContinueOnError="$(ContinueOnError)"
  2146.         Condition="'@(Reference)'!='' or '@(_ResolvedProjectReferencePaths)'!='' or '@(_ExplicitReference)' != ''"
  2147.         >
  2148.  
  2149.       <Output TaskParameter="ResolvedFiles" ItemName="ReferencePath"/>
  2150.       <Output TaskParameter="ResolvedFiles" ItemName="_ResolveAssemblyReferenceResolvedFiles"/>
  2151.       <Output TaskParameter="ResolvedDependencyFiles" ItemName="ReferenceDependencyPaths"/>
  2152.       <Output TaskParameter="RelatedFiles" ItemName="_ReferenceRelatedPaths"/>
  2153.       <Output TaskParameter="SatelliteFiles" ItemName="ReferenceSatellitePaths"/>
  2154.       <Output TaskParameter="SerializationAssemblyFiles" ItemName="_ReferenceSerializationAssemblyPaths"/>
  2155.       <Output TaskParameter="ScatterFiles" ItemName="_ReferenceScatterPaths"/>
  2156.       <Output TaskParameter="CopyLocalFiles" ItemName="ReferenceCopyLocalPaths"/>
  2157.       <Output TaskParameter="SuggestedRedirects" ItemName="SuggestedBindingRedirects"/>
  2158.       <Output TaskParameter="FilesWritten" ItemName="FileWrites"/>
  2159.       <Output TaskParameter="DependsOnSystemRuntime" PropertyName="DependsOnSystemRuntime"/>
  2160.       <Output TaskParameter="DependsOnNETStandard" PropertyName="_DependsOnNETStandard"/>
  2161.     </ResolveAssemblyReference>
  2162.   </Target>
  2163.  
  2164.   <!--
  2165.     ============================================================
  2166.  
  2167.                                         FindReferenceAssembliesForReferences
  2168.  
  2169.     Given the list of references, create a list of assemblies to pass to the compiler that
  2170.     includes reference assemblies rather than implementation assemblies where possible.
  2171.  
  2172.         [IN]
  2173.         @(ReferencePath) - List of assembly references as resolved paths with ReferenceAssembly metadata
  2174.  
  2175.         [OUT]
  2176.         @(ReferencePathWithRefAssemblies) - Paths to resolved reference (or implementation) assemblies.
  2177.     ============================================================
  2178.     -->
  2179.   <Target Name="FindReferenceAssembliesForReferences"
  2180.           DependsOnTargets="ResolveReferences">
  2181.     <ItemGroup>
  2182.       <!-- Reference assemblies are not produced in all cases, but it's easier to consume them
  2183.           if this metadatum is always populated. Ensure that it points to the implementation
  2184.           assembly unless already specified. -->
  2185.      <ReferencePath Condition="'%(ReferencePath.ReferenceAssembly)' == ''">
  2186.        <ReferenceAssembly>%(FullPath)</ReferenceAssembly>
  2187.      </ReferencePath>
  2188.  
  2189.      <ReferencePathWithRefAssemblies Include="@(ReferencePath->'%(ReferenceAssembly)')"
  2190.                                      Condition="'$(CompileUsingReferenceAssemblies)' != 'false'">
  2191.        <OriginalPath Condition="'%(ReferencePath.Identity)' != '@(ReferencePath->'%(ReferenceAssembly)')'">%(ReferencePath.Identity)</OriginalPath>
  2192.      </ReferencePathWithRefAssemblies>
  2193.      <ReferencePathWithRefAssemblies Include="@(ReferencePath)"
  2194.                                      Condition="'$(CompileUsingReferenceAssemblies)' == 'false'" />
  2195.    </ItemGroup>
  2196.  </Target>
  2197.  
  2198.  <!--
  2199.    ====================================================================================================
  2200.  
  2201.                                        GenerateBindingRedirects
  2202.    Inject the binding redirects into the app config file based on suggested redirects as output from
  2203.    ResolveAssemblyReferences.
  2204.  
  2205.        [IN]
  2206.        @(AppConfigWithTargetPath) - Path to the source app config file. This can be null if the project
  2207.                                     doesn't contain an app config file.
  2208.         $(TargetFileName) -          The file name of the build target.
  2209.  
  2210.         [OUT]
  2211.         @(OutputAppConfigFile) -     Path to the output app config file in the intermediate directory.
  2212.  
  2213.     ====================================================================================================
  2214.   -->
  2215.   <Target Name="GenerateBindingRedirects"
  2216.     Inputs="$(MSBuildAllProjects);@(AppConfigFile);$(ResolveAssemblyReferencesStateFile);$(IntermediateOutputPath);@(SuggestedBindingRedirects)"
  2217.     Outputs="$(_GenerateBindingRedirectsIntermediateAppConfig)"
  2218.     Condition="'$(AutoGenerateBindingRedirects)' == 'true' and '$(GenerateBindingRedirectsOutputType)' == 'true'">
  2219.  
  2220.     <GenerateBindingRedirects
  2221.       AppConfigFile="@(AppConfigWithTargetPath)"
  2222.       TargetName="$(TargetFileName).config"
  2223.       OutputAppConfigFile="$(_GenerateBindingRedirectsIntermediateAppConfig)"
  2224.       SuggestedRedirects="@(SuggestedBindingRedirects)"
  2225.       >
  2226.  
  2227.       <Output TaskParameter="OutputAppConfigFile" ItemName="FileWrites" />
  2228.  
  2229.     </GenerateBindingRedirects>
  2230.  
  2231.   </Target>
  2232.  
  2233.   <!--
  2234.     ====================================================================================================
  2235.  
  2236.                                         GenerateBindingRedirectsUpdateAppConfig
  2237.     Updates the project to use the generated app.config content.  This needs to run regardless of
  2238.     inputs/outputs so it is seperate from GenerateBindingRedirects.
  2239.     ====================================================================================================
  2240.   -->
  2241.   <Target Name="GenerateBindingRedirectsUpdateAppConfig"
  2242.     AfterTargets="GenerateBindingRedirects"
  2243.     Condition="'$(AutoGenerateBindingRedirects)' == 'true' and '$(GenerateBindingRedirectsOutputType)' == 'true' and Exists('$(_GenerateBindingRedirectsIntermediateAppConfig)')">
  2244.  
  2245.     <PropertyGroup>
  2246.       <AppConfig>$(_GenerateBindingRedirectsIntermediateAppConfig)</AppConfig>
  2247.     </PropertyGroup>
  2248.     <ItemGroup>
  2249.       <AppConfigWithTargetPath Remove="@(AppConfigWithTargetPath)" />
  2250.       <AppConfigWithTargetPath Include="$(AppConfig)">
  2251.         <TargetPath>$(TargetFileName).config</TargetPath>
  2252.       </AppConfigWithTargetPath>
  2253.     </ItemGroup>
  2254.  
  2255.   </Target>
  2256.  
  2257.   <!--
  2258.     ===========================================================================================
  2259.                                         GetInstalledSDKs
  2260.  
  2261.     Gets the list of SDKs installed in the SDKDirectoryRoot and SDKRegistryRoot locations
  2262.  
  2263.     These paths are used by the ResolveSDKReference task and the ResolveAssemblyReference task.
  2264.     ===========================================================================================
  2265.   -->
  2266.   <PropertyGroup>
  2267.     <SDKReferenceRegistryRoot Condition="'$(SDKReferenceRegistryRoot)' == ''">Software\Microsoft\Microsoft SDKs</SDKReferenceRegistryRoot>
  2268.     <SDKReferenceDirectoryRoot Condition="'$(SDKReferenceDirectoryRoot)' == ''">$(LocalAppData)\Microsoft SDKs;$(MSBuildProgramFiles32)\Microsoft SDKs</SDKReferenceDirectoryRoot>
  2269.     <!-- Manifest driven extension SDK locations -->
  2270.     <SDKExtensionDirectoryRoot Condition="'$(SDKExtensionDirectoryRoot)' == '' and '$(SDKIdentifier)' != ''">$(MSBuildProgramFiles32)\Microsoft SDKs\Windows Kits\10;$(MSBuildProgramFiles32)\Windows Kits\10</SDKExtensionDirectoryRoot>
  2271.  
  2272.     <!-- UAP projects by default should support Windows 8.1 SDKs -->
  2273.     <SupportWindows81SDKs Condition="'$(SupportWindows81SDKs)' == '' and '$(Support81SDKs)' != 'false' and '$(TargetPlatformIdentifier)' == 'UAP'">true</SupportWindows81SDKs>
  2274.     <TargetPlatformIdentifierWindows81 Condition="'$(TargetPlatformIdentifierWindows81)' == '' and '$(SupportWindows81SDKs)' == 'true'">Windows</TargetPlatformIdentifierWindows81>
  2275.     <TargetPlatformVersionWindows81 Condition="'$(TargetPlatformVersionWindows81)' == '' and '$(SupportWindows81SDKs)' == 'true'">8.1</TargetPlatformVersionWindows81>
  2276.  
  2277.     <!-- Desktop and phone SDKs often have the exact same identifiers, don't enable phone by default -->
  2278.    <SupportWindowsPhone81SDKs Condition="'$(SupportWindowsPhone81SDKs)' == '' and '$(Support81SDKs)' != 'false' and '$(TargetPlatformIdentifier)' == 'UAP'">false</SupportWindowsPhone81SDKs>
  2279.    <TargetPlatformIdentifierWindowsPhone81 Condition="'$(TargetPlatformIdentifierWindowsPhone81)' == '' and '$(SupportWindowsPhone81SDKs)' == 'true'">WindowsPhoneApp</TargetPlatformIdentifierWindowsPhone81>
  2280.    <TargetPlatformVersionWindowsPhone81 Condition="'$(TargetPlatformVersionWindowsPhone81)' == '' and '$(SupportWindowsPhone81SDKs)' == 'true'">8.1</TargetPlatformVersionWindowsPhone81>
  2281.  </PropertyGroup>
  2282.  
  2283.  <Target
  2284.      Name="GetInstalledSDKLocations"
  2285.      Condition="'@(SDKReference)' != ''"
  2286.      DependsOnTargets="$(GetInstalledSDKLocationsDependsOn)"
  2287.      Returns="@(InstalledSDKLocations)"
  2288.      >
  2289.  
  2290.    <GetInstalledSDKLocations
  2291.           SDKDirectoryRoots="$(SDKReferenceDirectoryRoot)"
  2292.           SDKExtensionDirectoryRoots="$(SDKExtensionDirectoryRoot)"
  2293.           SDKRegistryRoot="$(SDKReferenceRegistryRoot)"
  2294.           TargetPlatformVersion="$(TargetPlatformVersion)"
  2295.           TargetPlatformIdentifier="$(TargetPlatformIdentifier)"
  2296.           >
  2297.      <Output TaskParameter="InstalledSDKs" ItemName="InstalledSDKLocations"/>
  2298.    </GetInstalledSDKLocations>
  2299.  
  2300.    <!-- Also lookup 8.1 SDKs if requested -->
  2301.    <GetInstalledSDKLocations
  2302.           SDKDirectoryRoots="$(SDKReferenceDirectoryRoot)"
  2303.           SDKExtensionDirectoryRoots=""
  2304.           SDKRegistryRoot="$(SDKReferenceRegistryRoot)"
  2305.           TargetPlatformVersion="$(TargetPlatformVersionWindows81)"
  2306.           TargetPlatformIdentifier="$(TargetPlatformIdentifierWindows81)"
  2307.           Condition="'$(SupportWindows81SDKs)' == 'true' and '$(TargetPlatformIdentifierWindows81)' != '' and '$(TargetPlatformVersionWindows81)' != ''"
  2308.           WarnWhenNoSDKsFound="false"
  2309.           >
  2310.      <Output TaskParameter="InstalledSDKs" ItemName="InstalledSDKLocations"/>
  2311.    </GetInstalledSDKLocations>
  2312.  
  2313.    <GetInstalledSDKLocations
  2314.           SDKDirectoryRoots="$(SDKReferenceDirectoryRoot)"
  2315.           SDKExtensionDirectoryRoots=""
  2316.           SDKRegistryRoot="$(SDKReferenceRegistryRoot)"
  2317.           TargetPlatformVersion="$(TargetPlatformVersionWindowsPhone81)"
  2318.           TargetPlatformIdentifier="$(TargetPlatformIdentifierWindowsPhone81)"
  2319.           Condition="'$(SupportWindowsPhone81SDKs)' == 'true' and '$(TargetPlatformIdentifierWindowsPhone81)' != '' and '$(TargetPlatformVersionWindowsPhone81)' != ''"
  2320.           WarnWhenNoSDKsFound="false"
  2321.           >
  2322.      <Output TaskParameter="InstalledSDKs" ItemName="InstalledSDKLocations"/>
  2323.    </GetInstalledSDKLocations>
  2324.  
  2325.  </Target>
  2326.  
  2327.  <!--
  2328.    ============================================================
  2329.  
  2330.                                        ResolveSDKReferences
  2331.  
  2332.    Given a list of SDKReference items and a list of resolved winmd files which may contain metadata as to which sdk they came from
  2333.    we need to find the sdk root folders on disk and populate a ResolvedSDKReference item which has the full path to the SDK ROOT
  2334.    and the sdk identity as a piece of metadata.
  2335.  
  2336.        [IN]
  2337.        @(SDKReference) - List of sdk references (the identity in the sdk manifest file).
  2338.        @(ReferencePath) -List of resolved assemblies, we are interested in the ones which have IsWinMDFile set to true.
  2339.  
  2340.        [OUT]
  2341.        @(ResolvedSDKReference) - Full path to the root of the SDK
  2342.    ============================================================
  2343.  -->
  2344.  <PropertyGroup>
  2345.    <ResolveSDKReferencesDependsOn>
  2346.      GetInstalledSDKLocations
  2347.    </ResolveSDKReferencesDependsOn>
  2348.  </PropertyGroup>
  2349.  
  2350.  <PropertyGroup>
  2351.    <TargetedSDKConfiguration Condition="'$(TargetedSDKConfiguration)' == '' and '_$(Configuration)' == '_Debug'">Debug</TargetedSDKConfiguration>
  2352.    <TargetedSDKConfiguration Condition="'$(TargetedSDKConfiguration)' == '' and '_$(Configuration)' == '_Release'">Retail</TargetedSDKConfiguration>
  2353.    <TargetedSDKConfiguration Condition="'$(TargetedSDKConfiguration)' == ''">Retail</TargetedSDKConfiguration>
  2354.    <TargetedSDKArchitecture Condition="'$(TargetedSDKArchitecture)' == ''">$(ProcessorArchitecture)</TargetedSDKArchitecture>
  2355.    <TargetedSDKArchitecture Condition="'$(TargetedSDKArchitecture)' == ''">Neutral</TargetedSDKArchitecture>
  2356.  </PropertyGroup>
  2357.  
  2358.  <PropertyGroup>
  2359.    <ShouldMarkCertainSDKReferencesAsRuntimeOnly Condition="'$(ShouldMarkCertainSDKReferencesAsRuntimeOnly)' == ''">true</ShouldMarkCertainSDKReferencesAsRuntimeOnly>
  2360.  </PropertyGroup>
  2361.  
  2362.  <ItemGroup Condition="'$(ShouldMarkCertainSDKReferencesAsRuntimeOnly)' == 'true'">
  2363.    <!-- Dependencies that are specified as runtime-only dependencies. Therefore the associated files are not used to build Appx package.  -->
  2364.    <!-- TODO: Do we need to do anything like this for the new SDK? -->
  2365.    <RuntimeReferenceOnlySDKDependencies Condition = "'$(TargetPlatformVersion)' == '8.1'" Include="Microsoft.VCLibs, Version=11.0"/>
  2366.  </ItemGroup>
  2367.  
  2368.  <Target
  2369.      Name="ResolveSDKReferences"
  2370.      Returns="@(ResolvedSDKReference)"
  2371.      DependsOnTargets="$(ResolveSDKReferencesDependsOn)">
  2372.  
  2373.    <ResolveSDKReference
  2374.           SDKReferences="@(SDKReference)"
  2375.           RuntimeReferenceOnlySDKDependencies="@(RuntimeReferenceOnlySDKDependencies)"
  2376.           References="@(Reference)"
  2377.           TargetPlatformVersion="$(TargetPlatformVersion)"
  2378.           TargetPlatformIdentifier="$(TargetPlatformIdentifier)"
  2379.           WarnOnMissingPlatformVersion="$(SDKReferenceWarnOnMissingMaxPlatformVersion)"
  2380.           ProjectName="$(MSBuildProjectName)"
  2381.           TargetedSDKConfiguration="$(TargetedSDKConfiguration)"
  2382.           TargetedSDKArchitecture="$(TargetedSDKArchitecture)"
  2383.           InstalledSDKs ="@(InstalledSDKLocations)"
  2384.           LogResolutionErrorsAsWarnings ="$(LogSDKReferenceResolutionErrorsAsWarnings)"
  2385.           Prefer32Bit ="$(Prefer32Bit)"
  2386.           ContinueOnError="$(ContinueOnError)"
  2387.           Condition="'@(SDKReference)'!=''">
  2388.      <Output TaskParameter="ResolvedSDKReferences" ItemName="ResolvedSDKReference"/>
  2389.    </ResolveSDKReference>
  2390.  </Target>
  2391.  
  2392.   <Target
  2393.      Name="ResolveSDKReferencesDesignTime"
  2394.      Returns="@(ResolvedSDKReference)"
  2395.      DependsOnTargets="ResolveSDKReferences" />
  2396.  
  2397.  <!--
  2398.    ============================================================
  2399.  
  2400.                                        FindInvalidProjectReferences
  2401.  
  2402.    Find project to project references with target platform version higher than the one used by the current project and
  2403.    creates a list of invalid references to be unresolved. It issues a warning for each invalid reference.
  2404.  
  2405.        [IN]
  2406.        $(TargetPlatformVersion) - Project's target platform version
  2407.         @(_ProjectReferenceTargetPlatformMonikers) - List of monikers of all referenced projects gathered by the helper
  2408.                                                      target GetTargetPlatformMonikers.
  2409.  
  2410.         [OUT]
  2411.     @(InvalidProjectReferences) - List of invalid project references
  2412.  
  2413.     ============================================================
  2414.     -->
  2415.  
  2416.   <PropertyGroup>
  2417.     <FindInvalidProjectReferencesDependsOn>
  2418.       GetReferenceTargetPlatformMonikers
  2419.     </FindInvalidProjectReferencesDependsOn>
  2420.   </PropertyGroup>
  2421.  
  2422.    <Target
  2423.       Name="FindInvalidProjectReferences"
  2424.       Condition ="'$(FindInvalidProjectReferences)' == 'true'"
  2425.       DependsOnTargets="$(FindInvalidProjectReferencesDependsOn)">
  2426.  
  2427.      <FindInvalidProjectReferences
  2428.          TargetPlatformVersion="$(TargetPlatformVersion)"
  2429.          TargetPlatformIdentifier="$(TargetPlatformIdentifier)"
  2430.          ProjectReferences="@(TargetPathWithTargetPlatformMoniker)">
  2431.        <Output TaskParameter="InvalidReferences" ItemName="InvalidProjectReferences" />
  2432.      </FindInvalidProjectReferences>
  2433.  
  2434.      <ItemGroup>
  2435.        <_ResolvedProjectReferencePaths Remove="@(InvalidProjectReferences)" />
  2436.      </ItemGroup>
  2437.    </Target>
  2438.  
  2439.   <Target Name="GetReferenceTargetPlatformMonikers" DependsOnTargets="PrepareProjectReferences">
  2440.     <MSBuild
  2441.       Projects="@(_MSBuildProjectReferenceExistent)"
  2442.       Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform); %(_MSBuildProjectReferenceExistent.SetTargetFramework)"
  2443.       Targets="GetTargetPathWithTargetPlatformMoniker"
  2444.       BuildInParallel="$(BuildInParallel)"
  2445.       ContinueOnError="!$(BuildingProject)"
  2446.       RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
  2447.  
  2448.       <Output TaskParameter="TargetOutputs" ItemName="TargetPathWithTargetPlatformMoniker" />
  2449.     </MSBuild>
  2450.   </Target>
  2451.  
  2452.    <!--
  2453.     ============================================================
  2454.  
  2455.                        ExpandSDKReferences
  2456.  
  2457.         After we have resolved the sdk refrence we need to make sure that we automatically include the references which are part of the SDK (both winmd and dll)
  2458.         as part of the assemblies passed to the compiler.
  2459.  
  2460.         Project systems or project which do not want to reference all dlls or winmd files should override this target to do nothing.
  2461.    ============================================================
  2462.     -->
  2463.   <PropertyGroup>
  2464.     <ExpandSDKReferencesDependsOn>
  2465.       ResolveSDKReferences
  2466.     </ExpandSDKReferencesDependsOn>
  2467.  
  2468.     <ExpandSDKAllowedReferenceExtensions Condition="'$(ExpandSDKAllowedReferenceExtensions)' == ''">
  2469.       .winmd;
  2470.       .dll
  2471.     </ExpandSDKAllowedReferenceExtensions>
  2472.   </PropertyGroup>
  2473.  
  2474.    <Target Name="ExpandSDKReferences"
  2475.            Returns="@(ReferencesFromSDK)"
  2476.            DependsOnTargets="$(ExpandSDKReferencesDependsOn)"
  2477.     >
  2478.      <GetSDKReferenceFiles
  2479.        ResolvedSDKReferences="@(ResolvedSDKReference)"
  2480.        ReferenceExtensions="$(ExpandSDKAllowedReferenceExtensions)"
  2481.        TargetSDKIdentifier="$(SDKIdentifier)"
  2482.        TargetSDKVersion="$(SDKVersion)"
  2483.        TargetPlatformIdentifier="$(TargetPlatformIdentifier)"
  2484.        TargetPlatformVersion="$(TargetPlatformVersion)"
  2485.        LogRedistFilesList="$(GetSDKReferenceFilesLogRedistFilesList)"
  2486.        LogRedistConflictWithinSDKAsWarning ="$(GetSDKReferenceFilesLogRedistConflictsWithinSDKAsWarning)"
  2487.        LogRedistConflictBetweenSDKsAsWarning ="$(GetSDKReferenceFilesLogRedistConflictsBetweenSDKsAsWarning)"
  2488.        LogReferencesList="$(GetSDKReferenceFilesLogReferencesList)"
  2489.        LogReferenceConflictWithinSDKAsWarning ="$(GetSDKReferenceFilesLogReferenceConflictsWithinSDKAsWarning)"
  2490.        LogReferenceConflictBetweenSDKsAsWarning ="$(GetSDKReferenceFilesLogReferenceConflictsBetweenSDKsAsWarning)"
  2491.        CacheFileFolderPath ="$(GetSDKReferenceFilesCacheFolder)"
  2492.        LogCacheFileExceptions="$(GetSDKReferenceFilesLogCacheFileExceptions)"
  2493.        Condition="'@(ResolvedSDKReference)'!=''">
  2494.  
  2495.        <Output TaskParameter="References" ItemName="ReferencePath"/>
  2496.        <Output TaskParameter="References" ItemName="ReferencesFromSDK"/>
  2497.        <Output TaskParameter="References" ItemName="_ResolveAssemblyReferenceResolvedFiles"/>
  2498.        <Output TaskParameter="CopyLocalFiles" ItemName="ReferenceCopyLocalPaths"/>
  2499.        <Output TaskParameter="RedistFiles" ItemName="ResolvedRedistFiles"/>
  2500.      </GetSDKReferenceFiles>
  2501.    </Target>
  2502.  
  2503.   <!--
  2504.     ============================================================
  2505.  
  2506.                                         ExportWindowsMDFile
  2507.  
  2508.     When a project is generating a a winmd file through c# or vb, ect the compiler will create a WinMDModule file. This file needs to be run
  2509.     through the winmdexp tool in order to generate the resulting WinMD file.
  2510.  
  2511.     ===========================================================
  2512.     -->
  2513.  
  2514.     <Target Name="ExportWindowsMDFile"
  2515.           DependsOnTargets="Compile"
  2516.           Condition="'$(ExportWinMDFile)' == 'true'"
  2517.           Inputs="@(IntermediateAssembly);@(DocFileItem);@(_DebugSymbolsIntermediatePath);@(ReferencePathWithRefAssemblies);$(MSBuildAllProjects)"
  2518.           Outputs="$(_IntermediateWindowsMetadataPath);$(WinMDExpOutputPdb);$(WinMDOutputDocumentationFile)"
  2519.   >
  2520.  
  2521.       <PropertyGroup>
  2522.         <!-- Will be copied by the "copy WinMD artifacts" step instead -->
  2523.         <CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
  2524.         <CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
  2525.         <CopyDocumentationFileToOutputDirectory>false</CopyDocumentationFileToOutputDirectory>
  2526.  
  2527.         <WinMdExpToolPath Condition="'$(WinMdExpToolPath)' == ''">$(TargetFrameworkSDKToolsDirectory)</WinMdExpToolPath>
  2528.         <WinMdExpUTF8Ouput Condition="'$(WinMdExpUTF8Ouput)' == ''">true</WinMdExpUTF8Ouput>
  2529.       </PropertyGroup>
  2530.  
  2531.       <WinMDExp WinMDModule="@(IntermediateAssembly)"
  2532.                 References="@(ReferencePathWithRefAssemblies)"
  2533.                 DisabledWarnings="$(WinMdExpNoWarn)"
  2534.                 InputDocumentationFile="@(DocFileItem)"
  2535.                 OutputDocumentationFile="$(WinMDOutputDocumentationFile)"
  2536.                 TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
  2537.                 InputPDBFile="@(_DebugSymbolsIntermediatePath)"
  2538.                 OutputPDBFile="$(WinMDExpOutputPdb)"
  2539.                 OutputWindowsMetadataFile="$(_IntermediateWindowsMetadataPath)"
  2540.                 EnvironmentVariables="$(WinMDExpEnvironment)"
  2541.                 UTF8Output="$(WinMdExpUTF8Ouput)"
  2542.                 SdkToolsPath="$(WinMdExpToolPath)"
  2543.                 AssemblyUnificationPolicy="$(WinMDExpAssemblyUnificationPolicy)">
  2544.       <Output TaskParameter="OutputWindowsMetadataFile" ItemName="FileWrites"/>
  2545.      </WinMDExp>
  2546.  
  2547.      <ItemGroup>
  2548.          <WinMDExpArtifacts Include="$(_IntermediateWindowsMetadataPath)"/>
  2549.          <WinMDExpArtifacts Include="$(WinMDOutputDocumentationFile)"/>
  2550.          <WinMDExpArtifacts Include="$(WinMDExpOutputPdb)"/>
  2551.          <FileWrites Include="$(WinMDOutputDocumentationFile);$(WinMDExpOutputPdb)"/>
  2552.     </ItemGroup>
  2553.   </Target>
  2554.  
  2555.   <Target
  2556.       Name="ResolveAssemblyReferencesDesignTime"
  2557.       Returns="@(_ReferencesFromRAR)"
  2558.       DependsOnTargets="ResolveProjectReferences;ResolveAssemblyReferences">
  2559.  
  2560.     <!-- We need to do this here because we only want references which have been passed into rar but are not project to project references. -->
  2561.     <ItemGroup>
  2562.       <_ReferencesFromRAR Include="@(ReferencePath->WithMetadataValue('ReferenceSourceTarget', 'ResolveAssemblyReference'))"/>
  2563.     </ItemGroup>
  2564.   </Target>
  2565.  
  2566.   <PropertyGroup>
  2567.     <ProjectDesignTimeAssemblyResolutionSearchPaths Condition=" '$(ProjectDesignTimeAssemblyResolutionSearchPaths)' == '' ">
  2568.       {CandidateAssemblyFiles};
  2569.       $(ReferencePath);
  2570.       {HintPathFromItem};
  2571.       {TargetFrameworkDirectory};
  2572.       {Registry:$(FrameworkRegistryBase),$(TargetFrameworkVersion),$(AssemblyFoldersSuffix)$(AssemblyFoldersExConditions)};
  2573.       {RawFileName};
  2574.       $(TargetDir)
  2575.     </ProjectDesignTimeAssemblyResolutionSearchPaths>
  2576.   </PropertyGroup>
  2577.  
  2578.   <!--
  2579.     ==============================================================
  2580.  
  2581.                                        DesignTimeResolveAssemblyReferences
  2582.  
  2583.     Given the list of assemblies, resolve their reference paths.
  2584.     This target is called by Visual Studio at run time in order to filter references
  2585.     according to the targeted framework.
  2586.  
  2587.         [IN]
  2588.         @(DesignTimeReference) - List of assembly references as simple/fusion names.
  2589.  
  2590.  
  2591.         [OUT]
  2592.         @(ReferencePath) - Paths to resolved primary files.
  2593.  
  2594.     ==============================================================
  2595.     -->
  2596.   <PropertyGroup>
  2597.     <DesignTimeResolveAssemblyReferencesDependsOn>
  2598.       GetFrameworkPaths;
  2599.       GetReferenceAssemblyPaths;
  2600.       ResolveReferences
  2601.     </DesignTimeResolveAssemblyReferencesDependsOn>
  2602.   </PropertyGroup>
  2603.  
  2604.   <Target
  2605.       Name="DesignTimeResolveAssemblyReferences"
  2606.       Condition="'$(DesignTimeReference)'!=''"
  2607.       DependsOnTargets="$(DesignTimeResolveAssemblyReferencesDependsOn)">
  2608.  
  2609.     <ItemGroup>
  2610.       <_DesignTimeReferenceInstalledAssemblyDirectory Include="$(TargetFrameworkDirectory)" />
  2611.     </ItemGroup>
  2612.  
  2613.     <PropertyGroup>
  2614.       <DesignTimeResolveAssemblyReferencesStateFile Condition="'$(DisableRarCache)'!='true'">$(IntermediateOutputPath)$(MSBuildProjectFile)DesignTimeResolveAssemblyReferences.cache</DesignTimeResolveAssemblyReferencesStateFile>
  2615.     </PropertyGroup>
  2616.  
  2617.     <PropertyGroup>
  2618.       <DesignTimeAssemblySearchPaths Condition=" '$(DesignTimeAssemblySearchPaths)' == '' ">
  2619.         {CandidateAssemblyFiles};
  2620.         $(ReferencePath);
  2621.         {HintPathFromItem};
  2622.         {TargetFrameworkDirectory};
  2623.         {Registry:$(FrameworkRegistryBase),$(TargetFrameworkVersion),$(AssemblyFoldersSuffix)$(AssemblyFoldersExConditions)};
  2624.         {RawFileName};
  2625.         $(OutDir)
  2626.       </DesignTimeAssemblySearchPaths>
  2627.     </PropertyGroup>
  2628.  
  2629.     <PropertyGroup>
  2630.       <DesignTimeFindDependencies Condition=" '$(DesignTimeFindDependencies)' == '' ">false</DesignTimeFindDependencies>
  2631.       <DesignTimeIgnoreVersionForFrameworkReferences Condition=" '$(DesignTimeIgnoreVersionForFrameworkReferences)' == '' ">false</DesignTimeIgnoreVersionForFrameworkReferences>
  2632.       <DesignTimeFindSatellites Condition=" '$(DesignTimeFindSatellites)' == '' ">false</DesignTimeFindSatellites>
  2633.       <DesignTimeFindSerializationAssemblies Condition=" '$(DesignTimeFindSerializationAssemblies)' == '' ">false</DesignTimeFindSerializationAssemblies>
  2634.       <DesignTimeFindRelatedFiles Condition=" '$(DesignTimeFindRelatedFiles)' == '' ">false</DesignTimeFindRelatedFiles>
  2635.       <DesignTimeSilentResolution Condition=" '$(DesignTimeSilentResolution)' == '' and '$(TraceDesignTime)' != 'true'">true</DesignTimeSilentResolution>
  2636.       <DesignTimeAutoUnify Condition="'$(DesignTimeAutoUnify)' == ''">false</DesignTimeAutoUnify>
  2637.     </PropertyGroup>
  2638.  
  2639.     <ItemGroup>
  2640.       <_DesignTimeReferenceAssemblies Include ="$(DesignTimeReference)" />
  2641.     </ItemGroup>
  2642.  
  2643.     <ItemGroup>
  2644.       <_RARResolvedReferencePath Include="@(ReferencePath)" />
  2645.       <ReferencePath Remove="@(ReferencePath)" />
  2646.     </ItemGroup>
  2647.  
  2648.     <ResolveAssemblyReference
  2649.         Assemblies="@(_DesignTimeReferenceAssemblies)"
  2650.         TargetFrameworkDirectories="@(_DesignTimeReferenceInstalledAssemblyDirectory)"
  2651.         SearchPaths="$(DesignTimeAssemblySearchPaths)"
  2652.         AllowedAssemblyExtensions="$(AllowedReferenceAssemblyFileExtensions)"
  2653.         TargetProcessorArchitecture="$(ProcessorArchitecture)"
  2654.         CandidateAssemblyFiles="@(Content);@(None);@(_RARResolvedReferencePath)"
  2655.         FindDependencies="$(DesignTimeFindDependencies)"
  2656.         AutoUnify="$(DesignTimeAutoUnify)"
  2657.         IgnoreVersionForFrameworkReferences="$(DesignTimeIgnoreVersionForFrameworkReferences)"
  2658.         FindSatellites="$(DesignTimeFindSatellites)"
  2659.         FindSerializationAssemblies="$(DesignTimeFindSerializationAssemblies)"
  2660.         FindRelatedFiles="$(DesignTimeFindRelatedFiles)"
  2661.         Silent="$(DesignTimeSilentResolution)"
  2662.         TargetFrameworkVersion="$(TargetFrameworkVersion)"
  2663.         TargetFrameworkMoniker="$(TargetFrameworkMoniker)"
  2664.         TargetFrameworkMonikerDisplayName="$(TargetFrameworkMonikerDisplayName)"
  2665.         TargetedRuntimeVersion="$(TargetedRuntimeVersion)"
  2666.         StateFile="$(DesignTimeResolveAssemblyReferencesStateFile)"
  2667.         InstalledAssemblySubsetTables="@(InstalledAssemblySubsetTables)"
  2668.         IgnoreDefaultInstalledAssemblySubsetTables="$(IgnoreInstalledAssemblySubsetTables)"
  2669.         TargetFrameworkSubsets="@(_ReferenceInstalledAssemblySubsets)"
  2670.         FullTargetFrameworkSubsetNames="$(FullReferenceAssemblyNames)"
  2671.         FullFrameworkFolders="$(_FullFrameworkReferenceAssemblyPaths)"
  2672.         FullFrameworkAssemblyTables="@(FullFrameworkAssemblyTables)"
  2673.         ProfileName="$(TargetFrameworkProfile)"
  2674.         ResolvedSDKReferences="@(ResolvedSDKReference)"
  2675.         IgnoreTargetFrameworkAttributeVersionMismatch ="$(DesignTimeIgnoreTargetFrameworkAttributeVersionMismatch)"
  2676.        >
  2677.  
  2678.       <Output TaskParameter="ResolvedFiles" ItemName="DesignTimeReferencePath"/>
  2679.       <Output TaskParameter="FilesWritten" ItemName="FileWrites"/>
  2680.     </ResolveAssemblyReference>
  2681.   </Target>
  2682.  
  2683.   <!--
  2684.     ============================================================
  2685.                                         ResolveComReferences
  2686.  
  2687.     Resolve COM references
  2688.  
  2689.         [IN]
  2690.         @(COMReference) - The list of COM references
  2691.         $(BaseIntermediateOutputPath) - The output directory in which to generate wrapper assemblies
  2692.  
  2693.         [OUT]
  2694.         @(ReferencePath) - Paths to referenced wrappers.
  2695.  
  2696.         If ResolveComReferences is invoked from the IDE, PrepareForBuild may need to run to create directories.
  2697.     ============================================================
  2698.     -->
  2699.   <PropertyGroup>
  2700.     <ComReferenceExecuteAsTool Condition="'$(ComReferenceExecuteAsTool)'==''">false</ComReferenceExecuteAsTool>
  2701.   </PropertyGroup>
  2702.  
  2703.   <Target
  2704.       Name="ResolveComReferences"
  2705.       Condition="'@(COMReference)'!='' or '@(COMFileReference)'!=''"
  2706.       Returns="@(ReferencePath)"
  2707.       DependsOnTargets="PrepareForBuild;ResolveKeySource;ResolveAssemblyReferences"
  2708.         >
  2709.  
  2710.     <PropertyGroup Condition=" '$(InteropOutputPath)' == '' ">
  2711.       <InteropOutputPath>$(IntermediateOutputPath)</InteropOutputPath>
  2712.     </PropertyGroup>
  2713.  
  2714.     <MakeDir Directories="$(InteropOutputPath)"/>
  2715.  
  2716.     <!--
  2717.         Note: This task should not be batched, since it relies on having all the COM references fed into it at once.
  2718.         -->
  2719.     <PropertyGroup>
  2720.       <ResolveComReferenceMSBuildArchitecture Condition="'$(ResolveComReferenceMSBuildArchitecture)' == ''">$(PlatformTargetAsMSBuildArchitecture)</ResolveComReferenceMSBuildArchitecture>
  2721.  
  2722.       <ResolveComReferenceToolPath Condition="'$(ResolveComReferenceToolPath)' == ''">$(TargetFrameworkSDKToolsDirectory)</ResolveComReferenceToolPath>
  2723.       <ResolveComReferenceSilent Condition="'$(ResolveComReferenceSilent)' == ''">false</ResolveComReferenceSilent>
  2724.     </PropertyGroup>
  2725.  
  2726.     <ResolveComReference
  2727.           TypeLibNames="@(COMReference)"
  2728.           TypeLibFiles="@(COMFileReference)"
  2729.           ResolvedAssemblyReferences="@(ReferencePath)"
  2730.           WrapperOutputDirectory="$(InteropOutputPath)"
  2731.           IncludeVersionInInteropName="$(IncludeVersionInInteropName)"
  2732.           KeyContainer="$(KeyContainerName)"
  2733.           KeyFile="$(KeyOriginatorFile)"
  2734.           DelaySign="$(DelaySign)"
  2735.           StateFile="@(_ResolveComReferenceCache)"
  2736.           TargetFrameworkVersion="$(TargetFrameworkVersion)"
  2737.           TargetProcessorArchitecture="$(ProcessorArchitecture)"
  2738.           NoClassMembers="$(ComReferenceNoClassMembers)"
  2739.           Silent="$(ResolveComReferenceSilent)"
  2740.           EnvironmentVariables="$(ResolveComReferenceEnvironment)"
  2741.           SdkToolsPath="$(ResolveComReferenceToolPath)"
  2742.           ExecuteAsTool="$(ComReferenceExecuteAsTool)"
  2743.           MSBuildArchitecture="$(ResolveComReferenceMSBuildArchitecture)"
  2744.           ContinueOnError="$(ContinueOnError)">
  2745.  
  2746.       <Output TaskParameter="ResolvedFiles" ItemName="ReferencePath"/>
  2747.       <Output TaskParameter="ResolvedFiles" ItemName="ComReferenceWrappers"/>
  2748.       <Output TaskParameter="ResolvedFiles" ItemName="FileWrites"/>
  2749.       <!-- This output list only includes items with Isolated attribute set to True.  It's done by the task itself. -->
  2750.      <Output TaskParameter="ResolvedModules" ItemName="ResolvedIsolatedComModules"/>
  2751.  
  2752.    </ResolveComReference>
  2753.  
  2754.    <ItemGroup>
  2755.      <FileWrites Include="@(_ResolveComReferenceCache)"/>
  2756.      <ReferenceComWrappersToCopyLocal Include="@(ComReferenceWrappers)" Condition="'%(ComReferenceWrappers.CopyLocal)'!='false'"/>
  2757.    </ItemGroup>
  2758.  
  2759.  </Target>
  2760.  
  2761.  <Target
  2762.      Name="ResolveComReferencesDesignTime"
  2763.      Returns="@(ComReferenceWrappers)"
  2764.      DependsOnTargets="ResolveComReferences" />
  2765.  
  2766.  <!--
  2767.    ============================================================
  2768.                                      ResolveFrameworkReferences
  2769.  
  2770.    Overrridden by Microsoft.NET.Sdk to return
  2771.    ResolvedFrameworkReference items in order to populate the
  2772.    Frameworks node of the Solution Explorer in the IDE.
  2773.  -->
  2774.  <Target Name="ResolveFrameworkReferences" />
  2775.  
  2776.  <!--
  2777.    ***********************************************************************************************
  2778.    ***********************************************************************************************
  2779.                                                                PrepareResources Section
  2780.    ***********************************************************************************************
  2781.    ***********************************************************************************************
  2782.    -->
  2783.  
  2784.  <!--
  2785.    ============================================================
  2786.                                        PrepareResources
  2787.  
  2788.    Prepare resources for the Compile step.
  2789.    ============================================================
  2790.    -->
  2791.  <PropertyGroup>
  2792.    <PrepareResourcesDependsOn>
  2793.      PrepareResourceNames;
  2794.      ResGen;
  2795.      CompileLicxFiles
  2796.    </PrepareResourcesDependsOn>
  2797.  </PropertyGroup>
  2798.  <Target
  2799.      Name="PrepareResources"
  2800.      DependsOnTargets="$(PrepareResourcesDependsOn)"/>
  2801.  
  2802.  <!--
  2803.    ============================================================
  2804.                                        PrepareResourceNames
  2805.  
  2806.    Prepare the names of resource files.
  2807.    ============================================================
  2808.    -->
  2809.  <PropertyGroup>
  2810.    <PrepareResourceNamesDependsOn>
  2811.      AssignTargetPaths;
  2812.      SplitResourcesByCulture;
  2813.      CreateManifestResourceNames;
  2814.      CreateCustomManifestResourceNames
  2815.    </PrepareResourceNamesDependsOn>
  2816.  </PropertyGroup>
  2817.  <Target
  2818.      Name="PrepareResourceNames"
  2819.      DependsOnTargets="$(PrepareResourceNamesDependsOn)"/>
  2820.  
  2821.  <!--
  2822.    ============================================================
  2823.                                        AssignTargetPaths
  2824.  
  2825.    This target creates <TargetPath> tags for items. <TargetPath> is a relative folder plus filename
  2826.    for the destination of this item.
  2827.    ============================================================
  2828.    -->
  2829.  <PropertyGroup>
  2830.    <AssignTargetPathsDependsOn></AssignTargetPathsDependsOn>
  2831.  </PropertyGroup>
  2832.  <Target
  2833.      Name="AssignTargetPaths"
  2834.      DependsOnTargets="$(AssignTargetPathsDependsOn)">
  2835.  
  2836.    <ItemGroup>
  2837.      <_Temporary Remove="@(_Temporary)" />
  2838.    </ItemGroup>
  2839.  
  2840.    <!-- AssignTargetPath generates TargetPath metadata that is consumed by CreateManifestResourceNames target for manifest name generation -->
  2841.    <AssignTargetPath Files="@(EmbeddedResource)" RootFolder="$(MSBuildProjectDirectory)">
  2842.      <Output TaskParameter="AssignedFiles" ItemName="_Temporary" />
  2843.    </AssignTargetPath>
  2844.  
  2845.  
  2846.    <ItemGroup>
  2847.      <!-- Replace items in EmbeddedResource with the items emitted by the AssignTargetPath task that have the TargetPath metadata -->
  2848.      <EmbeddedResource Remove="@(_Temporary)" />
  2849.      <EmbeddedResource Include="@(_Temporary)" />
  2850.      <_Temporary Remove="@(_Temporary)" />
  2851.    </ItemGroup>
  2852.  
  2853.    <AssignTargetPath Files="@(Content)" RootFolder="$(MSBuildProjectDirectory)">
  2854.      <Output TaskParameter="AssignedFiles" ItemName="ContentWithTargetPath" />
  2855.    </AssignTargetPath>
  2856.  
  2857.    <AssignTargetPath Files="@(None)" RootFolder="$(MSBuildProjectDirectory)">
  2858.      <Output TaskParameter="AssignedFiles" ItemName="_NoneWithTargetPath" />
  2859.    </AssignTargetPath>
  2860.  
  2861.    <AssignTargetPath Files="@(BaseApplicationManifest)" RootFolder="$(MSBuildProjectDirectory)">
  2862.      <Output TaskParameter="AssignedFiles" ItemName="_DeploymentBaseManifestWithTargetPath"/>
  2863.    </AssignTargetPath>
  2864.  
  2865.    <AssignTargetPath Files="@(None)" RootFolder="$(MSBuildProjectDirectory)" Condition="'@(_DeploymentBaseManifestWithTargetPath)'=='' and '%(None.Extension)'=='.manifest'">
  2866.      <Output TaskParameter="AssignedFiles" ItemName="_DeploymentBaseManifestWithTargetPath" />
  2867.    </AssignTargetPath>
  2868.  
  2869.  </Target>
  2870.  
  2871.  <!--
  2872.    ============================================================
  2873.                                        GetItemTargetPaths
  2874.  
  2875.    This target returns all items that have TargetPath metadata assigned by the AssignTargetPaths target.
  2876.    ============================================================
  2877.    -->
  2878.  <Target
  2879.    Name="GetItemTargetPaths"
  2880.    DependsOnTargets="AssignTargetPaths"
  2881.    Returns="
  2882.      @(EmbeddedResource);
  2883.      @(ContentWithTargetPath);
  2884.      @(_NoneWithTargetPath);
  2885.      @(_DeploymentBaseManifestWithTargetPath);
  2886.      " />
  2887.  
  2888.  <!--
  2889.    ============================================================
  2890.                                        SplitResourcesByCulture
  2891.  
  2892.    Split EmbeddedResource items into five lists based on whether
  2893.    they are resx files, licx files or other resources and whether they should be localized. Also adds Type and Culture
  2894.    metadata. Type indicates whether the resource is "Resx" or "Non-Resx".
  2895.  
  2896.        [IN]/[OUT]
  2897.        @(EmbeddedResource) - The raw list of resources.
  2898.  
  2899.        [OUT]
  2900.        @(_LicxFile) - The EmbeddedResource items with extension equal to '.licx'.
  2901.    ============================================================
  2902.    -->
  2903.  <Target
  2904.      Name="SplitResourcesByCulture"
  2905.      DependsOnTargets="AssignTargetPaths">
  2906.  
  2907.    <Warning Condition="'@(ResxWithNoCulture)'!=''" Code="MSB9000" Text="ResxWithNoCulture item type is deprecated. Use EmbeddedResource items instead."/>
  2908.    <Warning Condition="'@(ResxWithCulture)'!=''" Code="MSB9001" Text="ResxWithCulture item type is deprecated. Use EmbeddedResource items instead."/>
  2909.    <Warning Condition="'@(NonResxWithCulture)'!=''" Code="MSB9002" Text="NonResxWithCulture item type is deprecated. Use EmbeddedResource items instead."/>
  2910.    <Warning Condition="'@(NonResxWithNoCulture)'!=''" Code="MSB9003" Text="NonResxWithNoCulture item type is deprecated. Use EmbeddedResource items instead."/>
  2911.  
  2912.    <ItemGroup>
  2913.      <_LicxFile Include="@(EmbeddedResource)" Condition="'%(Extension)'=='.licx'"/>
  2914.  
  2915.      <!-- CONSUMED FOR COMPATIBILITY REASONS ONLY. EMIT EMBEDDEDRESOURCE INSTEAD -->
  2916.      <EmbeddedResource Include="@(ResxWithNoCulture);@(ResxWithCulture)">
  2917.        <Type>Resx</Type>
  2918.      </EmbeddedResource>
  2919.      <EmbeddedResource Include="@(NonResxWithCulture);@(NonResxWithNoCulture)">
  2920.        <Type>Non-Resx</Type>
  2921.      </EmbeddedResource>
  2922.    </ItemGroup>
  2923.  
  2924.    <AssignCulture Files="@(EmbeddedResource)" Condition="'%(Extension)'!='.licx'">
  2925.      <!-- Create the list of culture resx and embedded resource files -->
  2926.      <Output TaskParameter="AssignedFilesWithCulture" ItemName="_MixedResourceWithCulture"/>
  2927.      <!-- Create the list of non-culture resx and embedded resource files -->
  2928.      <Output TaskParameter="AssignedFilesWithNoCulture" ItemName="_MixedResourceWithNoCulture"/>
  2929.    </AssignCulture>
  2930.  
  2931.    <ItemGroup>
  2932.  
  2933.      <!-- Remove EmbeddedResource items that we have processed already
  2934.                 i.e. either Licx, or resources that don't have culture info -->
  2935.       <EmbeddedResource Remove="@(_MixedResourceWithCulture)" />
  2936.       <EmbeddedResource Remove="@(_MixedResourceWithNoCulture)" />
  2937.       <EmbeddedResource Remove="@(_LicxFile)" />
  2938.  
  2939.       <!-- Add back everything except Licx, so that we have culture info -->
  2940.       <EmbeddedResource Include="@(_MixedResourceWithNoCulture);@(_MixedResourceWithCulture)" Condition="'%(Extension)'=='.resx' or '%(Extension)'=='.restext'">
  2941.         <Type Condition="'%(_MixedResourceWithNoCulture.Type)'=='' and '%(_MixedResourceWithCulture.Type)'==''">Resx</Type>
  2942.       </EmbeddedResource>
  2943.       <EmbeddedResource Include="@(_MixedResourceWithNoCulture);@(_MixedResourceWithCulture)" Condition="'%(Extension)'!='.resx' and '%(Extension)'!='.restext'">
  2944.         <Type Condition="'%(_MixedResourceWithNoCulture.Type)'=='' and '%(_MixedResourceWithCulture.Type)'==''">Non-Resx</Type>
  2945.       </EmbeddedResource>
  2946.  
  2947.       <!-- EMITTED FOR COMPATIBILITY REASONS ONLY. CONSUME EMBEDDEDRESOURCE INSTEAD -->
  2948.       <ResxWithNoCulture Remove="@(ResxWithNoCulture)"/>
  2949.       <NonResxWithNoCulture Remove="@(NonResxWithNoCulture)"/>
  2950.       <ResxWithCulture Remove="@(ResxWithCulture)"/>
  2951.       <NonResxWithCulture Remove="@(NonResxWithCulture)"/>
  2952.       <ResxWithNoCulture Include="@(_MixedResourceWithNoCulture)" Condition="'%(WithCulture)'=='false' and ('%(Extension)'=='.resx' or '%(Extension)'=='.restext')"/>
  2953.       <NonResxWithNoCulture Include="@(_MixedResourceWithNoCulture)" Condition="'%(WithCulture)'=='false' and ('%(Extension)'!='.resx' and '%(Extension)'!='.restext')"/>
  2954.       <ResxWithCulture Include="@(_MixedResourceWithCulture)" Condition="'%(WithCulture)'=='true' and ('%(Extension)'=='.resx' or '%(Extension)'=='.restext')"/>
  2955.       <NonResxWithCulture Include="@(_MixedResourceWithCulture)" Condition="'%(WithCulture)'=='true' and ('%(Extension)'!='.resx' and '%(Extension)'!='.restext')"/>
  2956.  
  2957.       <!-- Clean up temporary lists -->
  2958.       <_MixedResourceWithNoCulture Remove="@(_MixedResourceWithNoCulture)" />
  2959.       <_MixedResourceWithCulture Remove="@(_MixedResourceWithCulture)" />
  2960.  
  2961.     </ItemGroup>
  2962.  
  2963.   </Target>
  2964.  
  2965.   <!--
  2966.     =======================================================================
  2967.                                         CreateCustomManifestResourceNames
  2968.  
  2969.     Allows custom manifest resource name generation tasks to plug
  2970.     into the build process
  2971.     =======================================================================
  2972.     -->
  2973.   <PropertyGroup>
  2974.     <CreateCustomManifestResourceNamesDependsOn></CreateCustomManifestResourceNamesDependsOn>
  2975.   </PropertyGroup>
  2976.   <Target
  2977.       Name="CreateCustomManifestResourceNames"
  2978.       DependsOnTargets="$(CreateCustomManifestResourceNamesDependsOn)"/>
  2979.  
  2980.   <!--
  2981.     ============================================================
  2982.                                         ResGen
  2983.  
  2984.     Run GenerateResource on the given resx files.
  2985.  
  2986.     ============================================================
  2987.     -->
  2988.   <PropertyGroup>
  2989.     <ResGenDependsOn>ResolveAssemblyReferences;SplitResourcesByCulture;BeforeResGen;CoreResGen;AfterResGen</ResGenDependsOn>
  2990.     <CoreResGenDependsOn>FindReferenceAssembliesForReferences</CoreResGenDependsOn>
  2991.     <UseSourcePath Condition="'$(UseSourcePath)'==''">true</UseSourcePath>
  2992.     <ResGenExecuteAsTool Condition="'$(ResGenExecuteAsTool)'==''">false</ResGenExecuteAsTool>
  2993.   </PropertyGroup>
  2994.   <Target
  2995.       Name="ResGen"
  2996.       DependsOnTargets="$(ResGenDependsOn)"/>
  2997.  
  2998.   <!--
  2999.     ============================================================
  3000.                                         BeforeResGen
  3001.  
  3002.     Redefine this target in your project in order to run tasks just before Resgen.
  3003.     ============================================================
  3004.     -->
  3005.   <Target Name="BeforeResGen"/>
  3006.  
  3007.   <!--
  3008.     ============================================================
  3009.                                         AfterResGen
  3010.  
  3011.     Redefine this target in your project in order to run tasks just after Resgen.
  3012.     ============================================================
  3013.     -->
  3014.   <Target Name="AfterResGen"/>
  3015.  
  3016.   <!--
  3017.     ============================================================
  3018.                                         CoreResGen
  3019.     ============================================================
  3020.     -->
  3021.   <Target
  3022.       Name="CoreResGen"
  3023.       DependsOnTargets="$(CoreResGenDependsOn)">
  3024.  
  3025.     <ItemGroup>
  3026.       <_Temporary Remove="@(_Temporary)" />
  3027.     </ItemGroup>
  3028.  
  3029.     <PropertyGroup>
  3030.       <GenerateResourceMSBuildArchitecture Condition="'$(GenerateResourceMSBuildArchitecture)' == ''">$(PlatformTargetAsMSBuildArchitecture)</GenerateResourceMSBuildArchitecture>
  3031.      
  3032.       <ResgenToolPath Condition="'$(ResgenToolPath)' == ''">$(TargetFrameworkSDKToolsDirectory)</ResgenToolPath>
  3033.     </PropertyGroup>
  3034.  
  3035.     <PropertyGroup Condition="'$(TargetFrameworkAsMSBuildRuntime)' != '' and '$(GenerateResourceMSBuildArchitecture)' != ''">
  3036.       <!-- In the general case, we want to fail to run the task if the task host it's requesting doesn't exist, because we'd rather let the
  3037.           user know there's something wrong than just silently generate something that's probably not quite right. However, in a few
  3038.           circumstances, there are tasks that are already aware of runtime / bitness concerns, in which case even if we go ahead and run
  3039.           the more recent version of the task, it should be able to generate something correct.  GenerateResource is one such task, so
  3040.           we check for the existence of the targeted task host so that we can use it preferentially, but if it can't be found, we'll fall
  3041.           back to the current task since it's still mostly correct.
  3042.  
  3043.            In particular, we need to do this because otherwise people with Dev10 on a machine that they upgrade to Win8 will be broken:
  3044.            they'll have ResGen from the 7.0A SDK installed, so launching ResGen will still work, but the CLR2 task host is only installed by
  3045.           the 8.0A SDK, which they won't have installed, and thus without this fallback mechanism, their projects targeting v3.5 will
  3046.            suddenly start failing to build.-->
  3047.       <GenerateResourceMSBuildRuntime
  3048.           Condition="'$(GenerateResourceMSBuildRuntime)' == '' and
  3049.                     $([MSBuild]::DoesTaskHostExist(`$(TargetFrameworkAsMSBuildRuntime)`, `$(GenerateResourceMSBuildArchitecture)`))">$(TargetFrameworkAsMSBuildRuntime)</GenerateResourceMSBuildRuntime>
  3050.  
  3051.       <!-- If the targeted runtime doesn't exist, fall back to current -->
  3052.      <GenerateResourceMSBuildRuntime Condition="'$(GenerateResourceMSBuildRuntime)' == ''">CurrentRuntime</GenerateResourceMSBuildRuntime>
  3053.    </PropertyGroup>
  3054.  
  3055.    <!-- 4.0 task has some new parameters that we want to make use of if we're targeting 4.0 -->
  3056.     <GenerateResource
  3057.         Sources="@(EmbeddedResource)"
  3058.         UseSourcePath="$(UseSourcePath)"
  3059.         References="@(ReferencePathWithRefAssemblies)"
  3060.         UsePreserializedResources="$(GenerateResourceUsePreserializedResources)"
  3061.         AdditionalInputs="$(MSBuildAllProjects)"
  3062.         NeverLockTypeAssemblies="$(GenerateResourceNeverLockTypeAssemblies)"
  3063.         StateFile="$(IntermediateOutputPath)$(MSBuildProjectFile).GenerateResource.cache"
  3064.         StronglyTypedClassName="%(EmbeddedResource.StronglyTypedClassName)"
  3065.         StronglyTypedFileName="%(EmbeddedResource.StronglyTypedFileName)"
  3066.         StronglyTypedLanguage="%(EmbeddedResource.StronglyTypedLanguage)"
  3067.         StronglyTypedNamespace="%(EmbeddedResource.StronglyTypedNamespace)"
  3068.         StronglyTypedManifestPrefix="%(EmbeddedResource.StronglyTypedManifestPrefix)"
  3069.         PublicClass="%(EmbeddedResource.PublicClass)"
  3070.         OutputResources="@(EmbeddedResource->'$(IntermediateOutputPath)%(ManifestResourceName).resources')"
  3071.         Condition="'%(EmbeddedResource.Type)' == 'Resx' and '%(EmbeddedResource.GenerateResource)' != 'false' and '$(GenerateResourceMSBuildRuntime)' != 'CLR2'"
  3072.         SdkToolsPath="$(ResgenToolPath)"
  3073.         ExecuteAsTool="$(ResGenExecuteAsTool)"
  3074.         EnvironmentVariables="$(ResGenEnvironment)"
  3075.         MSBuildRuntime="$(GenerateResourceMSBuildRuntime)"
  3076.         MSBuildArchitecture="$(GenerateResourceMSBuildArchitecture)">
  3077.  
  3078.       <Output TaskParameter="FilesWritten" ItemName="FileWrites"/>
  3079.       <Output TaskParameter="StronglyTypedFileName" ItemName="Compile"/>
  3080.  
  3081.       <!-- Gather Sources as an output since it will contain OutputResource metadata indicating the final output resource that it was compiled into -->
  3082.       <Output TaskParameter="Sources" ItemName="_Temporary" />
  3083.  
  3084.     </GenerateResource>
  3085.  
  3086.     <!-- But we can't use those parameters if we're targeting 3.5, since we're using the 3.5 task -->
  3087.    <GenerateResource
  3088.        Sources="@(EmbeddedResource)"
  3089.        UseSourcePath="$(UseSourcePath)"
  3090.        References="@(ReferencePath)"
  3091.        AdditionalInputs="$(MSBuildAllProjects)"
  3092.        NeverLockTypeAssemblies="$(GenerateResourceNeverLockTypeAssemblies)"
  3093.        StateFile="$(IntermediateOutputPath)$(MSBuildProjectFile).GenerateResource.cache"
  3094.        StronglyTypedClassName="%(EmbeddedResource.StronglyTypedClassName)"
  3095.        StronglyTypedFileName="%(EmbeddedResource.StronglyTypedFileName)"
  3096.        StronglyTypedLanguage="%(EmbeddedResource.StronglyTypedLanguage)"
  3097.        StronglyTypedNamespace="%(EmbeddedResource.StronglyTypedNamespace)"
  3098.        StronglyTypedManifestPrefix="%(EmbeddedResource.StronglyTypedManifestPrefix)"
  3099.        PublicClass="%(EmbeddedResource.PublicClass)"
  3100.        OutputResources="@(EmbeddedResource->'$(IntermediateOutputPath)%(ManifestResourceName).resources')"
  3101.        MSBuildRuntime="$(GenerateResourceMSBuildRuntime)"
  3102.        MSBuildArchitecture="$(GenerateResourceMSBuildArchitecture)"
  3103.        Condition="'%(EmbeddedResource.Type)' == 'Resx' and '%(EmbeddedResource.GenerateResource)' != 'false' and '$(GenerateResourceMSBuildRuntime)' == 'CLR2'">
  3104.  
  3105.      <Output TaskParameter="FilesWritten" ItemName="FileWrites"/>
  3106.      <Output TaskParameter="StronglyTypedFileName" ItemName="Compile"/>
  3107.  
  3108.      <!-- Gather Sources as an output since it will contain OutputResource metadata indicating the final output resource that it was compiled into -->
  3109.      <Output TaskParameter="Sources" ItemName="_Temporary" />
  3110.  
  3111.    </GenerateResource>
  3112.  
  3113.    <ItemGroup>
  3114.      <EmbeddedResource Remove="@(_Temporary)" />
  3115.  
  3116.      <!-- Add back the Sources list (with OutputResource metadata) that we output from GenerateResource into EmbeddedResource -->
  3117.      <EmbeddedResource Include="@(_Temporary)" />
  3118.      <_Temporary Remove="@(_Temporary)" />
  3119.  
  3120.      <!-- EMITTED FOR COMPATIBILITY REASONS ONLY. CONSUME EMBEDDEDRESOURCE INSTEAD -->
  3121.      <ManifestResourceWithNoCulture Include="@(EmbeddedResource->'%(OutputResource)')" Condition="'%(EmbeddedResource.WithCulture)'=='false' and '%(EmbeddedResource.Type)' == 'Resx'">
  3122.        <EmittedForCompatibilityOnly>true</EmittedForCompatibilityOnly>
  3123.      </ManifestResourceWithNoCulture>
  3124.      <ManifestNonResxWithNoCultureOnDisk Include="@(EmbeddedResource)" Condition="'%(EmbeddedResource.WithCulture)'=='false' and '%(EmbeddedResource.Type)' == 'Non-Resx'">
  3125.        <EmittedForCompatibilityOnly>true</EmittedForCompatibilityOnly>
  3126.      </ManifestNonResxWithNoCultureOnDisk>
  3127.  
  3128.      <!-- EMITTED FOR COMPATIBILITY REASONS ONLY. CONSUME EMBEDDEDRESOURCE INSTEAD -->
  3129.      <ManifestResourceWithCulture Include="@(EmbeddedResource->'%(OutputResource)')" Condition="'%(EmbeddedResource.WithCulture)'=='true' and '%(EmbeddedResource.Type)' == 'Resx'">
  3130.        <EmittedForCompatibilityOnly>true</EmittedForCompatibilityOnly>
  3131.      </ManifestResourceWithCulture>
  3132.      <ManifestNonResxWithCultureOnDisk Include="@(EmbeddedResource)" Condition="'%(EmbeddedResource.WithCulture)'=='true' and '%(EmbeddedResource.Type)' == 'Non-Resx'">
  3133.        <EmittedForCompatibilityOnly>true</EmittedForCompatibilityOnly>
  3134.      </ManifestNonResxWithCultureOnDisk>
  3135.  
  3136.    </ItemGroup>
  3137.  
  3138.  </Target>
  3139.  
  3140.  <!--
  3141.    ============================================================
  3142.                                        CompileLicxFiles
  3143.  
  3144.    Compile .licx files (containing information about licensed controls used by the application) into .licenses files.
  3145.  
  3146.        [IN]
  3147.        @(_LicxFile) - The list of .licx files in the project (usually there will be just one)
  3148.  
  3149.        [OUT]
  3150.        @(CompiledLicenseFile) - The list of compiled .licenses files (there will be just one)
  3151.    ============================================================
  3152.    -->
  3153.  <PropertyGroup>
  3154.    <CompileLicxFilesDependsOn></CompileLicxFilesDependsOn>
  3155.  </PropertyGroup>
  3156.  <Target
  3157.      Name="CompileLicxFiles"
  3158.      Condition="'@(_LicxFile)'!=''"
  3159.      DependsOnTargets="$(CompileLicxFilesDependsOn)"
  3160.      Inputs="$(MSBuildAllProjects);@(_LicxFile);@(ReferencePathWithRefAssemblies);@(ReferenceDependencyPaths)"
  3161.      Outputs="$(IntermediateOutputPath)$(TargetFileName).licenses">
  3162.  
  3163.    <PropertyGroup>
  3164.      <LCMSBuildArchitecture Condition="'$(LCMSBuildArchitecture)' == ''">$(PlatformTargetAsMSBuildArchitecture)</LCMSBuildArchitecture>
  3165.    </PropertyGroup>
  3166.  
  3167.    <LC
  3168.        Sources="@(_LicxFile)"
  3169.        LicenseTarget="$(TargetFileName)"
  3170.        OutputDirectory="$(IntermediateOutputPath)"
  3171.        OutputLicense="$(IntermediateOutputPath)$(TargetFileName).licenses"
  3172.        ReferencedAssemblies="@(ReferencePathWithRefAssemblies);@(ReferenceDependencyPaths)"
  3173.        NoLogo="$(NoLogo)"
  3174.        ToolPath="$(LCToolPath)"
  3175.        SdkToolsPath="$(TargetFrameworkSDKToolsDirectory)"
  3176.        EnvironmentVariables="$(LCEnvironment)"
  3177.        MSBuildArchitecture="$(LCMSBuildArchitecture)"
  3178.        TargetFrameworkVersion="$(TargetFrameworkVersion)"
  3179.        >
  3180.  
  3181.      <Output TaskParameter="OutputLicense" ItemName="CompiledLicenseFile"/>
  3182.      <Output TaskParameter="OutputLicense" ItemName="FileWrites"/>
  3183.  
  3184.    </LC>
  3185.  
  3186.  </Target>
  3187.  
  3188.  
  3189.  
  3190.  
  3191.  <!--
  3192.    ***********************************************************************************************
  3193.    ***********************************************************************************************
  3194.                                                                ResolveKeySource Section
  3195.    ***********************************************************************************************
  3196.    ***********************************************************************************************
  3197.    -->
  3198.  
  3199.  <!--
  3200.    ============================================================
  3201.                                        ResolveKeySource
  3202.  
  3203.    Resolve the strong name key used to sign the assembly as well as the certificate used to
  3204.    sign the ClickOnce manifests.
  3205.  
  3206.        [IN]
  3207.        $(AssemblyOriginatorKeyFile)     - The file used to sign the assembly (.snk or .pfx)
  3208.        $(ManifestCertificateThumbprint) - The thumbprint used to locate the certificate in the
  3209.                                           user's certificate store.
  3210.         $(ManifestKeyFile)               - The key file that contains the certificate in case the
  3211.                                            certificate is not in the user's store.
  3212.  
  3213.        [OUT]
  3214.        $(ResolvedAssemblyKeyFile)        - Key used to sign the assembly
  3215.        $(_DeploymentResolvedManifestCertificateThumbprint) - Certificate used to sign the manifests
  3216.    ============================================================
  3217.    -->
  3218.  <Target
  3219.      Name="ResolveKeySource"
  3220.      Condition="$(SignManifests) == 'true' or $(SignAssembly) == 'true'">
  3221.  
  3222.    <ResolveKeySource
  3223.        KeyFile="$(AssemblyOriginatorKeyFile)"
  3224.        CertificateThumbprint="$(ManifestCertificateThumbprint)"
  3225.        CertificateFile="$(ManifestKeyFile)"
  3226.        SuppressAutoClosePasswordPrompt="$(BuildingInsideVisualStudio)"
  3227.        ShowImportDialogDespitePreviousFailures="$(BuildingProject)"
  3228.        ContinueOnError="!$(BuildingProject)"
  3229.          >
  3230.  
  3231.      <Output TaskParameter="ResolvedKeyFile" PropertyName="KeyOriginatorFile" Condition=" '$(SignAssembly)' == 'true' "/>
  3232.      <Output TaskParameter="ResolvedKeyContainer" PropertyName="KeyContainerName" Condition=" '$(SignAssembly)' == 'true' "/>
  3233.      <Output TaskParameter="ResolvedThumbprint" PropertyName="_DeploymentResolvedManifestCertificateThumbprint" Condition=" '$(SignManifests)' == 'true' "/>
  3234.  
  3235.    </ResolveKeySource>
  3236.  
  3237.  </Target>
  3238.  
  3239.  <!--
  3240.    ***********************************************************************************************
  3241.    ***********************************************************************************************
  3242.                                                                Compile Section
  3243.    ***********************************************************************************************
  3244.    ***********************************************************************************************
  3245.    -->
  3246.  
  3247.  <!--
  3248.    ============================================================
  3249.                                        Compile
  3250.    ============================================================
  3251.    -->
  3252.  <PropertyGroup>
  3253.    <CompileDependsOn>
  3254.      ResolveReferences;
  3255.      ResolveKeySource;
  3256.      SetWin32ManifestProperties;
  3257.      FindReferenceAssembliesForReferences;
  3258.      _GenerateCompileInputs;
  3259.      BeforeCompile;
  3260.      _TimeStampBeforeCompile;
  3261.      _GenerateCompileDependencyCache;
  3262.      CoreCompile;
  3263.      _TimeStampAfterCompile;
  3264.      AfterCompile;
  3265.    </CompileDependsOn>
  3266.  </PropertyGroup>
  3267.  <Target
  3268.      Name="Compile"
  3269.      DependsOnTargets="$(CompileDependsOn)"/>
  3270.  
  3271.  <!--
  3272.    ============================================================
  3273.                                        _GenerateCompileInputs
  3274.  
  3275.    Create the _CoreCompileResourceInputs list of inputs to the CoreCompile target.
  3276.    ============================================================
  3277.    -->
  3278.  <Target Name="_GenerateCompileInputs">
  3279.  
  3280.    <Warning Condition="'@(ManifestResourceWithNoCulture)'!='' and '%(ManifestResourceWithNoCulture.EmittedForCompatibilityOnly)'==''" Code="MSB9004" Text="ManifestResourceWithNoCulture item type is deprecated. Emit EmbeddedResource items instead, with metadata WithCulture='false', Type='Resx', and optional LogicalName."/>
  3281.    <Warning Condition="'@(ManifestNonResxWithNoCultureOnDisk)'!='' and '%(ManifestNonResxWithNoCultureOnDisk.EmittedForCompatibilityOnly)'==''" Code="MSB9005" Text="ManifestNonResxWithNoCultureOnDisk item type is deprecated. Emit EmbeddedResource items instead, with metadata WithCulture='false', Type='Non-Resx', and optional LogicalName."/>
  3282.  
  3283.    <ItemGroup>
  3284.  
  3285.      <!-- _CoreCompileResourceInputs is the list of TLDA inputs that should trigger CoreCompile, and are listed as inputs to that target -->
  3286.      <_CoreCompileResourceInputs Include="@(EmbeddedResource->'%(OutputResource)')" Condition="'%(EmbeddedResource.WithCulture)' == 'false' and '%(EmbeddedResource.Type)' == 'Resx'" />
  3287.      <_CoreCompileResourceInputs Include="@(EmbeddedResource)" Condition="'%(EmbeddedResource.WithCulture)' == 'false' and '%(EmbeddedResource.Type)' == 'Non-Resx' " />
  3288.  
  3289.      <!-- CONSUMED FOR COMPATIBILITY REASONS ONLY. EMIT EMBEDDEDRESOURCE INSTEAD -->
  3290.      <_CoreCompileResourceInputs Include="@(ManifestResourceWithNoCulture)" Condition="'%(ManifestResourceWithNoCulture.EmittedForCompatibilityOnly)'==''">
  3291.        <Type>Resx</Type>
  3292.        <WithCulture>false</WithCulture>
  3293.      </_CoreCompileResourceInputs>
  3294.      <_CoreCompileResourceInputs Include="@(ManifestNonResxWithNoCultureOnDisk)" Condition="'%(ManifestNonResxWithNoCultureOnDisk.EmittedForCompatibilityOnly)'==''">
  3295.        <Type>Non-Resx</Type>
  3296.        <WithCulture>false</WithCulture>
  3297.      </_CoreCompileResourceInputs>
  3298.  
  3299.    </ItemGroup>
  3300.  
  3301.  </Target>
  3302.  
  3303.  <!--
  3304.    ============================================================
  3305.                                        GenerateTargetFrameworkMonikerAttribute
  3306.  
  3307.    Emit the target framework moniker attribute as  a code fragment into a temporary source file for the compiler.
  3308.    ============================================================
  3309.    -->
  3310.  <PropertyGroup Condition="'$(TargetFrameworkMoniker)' != ''">
  3311.    <!-- Do not clean if we are going to default the path to the temp directory -->
  3312.    <TargetFrameworkMonikerAssemblyAttributesFileClean Condition="'$(TargetFrameworkMonikerAssemblyAttributesFileClean)' == '' and '$(TargetFrameworkMonikerAssemblyAttributesPath)' != ''">true</TargetFrameworkMonikerAssemblyAttributesFileClean>
  3313.    <TargetFrameworkMonikerAssemblyAttributesPath Condition="'$(TargetFrameworkMonikerAssemblyAttributesPath)' == ''">$([System.IO.Path]::Combine('$([System.IO.Path]::GetTempPath())','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath>
  3314.  </PropertyGroup>
  3315.  
  3316.  <PropertyGroup>
  3317.    <GenerateTargetFrameworkAttribute Condition="'$(GenerateTargetFrameworkAttribute)' == '' and '$(TargetFrameworkMoniker)' != '' and '$(TargetingClr2Framework)' != 'true'">true</GenerateTargetFrameworkAttribute>
  3318.  </PropertyGroup>
  3319.  
  3320.  <ItemGroup Condition="'$(TargetFrameworkMonikerAssemblyAttributesFileClean)' == 'true'">
  3321.    <Clean Include="$(TargetFrameworkMonikerAssemblyAttributesPath)"/>
  3322.  </ItemGroup>
  3323.  
  3324.  <Target Name="GenerateTargetFrameworkMonikerAttribute"
  3325.          BeforeTargets="BeforeCompile"
  3326.          DependsOnTargets="PrepareForBuild;GetReferenceAssemblyPaths"
  3327.          Inputs="$(MSBuildToolsPath)\Microsoft.Common.targets"
  3328.          Outputs="$(TargetFrameworkMonikerAssemblyAttributesPath)"
  3329.          Condition="'$(GenerateTargetFrameworkAttribute)' == 'true'">
  3330.  
  3331.    <!-- This is a file shared between projects so we have to take care to handle simultaneous writes (by ContinueOnError)
  3332.             and a race between clean from one project and build from another (by not adding to FilesWritten so it doesn't clean) -->
  3333.     <WriteLinesToFile
  3334.         File="$(TargetFrameworkMonikerAssemblyAttributesPath)"
  3335.         Lines="$(TargetFrameworkMonikerAssemblyAttributeText)"
  3336.         Overwrite="true"
  3337.         ContinueOnError="true"
  3338.         Condition="'@(Compile)' != '' and '$(TargetFrameworkMonikerAssemblyAttributeText)' != ''"
  3339.         />
  3340.  
  3341.     <ItemGroup Condition="'@(Compile)' != '' and '$(TargetFrameworkMonikerAssemblyAttributeText)' != ''">
  3342.       <Compile Include="$(TargetFrameworkMonikerAssemblyAttributesPath)"/>
  3343.       <!-- Do not put in FileWrites: this is a file shared between projects in %temp%, and cleaning it would create a race between projects during rebuild -->
  3344.     </ItemGroup>
  3345.   </Target>
  3346.  
  3347.  
  3348.   <!--
  3349.     ============================================================
  3350.                                         GenerateAdditionalSources
  3351.  
  3352.     Emit any specified code fragments into a temporary source file for the compiler.
  3353.     ============================================================
  3354.     -->
  3355.  
  3356.   <PropertyGroup Condition="'$(AssemblyAttributesPath)' != ''">
  3357.     <GenerateAdditionalSources Condition="'$(GenerateAdditionalSources)' == ''">true</GenerateAdditionalSources>
  3358.   </PropertyGroup>
  3359.  
  3360.   <ItemGroup Condition="'$(AssemblyAttributesPath)' != ''">
  3361.     <Clean Include="$(AssemblyAttributesPath)" Condition="'$(AssemblyAttributesFileClean)' != 'false'" />
  3362.   </ItemGroup>
  3363.  
  3364.   <Target Name="GenerateAdditionalSources"
  3365.           BeforeTargets="BeforeCompile"
  3366.           DependsOnTargets="PrepareForBuild;GetReferenceAssemblyPaths"
  3367.           Inputs="$(MSBuildAllProjects)"
  3368.           Outputs="$(AssemblyAttributesPath)"
  3369.           Condition="'@(AssemblyAttributes)' != '' and '$(GenerateAdditionalSources)' == 'true'">
  3370.     <WriteCodeFragment
  3371.           AssemblyAttributes="@(AssemblyAttributes)"
  3372.           OutputFile="$(AssemblyAttributesPath)"
  3373.           Language="$(Language)">
  3374.  
  3375.       <Output TaskParameter="OutputFile" ItemName="Compile"/>
  3376.       <Output TaskParameter="OutputFile" ItemName="FileWrites"/>
  3377.     </WriteCodeFragment>
  3378.   </Target>
  3379.  
  3380.   <!--
  3381.     ============================================================
  3382.                                         BeforeCompile
  3383.  
  3384.     Redefine this target in your project in order to run tasks just before Compile.
  3385.     ============================================================
  3386.     -->
  3387.   <Target Name="BeforeCompile"/>
  3388.  
  3389.   <!--
  3390.     ============================================================
  3391.                                         AfterCompile
  3392.  
  3393.     Redefine this target in your project in order to run tasks just after Compile.
  3394.     ============================================================
  3395.     -->
  3396.   <Target Name="AfterCompile"/>
  3397.  
  3398.   <!--
  3399.     ============================================================
  3400.                                         _TimeStampBeforeCompile
  3401.  
  3402.     If post-build events are set to fire "OnOutputUpdated", then take before
  3403.     and after timestamps so that we can compare them.
  3404.     ============================================================
  3405.     -->
  3406.   <Target
  3407.       Name="_TimeStampBeforeCompile"
  3408.       Condition="'$(RunPostBuildEvent)'=='OnOutputUpdated' or ('$(RegisterForComInterop)'=='true' and '$(OutputType)'=='library')">
  3409.  
  3410.     <PropertyGroup>
  3411.       <_AssemblyTimestampBeforeCompile>%(IntermediateAssembly.ModifiedTime)</_AssemblyTimestampBeforeCompile>
  3412.     </PropertyGroup>
  3413.  
  3414.   </Target>
  3415.  
  3416.   <!--
  3417.     ============================================================
  3418.                                         _GenerateCompileDependencyCache
  3419.  
  3420.     Generate a file used to track compiler dependencies between incremental build
  3421.     executions. This handles cases where items are added or removed from a glob (e.g.
  3422.     <Compile Include="**\*.cs" />) and can't otherwise be detected with timestamp
  3423.    comparisons. The file contains a hash of compiler inputs that are known to
  3424.    contribute to incremental build inconsistencies.
  3425.    ============================================================
  3426.    -->
  3427.  <Target Name="_GenerateCompileDependencyCache" Condition="'$(DesignTimeBuild)' != 'true' and '$(BuildingProject)' != 'true'" DependsOnTargets="ResolveAssemblyReferences">
  3428.    <ItemGroup>
  3429.      <CustomAdditionalCompileInputs Include="$(IntermediateOutputPath)$(MSBuildProjectFile).CoreCompileInputs.cache" />
  3430.      <CoreCompileCache Include="@(Compile)" />
  3431.      <CoreCompileCache Include="@(ReferencePath)" />
  3432.      <CoreCompileCache Include="$(DefineConstants)" />
  3433.    </ItemGroup>
  3434.  
  3435.    <Hash
  3436.      ItemsToHash="@(CoreCompileCache)"
  3437.      IgnoreCase="$([MSBuild]::ValueOrDefault(`$(CoreCompileCacheIgnoreCase)`, `true`))">
  3438.      <Output TaskParameter="HashResult" PropertyName="CoreCompileDependencyHash" />
  3439.    </Hash>
  3440.  
  3441.    <WriteLinesToFile Lines="$(CoreCompileDependencyHash)" File="$(IntermediateOutputPath)$(MSBuildProjectFile).CoreCompileInputs.cache" Overwrite="True" WriteOnlyWhenDifferent="True" />
  3442.  
  3443.    <ItemGroup>
  3444.      <FileWrites Include="$(IntermediateOutputPath)$(MSBuildProjectFile).CoreCompileInputs.cache" />
  3445.    </ItemGroup>
  3446.  </Target>
  3447.  
  3448.  <!--
  3449.    ============================================================
  3450.                                        _TimeStampAfterCompile
  3451.  
  3452.    If post-build events are set to fire "OnOutputUpdated", then take before
  3453.    and after timestamps so that we can compare them.
  3454.    ============================================================
  3455.    -->
  3456.  <Target
  3457.      Name="_TimeStampAfterCompile"
  3458.      Condition="'$(RunPostBuildEvent)'=='OnOutputUpdated' or ('$(RegisterForComInterop)'=='true' and '$(OutputType)'=='library')">
  3459.  
  3460.    <PropertyGroup>
  3461.      <_AssemblyTimestampAfterCompile>%(IntermediateAssembly.ModifiedTime)</_AssemblyTimestampAfterCompile>
  3462.    </PropertyGroup>
  3463.  
  3464.  </Target>
  3465.  
  3466.  <!--
  3467.    ================================================================
  3468.                                        _ComputeNonExistentFileProperty
  3469.  
  3470.    There are certain situations in which we want to always run the CoreCompile target (and
  3471.    thus the Csc task), even if the timestamps of the outputs appear to be up-to-date on disk.
  3472.    If we're inside the IDE during design-time, then the Csc/Vbc/Vjc task is simply being used to
  3473.     initialize the host compiler, so we always want to run it.  Also, if we're inside the IDE, and
  3474.    the host compiler is responsible for doing the compilation during an actual build, we want to let
  3475.    the host compiler determine whether the output is up-to-date, because there may be source files
  3476.    in the IDE's in-memory buffers that we don't know about.
  3477.  
  3478.    So, we always run the CoreCompile target if we're in the IDE, and either we're in design-time or
  3479.    we're delegating to the host compiler for the actual build.
  3480.  
  3481.     We compare against BuildOutOfProcess != true because we cannot assume that the build process will
  3482.     have set BuildOutOfProcess to true or false. Therefore the default behavior should be to do the
  3483.     legacy behavior seen before BuildingOutOfProcess was introduced if the property is not set.
  3484.     ================================================================
  3485.     -->
  3486.   <Target
  3487.       Name="_ComputeNonExistentFileProperty"
  3488.       Condition="('$(BuildingInsideVisualStudio)' == 'true') and ('$(BuildingOutOfProcess)' != 'true') and (('$(BuildingProject)' == 'false') or ('$(UseHostCompilerIfAvailable)' == 'true'))">
  3489.  
  3490.     <PropertyGroup>
  3491.       <NonExistentFile>__NonExistentSubDir__\__NonExistentFile__</NonExistentFile>
  3492.     </PropertyGroup>
  3493.  
  3494.   </Target>
  3495.  
  3496.  
  3497.  
  3498.  
  3499.   <!--
  3500.     ***********************************************************************************************
  3501.     ***********************************************************************************************
  3502.                                                                 GenerateSerializationAssemblies Section
  3503.     ***********************************************************************************************
  3504.     ***********************************************************************************************
  3505.     -->
  3506.  
  3507.   <PropertyGroup>
  3508.     <_SGenDllName>$(TargetName).XmlSerializers.dll</_SGenDllName>
  3509.     <_SGenDllCreated>false</_SGenDllCreated>
  3510.     <_SGenGenerateSerializationAssembliesConfig>$(GenerateSerializationAssemblies)</_SGenGenerateSerializationAssembliesConfig>
  3511.     <_SGenGenerateSerializationAssembliesConfig Condition="'$(GenerateSerializationAssemblies)' == ''">Auto</_SGenGenerateSerializationAssembliesConfig>
  3512.     <_SGenGenerateSerializationAssembliesConfig Condition="'$(ConfigurationName)'=='Debug' and '$(_SGenGenerateSerializationAssembliesConfig)' == 'Auto'">Off</_SGenGenerateSerializationAssembliesConfig>
  3513.     <SGenUseProxyTypes Condition="'$(SGenUseProxyTypes)' == ''">true</SGenUseProxyTypes>
  3514.     <SGenUseKeep Condition="'$(SGenUseKeep)'==''">false</SGenUseKeep>
  3515.     <SGenShouldGenerateSerializer Condition="'$(SGenShouldGenerateSerializer)' == ''">true</SGenShouldGenerateSerializer>
  3516.   </PropertyGroup>
  3517.  
  3518.   <!--
  3519.     ============================================================
  3520.                                         GenerateSerializationAssemblies
  3521.  
  3522.     Run GenerateSerializationAssemblies on the assembly produced by this build.
  3523.  
  3524.         [IN]
  3525.         @(BuildAssemblyName) - The assembly generated by this build.
  3526.         @(BuildAssemblyPath) - The path where the assembly resides.
  3527.         @(ReferencePath) - The list of references used by this assembly.
  3528.  
  3529.         [OUT]
  3530.         @(SerializationAssembly) - The path to the serialization assembly.  Maybe we'll just append to an existing list.
  3531.    ============================================================
  3532.    -->
  3533.  <Target
  3534.      Name="GenerateSerializationAssemblies"
  3535.      Condition="'$(_SGenGenerateSerializationAssembliesConfig)' == 'On' or ('@(WebReferenceUrl)'!='' and '$(_SGenGenerateSerializationAssembliesConfig)' == 'Auto')"
  3536.      DependsOnTargets="AssignTargetPaths;Compile;ResolveKeySource"
  3537.      Inputs="$(MSBuildAllProjects);@(IntermediateAssembly)"
  3538.      Outputs="$(IntermediateOutputPath)$(_SGenDllName)">
  3539.  
  3540.    <PropertyGroup>
  3541.      <SGenMSBuildArchitecture Condition="'$(SGenMSBuildArchitecture)' == ''">$(PlatformTargetAsMSBuildArchitecture)</SGenMSBuildArchitecture>
  3542.    </PropertyGroup>
  3543.  
  3544.    <SGen
  3545.        BuildAssemblyName="$(TargetFileName)"
  3546.        BuildAssemblyPath="$(IntermediateOutputPath)"
  3547.        References="@(ReferencePath)"
  3548.        ShouldGenerateSerializer="$(SGenShouldGenerateSerializer)"
  3549.        UseProxyTypes="$(SGenUseProxyTypes)"
  3550.        UseKeep="$(SGenUseKeep)"
  3551.        KeyContainer="$(KeyContainerName)"
  3552.        KeyFile="$(KeyOriginatorFile)"
  3553.        DelaySign="$(DelaySign)"
  3554.        ToolPath="$(SGenToolPath)"
  3555.        SdkToolsPath="$(TargetFrameworkSDKToolsDirectory)"
  3556.        EnvironmentVariables="$(SGenEnvironment)"
  3557.        MSBuildArchitecture="$(SGenMSBuildArchitecture)"
  3558.        SerializationAssembly="$(IntermediateOutputPath)$(_SGenDllName)"
  3559.        Platform="$(SGenPlatformTarget)"
  3560.        Types="$(SGenSerializationTypes)">
  3561.  
  3562.      <Output TaskParameter="SerializationAssembly" ItemName="SerializationAssembly"/>
  3563.  
  3564.    </SGen>
  3565.  
  3566.  </Target>
  3567.  
  3568.  <!--
  3569.    ***********************************************************************************************
  3570.    ***********************************************************************************************
  3571.                                                                CreateSatelliteAssemblies Section
  3572.    ***********************************************************************************************
  3573.    ***********************************************************************************************
  3574.    -->
  3575.  
  3576.  <!--
  3577.    ============================================================
  3578.                                        CreateSatelliteAssemblies
  3579.  
  3580.    Create one satellite assembly for every unique culture in the resources.
  3581.    ============================================================
  3582.    -->
  3583.  <PropertyGroup>
  3584.    <CreateSatelliteAssembliesDependsOn>
  3585.      _GenerateSatelliteAssemblyInputs;
  3586.      ComputeIntermediateSatelliteAssemblies;
  3587.      GenerateSatelliteAssemblies
  3588.    </CreateSatelliteAssembliesDependsOn>
  3589.  </PropertyGroup>
  3590.  <Target
  3591.      Name="CreateSatelliteAssemblies"
  3592.      DependsOnTargets="$(CreateSatelliteAssembliesDependsOn)" />
  3593.  
  3594.  <!--
  3595.    ============================================================
  3596.                                        _GenerateSatelliteAssemblyInputs
  3597.  
  3598.    Create the _SatelliteAssemblyResourceInputs list of inputs to the CreateSatelliteAssemblies target.
  3599.    ============================================================
  3600.    -->
  3601.  <Target Name="_GenerateSatelliteAssemblyInputs">
  3602.  
  3603.    <Warning Condition="'@(ManifestResourceWithCulture)'!='' and '%(ManifestResourceWithCulture.EmittedForCompatibilityOnly)'==''" Code="MSB9006" Text="ManifestResourceWithCulture item type is deprecated. Emit EmbeddedResource items instead, with metadata WithCulture='true', Type='Resx', and optional LogicalName."/>
  3604.    <Warning Condition="'@(ManifestNonResxWithCultureOnDisk)'!='' and '%(ManifestNonResxWithCultureOnDisk.EmittedForCompatibilityOnly)'==''" Code="MSB9007" Text="ManifestNonResxWithCultureOnDisk item type is deprecated. Emit EmbeddedResource items instead, with metadata WithCulture='true', Type='Non-Resx', and optional LogicalName."/>
  3605.  
  3606.    <ItemGroup>
  3607.      <!-- _SatelliteAssemblyResourceInputs is the list of TLDA inputs that should trigger CreateSatelliteAssemblies, so listed as inputs to that target -->
  3608.      <_SatelliteAssemblyResourceInputs Include="@(EmbeddedResource->'%(OutputResource)')" Condition="'%(EmbeddedResource.WithCulture)' == 'true' and '%(EmbeddedResource.Type)' == 'Resx'" />
  3609.      <_SatelliteAssemblyResourceInputs Include="@(EmbeddedResource)" Condition="'%(EmbeddedResource.WithCulture)' == 'true' and '%(EmbeddedResource.Type)' == 'Non-Resx'" />
  3610.  
  3611.      <!-- CONSUMED FOR COMPATIBILITY REASONS ONLY. EMIT EMBEDDEDRESOURCE INSTEAD -->
  3612.      <_SatelliteAssemblyResourceInputs Include="@(ManifestResourceWithCulture)" Condition="'%(ManifestResourceWithCulture.EmittedForCompatibilityOnly)'==''">
  3613.        <Type>Resx</Type>
  3614.        <WithCulture>true</WithCulture>
  3615.      </_SatelliteAssemblyResourceInputs>
  3616.      <_SatelliteAssemblyResourceInputs Include="@(ManifestNonResxWithCultureOnDisk)" Condition="'%(ManifestNonResxWithCultureOnDisk.EmittedForCompatibilityOnly)'==''">
  3617.        <Type>Non-Resx</Type>
  3618.        <WithCulture>true</WithCulture>
  3619.      </_SatelliteAssemblyResourceInputs>
  3620.  
  3621.    </ItemGroup>
  3622.  </Target>
  3623.  
  3624.  <!--
  3625.    ============================================================
  3626.                                        GenerateSatelliteAssemblies
  3627.  
  3628.    Actually run al.exe to create the satellite assemblies.
  3629.    ============================================================
  3630.    -->
  3631.  <Target Name="GenerateSatelliteAssemblies"
  3632.          Inputs="$(MSBuildAllProjects);@(_SatelliteAssemblyResourceInputs);$(IntermediateOutputPath)$(TargetName)$(TargetExt)"
  3633.          Outputs="$(IntermediateOutputPath)%(Culture)\$(TargetName).resources.dll"
  3634.          Condition="'@(_SatelliteAssemblyResourceInputs)' != '' and '$(GenerateSatelliteAssembliesForCore)' != 'true'">
  3635.  
  3636.    <MakeDir
  3637.        Directories="@(EmbeddedResource->'$(IntermediateOutputPath)%(Culture)')" />
  3638.  
  3639.    <AL AlgorithmId="$(Satellite_AlgorithmId)"
  3640.        BaseAddress="$(Satellite_BaseAddress)"
  3641.        CompanyName="$(Satellite_CompanyName)"
  3642.        Configuration="$(Satellite_Configuration)"
  3643.        Copyright="$(Satellite_Copyright)"
  3644.        Culture="%(Culture)"
  3645.        DelaySign="$(DelaySign)"
  3646.        Description="$(Satellite_Description)"
  3647.        EmbedResources="@(_SatelliteAssemblyResourceInputs)"
  3648.        EnvironmentVariables="$(AlEnvironment)"
  3649.        EvidenceFile="$(Satellite_EvidenceFile)"
  3650.        FileVersion="$(Satellite_FileVersion)"
  3651.        Flags="$(Satellite_Flags)"
  3652.        GenerateFullPaths="$(Satellite_GenerateFullPaths)"
  3653.        KeyContainer="$(KeyContainerName)"
  3654.        KeyFile="$(KeyOriginatorFile)"
  3655.        LinkResources="@(Satellite_LinkResource)"
  3656.        MainEntryPoint="$(Satellite_MainEntryPoint)"
  3657.        OutputAssembly="$(IntermediateOutputPath)%(Culture)\$(TargetName).resources.dll"
  3658.        Platform="$(PlatformTarget)"
  3659.        ProductName="$(Satellite_ProductName)"
  3660.        ProductVersion="$(Satellite_ProductVersion)"
  3661.        ResponseFiles="@(AlResponseFile)"
  3662.        SourceModules="@(Satellite_SourceModule)"
  3663.        TargetType="$(Satellite_TargetType)"
  3664.        TemplateFile="$(IntermediateOutputPath)$(TargetName)$(TargetExt)"
  3665.        Title="$(Satellite_Title)"
  3666.        ToolPath="$(AlToolPath)"
  3667.        ToolExe ="$(AlToolExe)"
  3668.        SdkToolsPath="$(TargetFrameworkSDKToolsDirectory)"
  3669.        Trademark="$(Satellite_Trademark)"
  3670.        Version="$(Satellite_Version)"
  3671.        Win32Icon="$(Satellite_Win32Icon)"
  3672.        Win32Resource="$(Satellite_Win32Resource)">
  3673.  
  3674.      <Output TaskParameter="OutputAssembly" ItemName="FileWrites"/>
  3675.  
  3676.    </AL>
  3677.  
  3678.  </Target>
  3679.  <!--
  3680.    ============================================================
  3681.                                        ComputeIntermediateSatelliteAssemblies
  3682.  
  3683.    Compute the paths to the intermediate satellite assemblies,
  3684.    with culture attributes so we can copy them to the right place.
  3685.    ============================================================
  3686.    -->
  3687.  <PropertyGroup>
  3688.    <ComputeIntermediateSatelliteAssembliesDependsOn>
  3689.      CreateManifestResourceNames
  3690.    </ComputeIntermediateSatelliteAssembliesDependsOn>
  3691.  </PropertyGroup>
  3692.  <Target
  3693.      Name="ComputeIntermediateSatelliteAssemblies"
  3694.      Condition="@(EmbeddedResource->'%(WithCulture)') != ''"
  3695.      DependsOnTargets="$(ComputeIntermediateSatelliteAssembliesDependsOn)">
  3696.  
  3697.    <ItemGroup>
  3698.      <IntermediateSatelliteAssembliesWithTargetPath Include="$(IntermediateOutputPath)%(EmbeddedResource.Culture)\$(TargetName).resources.dll"
  3699.                                                     Condition="'%(EmbeddedResource.Culture)' != ''">
  3700.        <Culture>%(EmbeddedResource.Culture)</Culture>
  3701.        <TargetPath>%(EmbeddedResource.Culture)\$(TargetName).resources.dll</TargetPath>
  3702.      </IntermediateSatelliteAssembliesWithTargetPath>
  3703.    </ItemGroup>
  3704.  </Target>
  3705.  
  3706.  <!--
  3707.    ***********************************************************************************************
  3708.    ***********************************************************************************************
  3709.                                                                SetWin32ManifestProperties Section
  3710.    ***********************************************************************************************
  3711.    ***********************************************************************************************
  3712.    -->
  3713.  
  3714.  <PropertyGroup>
  3715.    <EmbeddedWin32Manifest>$(Win32Manifest)</EmbeddedWin32Manifest>
  3716.  </PropertyGroup>
  3717.  
  3718.  <!--
  3719.    ============================================================
  3720.                                        SetWin32ManifestProperties
  3721.  
  3722.    Set Win32Manifest and EmbeddedManifest properties to be used later in the build.
  3723.    ============================================================
  3724.    -->
  3725.  <Target
  3726.      Name="SetWin32ManifestProperties"
  3727.      Condition="'$(Win32Manifest)'==''"
  3728.      DependsOnTargets="ResolveComReferences;ResolveNativeReferences;_SetExternalWin32ManifestProperties;_SetEmbeddedWin32ManifestProperties" />
  3729.  
  3730.  <Target
  3731.      Name="_SetExternalWin32ManifestProperties"
  3732.      Condition="'$(GenerateClickOnceManifests)'=='true' or '@(NativeReference)'!='' or '@(ResolvedIsolatedComModules)'!=''" >
  3733.  
  3734.    <PropertyGroup>
  3735.      <!-- set _DeploymentBaseManifest property to the value of $(ApplicationManifest) if the property is set,
  3736.                 but use _DeploymentBaseManifestWithTargetPath item-group if the property is not set to support backwards
  3737.                 compat with earlier MSBuild versions when manifest files were determined by the item-group. If the newer
  3738.                 property is set though, prefer that one be used to specify the manifest. -->
  3739.      <_DeploymentBaseManifest>$(ApplicationManifest)</_DeploymentBaseManifest>
  3740.      <_DeploymentBaseManifest Condition="'$(_DeploymentBaseManifest)'==''">@(_DeploymentBaseManifestWithTargetPath)</_DeploymentBaseManifest>
  3741.  
  3742.      <!-- when using external manifests, always set the NoWin32Manifest property to
  3743.                 true if there is no value set in the incoming project file so the
  3744.                 compilers that support manifest embedding know not to add
  3745.                 a manifest to their built assemblies -->
  3746.      <NoWin32Manifest Condition="'$(NoWin32Manifest)'==''">true</NoWin32Manifest>
  3747.    </PropertyGroup>
  3748.  
  3749.  </Target>
  3750.  
  3751.  <Target
  3752.      Name="_SetEmbeddedWin32ManifestProperties"
  3753.      Condition="'$(GenerateClickOnceManifests)'!='true' and '@(NativeReference)'=='' and '@(ResolvedIsolatedComModules)'==''" >
  3754.  
  3755.    <PropertyGroup>
  3756.      <EmbeddedWin32Manifest>$(ApplicationManifest)</EmbeddedWin32Manifest>
  3757.      <Win32Manifest>$(ApplicationManifest)</Win32Manifest>
  3758.    </PropertyGroup>
  3759.  
  3760.    <GetFrameworkPath Condition="'$(ApplicationManifest)'=='' and '$(NoWin32Manifest)'!='true'">
  3761.      <Output TaskParameter="FrameworkVersion40Path"  PropertyName="_FrameworkVersion40Path" />
  3762.    </GetFrameworkPath>
  3763.  
  3764.    <PropertyGroup>
  3765.      <EmbeddedWin32Manifest  Condition="'$(ApplicationManifest)'=='' and '$(NoWin32Manifest)'!='true' and Exists('$(_FrameworkVersion40Path)\default.win32manifest')">$(_FrameworkVersion40Path)\default.win32manifest</EmbeddedWin32Manifest>
  3766.    </PropertyGroup>
  3767.  
  3768.  </Target>
  3769.  
  3770.  
  3771.  
  3772.  
  3773.  <!--
  3774.    ***********************************************************************************************
  3775.    ***********************************************************************************************
  3776.                                                                GenerateManifests Section
  3777.    ***********************************************************************************************
  3778.    ***********************************************************************************************
  3779.    -->
  3780.  
  3781.  <!--
  3782.    ============================================================
  3783.                                        GenerateManifests
  3784.  
  3785.    Generates ClickOnce application and deployment manifests or a native manifest.
  3786.    ============================================================
  3787.    -->
  3788.  <PropertyGroup>
  3789.    <GenerateManifestsDependsOn>
  3790.      SetWin32ManifestProperties;
  3791.      GenerateApplicationManifest;
  3792.      GenerateDeploymentManifest
  3793.    </GenerateManifestsDependsOn>
  3794.  </PropertyGroup>
  3795.  
  3796.  <!--
  3797.    ============================================================
  3798.                  _GenerateResolvedDeploymentManifestEntryPoint
  3799.  
  3800.    Use the ResolveManifestFiles to generate the GenerateResolvedDeploymentManifestEntryPoint
  3801.  
  3802.    ============================================================
  3803.    -->
  3804.  <Target
  3805.      Name="_GenerateResolvedDeploymentManifestEntryPoint">
  3806.    <ItemGroup>
  3807.      <_DeploymentPublishFileOfTypeManifestEntryPoint Include="@(PublishFile)" Condition="'%(FileType)'=='ManifestEntryPoint'"/>
  3808.    </ItemGroup>
  3809.  
  3810.    <ResolveManifestFiles
  3811.        TargetFrameworkVersion="$(TargetFrameworkVersion)"
  3812.        SigningManifests="$(SignManifests)"
  3813.        DeploymentManifestEntryPoint="@(ApplicationManifest)"
  3814.        PublishFiles="@(_DeploymentPublishFileOfTypeManifestEntryPoint)">
  3815.  
  3816.      <Output TaskParameter="OutputDeploymentManifestEntryPoint" ItemName="_DeploymentResolvedDeploymentManifestEntryPoint"/>
  3817.  
  3818.    </ResolveManifestFiles>
  3819.  </Target>
  3820.  
  3821.  <Target
  3822.      Name="GenerateManifests"
  3823.      Condition="'$(GenerateClickOnceManifests)'=='true' or '@(NativeReference)'!='' or '@(ResolvedIsolatedComModules)'!='' or '$(GenerateAppxManifest)' == 'true'"
  3824.      DependsOnTargets="$(GenerateManifestsDependsOn)"/>
  3825.  
  3826.  <!--
  3827.    ============================================================
  3828.                                        GenerateApplicationManifest
  3829.  
  3830.    Generates a ClickOnce or native application manifest.
  3831.    An application manifest specifies declarative application identity, dependency and security information.
  3832.  
  3833.        [IN]
  3834.        $(_DeploymentBaseManifest) - The base app.manifest from project.
  3835.        @(ResolvedIsolatedComModules) - The list of COM references to be isolated as reg-free COM dependencies for native assembly loader.
  3836.        @(_DeploymentManifestFiles) - The list of loose files (content, pdb, xml, etc.) for ClickOnce.
  3837.        @(_DeploymentManifestDependencies) - The list of application dependencies (typically this is the set of assembly dependencies in bin\) for ClickOnce.
  3838.        @(AppConfigWithTargetPath) - App config file, if present.
  3839.        $(_DeploymentManifestType) - Type of manifest to be generated, either "Native" or "ClickOnce".
  3840.  
  3841.        [OUT]
  3842.        @(ApplicationManifest) - Generated native or ClickOnce application manifest, i.e. WindowsApplication1.exe.manifest
  3843.    ============================================================
  3844.    -->
  3845.  <Target
  3846.      Name="GenerateApplicationManifest"
  3847.      DependsOnTargets="
  3848.            _DeploymentComputeNativeManifestInfo;
  3849.            _DeploymentComputeClickOnceManifestInfo;
  3850.            ResolveComReferences;
  3851.            ResolveNativeReferences;
  3852.            _GenerateResolvedDeploymentManifestEntryPoint"
  3853.      Inputs="
  3854.            $(MSBuildAllProjects);
  3855.            @(AppConfigWithTargetPath);
  3856.            $(_DeploymentBaseManifest);
  3857.            @(ResolvedIsolatedComModules);
  3858.            @(_DeploymentManifestDependencies);
  3859.            @(_DeploymentResolvedManifestEntryPoint);
  3860.            @(_DeploymentManifestFiles)"
  3861.      Outputs="@(ApplicationManifest)">
  3862.  
  3863.    <RequiresFramework35SP1Assembly
  3864.      ReferencedAssemblies="@(Reference)"
  3865.        ErrorReportUrl="$(_DeploymentFormattedErrorReportUrl)"
  3866.        TargetFrameworkVersion="$(TargetFrameworkVersion)"
  3867.        CreateDesktopShortcut="$(CreateDesktopShortcut)"
  3868.        SigningManifests="$(SignManifests)"
  3869.        Assemblies="@(_DeploymentManifestDependencies)"
  3870.        DeploymentManifestEntryPoint="@(_DeploymentResolvedDeploymentManifestEntryPoint)"
  3871.        EntryPoint="@(_DeploymentResolvedManifestEntryPoint)"
  3872.        Files="@(_DeploymentManifestFiles)"
  3873.        SuiteName="$(SuiteName)" >
  3874.  
  3875.      <Output TaskParameter="RequiresMinimumFramework35SP1" PropertyName="_DeploymentRequiresMinimumFramework35SP1" />
  3876.    </RequiresFramework35SP1Assembly>
  3877.  
  3878.    <GenerateApplicationManifest
  3879.        AssemblyName="$(_DeploymentApplicationManifestIdentity)"
  3880.        AssemblyVersion="$(_DeploymentManifestVersion)"
  3881.        ConfigFile="@(AppConfigWithTargetPath)"
  3882.        ClrVersion="$(ClrVersion)"
  3883.        Dependencies="@(_DeploymentManifestDependencies)"
  3884.        Description="$(Description)"
  3885.        EntryPoint="@(_DeploymentResolvedManifestEntryPoint)"
  3886.        ErrorReportUrl="$(_DeploymentFormattedErrorReportUrl)"
  3887.        FileAssociations="@(FileAssociation)"
  3888.        Files="@(_DeploymentManifestFiles)"
  3889.        HostInBrowser="$(HostInBrowser)"
  3890.        IconFile="@(_DeploymentManifestIconFile)"
  3891.        InputManifest="$(_DeploymentBaseManifest)"
  3892.        IsolatedComReferences="@(ResolvedIsolatedComModules)"
  3893.        ManifestType="$(_DeploymentManifestType)"
  3894.        MaxTargetPath="$(MaxTargetPath)"
  3895.        OutputManifest="@(ApplicationManifest)"
  3896.        OSVersion="$(OSVersion)"
  3897.        Platform="$(PlatformTarget)"
  3898.        Product="$(ProductName)"
  3899.        Publisher="$(PublisherName)"
  3900.        RequiresMinimumFramework35SP1="$(_DeploymentRequiresMinimumFramework35SP1)"
  3901.        SuiteName="$(SuiteName)"
  3902.        SupportUrl="$(_DeploymentFormattedSupportUrl)"
  3903.        TargetCulture="$(TargetCulture)"
  3904.        TargetFrameworkSubset="$(TargetFrameworkSubset)"
  3905.        TargetFrameworkProfile="$(TargetFrameworkProfile)"
  3906.        TargetFrameworkVersion="$(TargetFrameworkVersion)"
  3907.        TrustInfoFile="@(_DeploymentIntermediateTrustInfoFile)"
  3908.        UseApplicationTrust="$(UseApplicationTrust)">
  3909.  
  3910.      <Output TaskParameter="OutputManifest" ItemName="FileWrites"/>
  3911.  
  3912.    </GenerateApplicationManifest>
  3913.  
  3914.    <PropertyGroup>
  3915.      <_DeploymentCopyApplicationManifest>true</_DeploymentCopyApplicationManifest>
  3916.    </PropertyGroup>
  3917.  
  3918.  </Target>
  3919.  
  3920.  <!--
  3921.    ============================================================
  3922.                                        _DeploymentComputeNativeManifestInfo
  3923.  
  3924.    Compute info for native manifest generation
  3925.    ============================================================
  3926.    -->
  3927.  <Target
  3928.      Name="_DeploymentComputeNativeManifestInfo"
  3929.      Condition="'$(GenerateClickOnceManifests)'!='true'">
  3930.  
  3931.    <!-- Create list of items for manifest generation -->
  3932.    <ResolveManifestFiles NativeAssemblies="@(NativeReferenceFile);@(_DeploymentNativePrerequisite)">
  3933.      <Output TaskParameter="OutputAssemblies" ItemName="_DeploymentManifestDependencies"/>
  3934.    </ResolveManifestFiles>
  3935.  
  3936.    <PropertyGroup>
  3937.      <_DeploymentManifestType>Native</_DeploymentManifestType>
  3938.    </PropertyGroup>
  3939.  
  3940.    <!-- Obtain manifest version from the built assembly -->
  3941.    <GetAssemblyIdentity AssemblyFiles="@(IntermediateAssembly)">
  3942.      <Output TaskParameter="Assemblies" ItemName="_IntermediateAssemblyIdentity"/>
  3943.    </GetAssemblyIdentity>
  3944.  
  3945.    <PropertyGroup>
  3946.      <_DeploymentManifestVersion>@(_IntermediateAssemblyIdentity->'%(Version)')</_DeploymentManifestVersion>
  3947.    </PropertyGroup>
  3948.  
  3949.  </Target>
  3950.  
  3951.  <!--
  3952.    ============================================================
  3953.                                        _DeploymentComputeClickOnceManifestInfo
  3954.  
  3955.    Compute info for  ClickOnce manifest generation
  3956.    ============================================================
  3957.    -->
  3958.  <Target
  3959.      Name="_DeploymentComputeClickOnceManifestInfo"
  3960.      Condition="'$(GenerateClickOnceManifests)'=='true'"
  3961.      DependsOnTargets="
  3962.            CleanPublishFolder;
  3963.            _DeploymentGenerateTrustInfo">
  3964.  
  3965.    <!-- Grab just the serialization assemblies for a referenced assembly.  There may also be a symbols file in ReferenceRelatedPaths -->
  3966.    <ItemGroup>
  3967.      <_SGenDllsRelatedToCurrentDll Include="@(_ReferenceSerializationAssemblyPaths->'%(FullPath)')" Condition="'%(Extension)' == '.dll'"/>
  3968.      <_SGenDllsRelatedToCurrentDll Include="@(SerializationAssembly->'%(FullPath)')" Condition="'%(Extension)' == '.dll'"/>
  3969.    </ItemGroup>
  3970.  
  3971.    <ItemGroup Condition="!exists('$(ProjectLockFile)')">
  3972.      <_CopyLocalFalseRefPaths Include="@(ReferencePath)" Condition="'%(CopyLocal)' == 'false'" />
  3973.      <_CopyLocalFalseRefPathsWithExclusion Include="@(_CopyLocalFalseRefPaths)"
  3974.                                            Exclude="@(ReferenceCopyLocalPaths);@(_NETStandardLibraryNETFrameworkLib)" />
  3975.    </ItemGroup>
  3976.  
  3977.    <!-- Flag primary dependencies-certain warnings emitted during application manifest generation apply only to them. -->
  3978.    <ItemGroup>
  3979.      <_SatelliteAssemblies Include="@(IntermediateSatelliteAssembliesWithTargetPath);@(ReferenceSatellitePaths)" />
  3980.      <_DeploymentReferencePaths Include="@(ReferenceCopyLocalPaths)"
  3981.                                 Condition="'%(Extension)' == '.dll' Or '%(Extension)' == '.exe'">
  3982.        <IsPrimary>true</IsPrimary>
  3983.      </_DeploymentReferencePaths>
  3984.      <_DeploymentReferencePaths Include="@(_DeploymentReferencePaths);@(_CopyLocalFalseRefPathsWithExclusion)" />
  3985.      <_ManifestManagedReferences Include="@(_DeploymentReferencePaths);@(ReferenceDependencyPaths);@(_SGenDllsRelatedToCurrentDll);@(SerializationAssembly);@(ReferenceCOMWrappersToCopyLocal)"
  3986.                               Exclude="@(_SatelliteAssemblies);@(_ReferenceScatterPaths);@(_ExcludedAssembliesFromManifestGeneration)" />
  3987.    </ItemGroup>
  3988.  
  3989.    <!-- Copy the application executable from Obj folder to app.publish folder.
  3990.    This is being done to avoid Windows Forms designer memory issues that can arise while operating directly on files located in Obj directory. -->
  3991.    <Copy
  3992.      SourceFiles="@(_DeploymentManifestEntryPoint)"
  3993.      DestinationFolder="$(PublishDir)">
  3994.  
  3995.      <Output TaskParameter="DestinationFiles" ItemName="_DeploymentClickOnceApplicationExecutable" />
  3996.    </Copy>
  3997.  
  3998.    <!-- Sign the application executable located in app.publish folder.  Signing this file is done to comply with SmartScreen. -->
  3999.    <SignFile
  4000.      CertificateThumbprint="$(_DeploymentResolvedManifestCertificateThumbprint)"
  4001.      TimestampUrl="$(ManifestTimestampUrl)"
  4002.      SigningTarget="@(_DeploymentClickOnceApplicationExecutable)"
  4003.      Condition="'$(_DeploymentResolvedManifestCertificateThumbprint)'!='' and '$(_DeploymentSignClickOnceManifests)'=='true' and '$(TargetExt)' == '.exe'"
  4004.      />
  4005.  
  4006.    <!-- Create list of items for manifest generation -->
  4007.    <ResolveManifestFiles
  4008.        TargetFrameworkVersion="$(TargetFrameworkVersion)"
  4009.        SigningManifests="$(SignManifests)"
  4010.        EntryPoint="@(_DeploymentClickOnceApplicationExecutable)"
  4011.        ExtraFiles="@(_DebugSymbolsIntermediatePath);$(IntermediateOutputPath)$(TargetName).xml;@(_ReferenceRelatedPaths)"
  4012.        Files="@(ContentWithTargetPath);@(_DeploymentManifestIconFile);@(AppConfigWithTargetPath)"
  4013.        ManagedAssemblies="@(_ManifestManagedReferences)"
  4014.        NativeAssemblies="@(NativeReferenceFile);@(_DeploymentNativePrerequisite)"
  4015.        PublishFiles="@(PublishFile)"
  4016.        SatelliteAssemblies="@(_SatelliteAssemblies)"
  4017.        TargetCulture="$(TargetCulture)">
  4018.  
  4019.      <Output TaskParameter="OutputAssemblies" ItemName="_DeploymentManifestDependenciesUnfiltered"/>
  4020.      <Output TaskParameter="OutputFiles" ItemName="_DeploymentManifestFiles"/>
  4021.      <Output TaskParameter="OutputEntryPoint" ItemName="_DeploymentResolvedManifestEntryPoint"/>
  4022.  
  4023.    </ResolveManifestFiles>
  4024.  
  4025.    <!-- We have to filter items out of the dependencies that have neither CopyLocal set to true, -->
  4026.    <!-- nor the dependency type manually set to 'Install'.                                       -->
  4027.    <ItemGroup>
  4028.      <_DeploymentManifestDependencies Include="@(_DeploymentManifestDependenciesUnfiltered)"
  4029.          Condition="!('%(_DeploymentManifestDependenciesUnfiltered.CopyLocal)' == 'false' And '%(_DeploymentManifestDependenciesUnfiltered.DependencyType)' != 'Install')" />
  4030.    </ItemGroup>
  4031.  
  4032.    <PropertyGroup>
  4033.      <_DeploymentManifestType>ClickOnce</_DeploymentManifestType>
  4034.    </PropertyGroup>
  4035.  
  4036.    <!-- Obtain manifest version from ApplicationVersion and ApplicationRevision properties -->
  4037.    <FormatVersion Version="$(ApplicationVersion)" Revision="$(ApplicationRevision)">
  4038.      <Output TaskParameter="OutputVersion" PropertyName="_DeploymentManifestVersion"/>
  4039.    </FormatVersion>
  4040.  
  4041.    <FormatUrl InputUrl="$(_DeploymentUrl)">
  4042.      <Output TaskParameter="OutputUrl" PropertyName="_DeploymentFormattedDeploymentUrl"/>
  4043.    </FormatUrl>
  4044.  
  4045.    <FormatUrl InputUrl="$(SupportUrl)">
  4046.      <Output TaskParameter="OutputUrl" PropertyName="_DeploymentFormattedSupportUrl"/>
  4047.    </FormatUrl>
  4048.  
  4049.    <FormatUrl InputUrl="$(ErrorReportUrl)">
  4050.      <Output TaskParameter="OutputUrl" PropertyName="_DeploymentFormattedErrorReportUrl"/>
  4051.    </FormatUrl>
  4052.  
  4053.  </Target>
  4054.  
  4055.  <!--
  4056.    ============================================================
  4057.                                        _DeploymentGenerateTrustInfo
  4058.  
  4059.    Generates the application permission set for inclusion in the generated ClickOnce application manifest.
  4060.    ============================================================
  4061.    -->
  4062.  <Target
  4063.      Name="_DeploymentGenerateTrustInfo"
  4064.      Condition="'$(TargetZone)'!=''"
  4065.      Inputs="
  4066.            $(MSBuildAllProjects);
  4067.            $(_DeploymentBaseManifest);
  4068.            "
  4069.      Outputs="@(_DeploymentIntermediateTrustInfoFile)">
  4070.  
  4071.    <GenerateTrustInfo
  4072.        BaseManifest="$(_DeploymentBaseManifest)"
  4073.        ApplicationDependencies="@(ReferencePath);@(ReferenceDependencyPaths)"
  4074.        ExcludedPermissions="$(ExcludedPermissions)"
  4075.        TargetFrameworkMoniker="$(TargetFrameworkMoniker)"
  4076.        TargetZone="$(TargetZone)"
  4077.        TrustInfoFile="@(_DeploymentIntermediateTrustInfoFile)">
  4078.  
  4079.      <Output TaskParameter="TrustInfoFile" ItemName="FileWrites"/>
  4080.  
  4081.    </GenerateTrustInfo>
  4082.  
  4083.  </Target>
  4084.  
  4085.  <!--
  4086.    ============================================================
  4087.                                        GenerateDeploymentManifest
  4088.  
  4089.    Generates a ClickOnce deployment manifest.
  4090.    An deployment manifest specifies declarative application identity and application update information.
  4091.    ============================================================
  4092.    -->
  4093.  <Target
  4094.      Name="GenerateDeploymentManifest"
  4095.      DependsOnTargets="GenerateApplicationManifest"
  4096.      Inputs="
  4097.            $(MSBuildAllProjects);
  4098.            @(ApplicationManifest)
  4099.            "
  4100.      Outputs="@(DeployManifest)">
  4101.  
  4102.    <GenerateDeploymentManifest
  4103.          AssemblyName="$(_DeploymentDeployManifestIdentity)"
  4104.          AssemblyVersion="$(_DeploymentManifestVersion)"
  4105.          CreateDesktopShortcut="$(CreateDesktopShortcut)"
  4106.          DeploymentUrl="$(_DeploymentFormattedDeploymentUrl)"
  4107.          Description="$(Description)"
  4108.          DisallowUrlActivation="$(DisallowUrlActivation)"
  4109.          EntryPoint="@(_DeploymentResolvedDeploymentManifestEntryPoint)"
  4110.          ErrorReportUrl="$(_DeploymentFormattedErrorReportUrl)"
  4111.          Install="$(Install)"
  4112.          MapFileExtensions="$(MapFileExtensions)"
  4113.          MaxTargetPath="$(MaxTargetPath)"
  4114.          MinimumRequiredVersion="$(_DeploymentBuiltMinimumRequiredVersion)"
  4115.          OutputManifest="@(DeployManifest)"
  4116.          Platform="$(PlatformTarget)"
  4117.          Product="$(ProductName)"
  4118.          Publisher="$(PublisherName)"
  4119.          SuiteName="$(SuiteName)"
  4120.          SupportUrl="$(_DeploymentFormattedSupportUrl)"
  4121.          TargetCulture="$(TargetCulture)"
  4122.          TargetFrameworkVersion="$(TargetFrameworkVersion)"
  4123.          TargetFrameworkMoniker="$(TargetFrameworkMoniker)"
  4124.          TrustUrlParameters="$(TrustUrlParameters)"
  4125.          UpdateEnabled="$(UpdateEnabled)"
  4126.          UpdateInterval="$(_DeploymentBuiltUpdateInterval)"
  4127.          UpdateMode="$(UpdateMode)"
  4128.          UpdateUnit="$(_DeploymentBuiltUpdateIntervalUnits)"
  4129.          Condition="'$(GenerateClickOnceManifests)'=='true'">
  4130.  
  4131.      <Output TaskParameter="OutputManifest" ItemName="FileWrites"/>
  4132.  
  4133.    </GenerateDeploymentManifest>
  4134.  
  4135.  </Target>
  4136.  
  4137.  
  4138.  
  4139.  
  4140.  <!--
  4141.    ***********************************************************************************************
  4142.    ***********************************************************************************************
  4143.                                                                PrepareForRun Section
  4144.    ***********************************************************************************************
  4145.    ***********************************************************************************************
  4146.    -->
  4147.  
  4148.  <PropertyGroup>
  4149.    <SkipCopyUnchangedFiles Condition="'$(SkipCopyUnchangedFiles)' == ''">true</SkipCopyUnchangedFiles>
  4150.    <UseCommonOutputDirectory Condition="'$(UseCommonOutputDirectory)' == ''">false</UseCommonOutputDirectory>
  4151.  </PropertyGroup>
  4152.  
  4153.  <!--
  4154.    ============================================================
  4155.                                        PrepareForRun
  4156.  
  4157.    Copy the build outputs to the final directory if they have changed.
  4158.    ============================================================
  4159.    -->
  4160.  <PropertyGroup>
  4161.    <PrepareForRunDependsOn>
  4162.      CopyFilesToOutputDirectory
  4163.    </PrepareForRunDependsOn>
  4164.  </PropertyGroup>
  4165.  <Target
  4166.      Name="PrepareForRun"
  4167.      DependsOnTargets="$(PrepareForRunDependsOn)"/>
  4168.  
  4169.  <!--
  4170.    ============================================================
  4171.                                        CopyFilesToOutputDirectory
  4172.  
  4173.    Copy all build outputs, satellites and other necessary files to the final directory.
  4174.    ============================================================
  4175.    -->
  4176.  <PropertyGroup>
  4177.    <!-- By default we're not using Hard or Symbolic Links to copy to the output directory, and never when building in VS -->
  4178.     <CreateHardLinksForCopyAdditionalFilesIfPossible Condition="'$(BuildingInsideVisualStudio)' == 'true' or '$(CreateHardLinksForCopyAdditionalFilesIfPossible)' == ''">false</CreateHardLinksForCopyAdditionalFilesIfPossible>
  4179.     <CreateSymbolicLinksForCopyAdditionalFilesIfPossible Condition="'$(BuildingInsideVisualStudio)' == 'true' or '$(CreateSymbolicLinksForCopyAdditionalFilesIfPossible)' == ''">false</CreateSymbolicLinksForCopyAdditionalFilesIfPossible>
  4180.   </PropertyGroup>
  4181.  
  4182.   <Target
  4183.       Name="CopyFilesToOutputDirectory"
  4184.       DependsOnTargets="
  4185.            ComputeIntermediateSatelliteAssemblies;
  4186.            _CopyFilesMarkedCopyLocal;
  4187.            _CopySourceItemsToOutputDirectory;
  4188.            _CopyAppConfigFile;
  4189.            _CopyManifestFiles;
  4190.            _CheckForCompileOutputs;
  4191.            _SGenCheckForOutputs">
  4192.  
  4193.     <PropertyGroup>
  4194.       <!-- By default we're not using Hard Links to copy to the output directory, and never when building in VS -->
  4195.      <CreateHardLinksForCopyFilesToOutputDirectoryIfPossible Condition="'$(BuildingInsideVisualStudio)' == 'true' or '$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)' == ''">false</CreateHardLinksForCopyFilesToOutputDirectoryIfPossible>
  4196.      <CreateSymbolicLinksForCopyFilesToOutputDirectoryIfPossible Condition="'$(BuildingInsideVisualStudio)' == 'true' or '$(CreateSymbolicLinksForCopyFilesToOutputDirectoryIfPossible)' == ''">false</CreateSymbolicLinksForCopyFilesToOutputDirectoryIfPossible>
  4197.      <ErrorIfLinkFailsForCopyFilesToOutputDirectory Condition="'$(BuildingInsideVisualStudio)' == 'true' or '$(ErrorIfLinkFailsForCopyFilesToOutputDirectory)' == ''">false</ErrorIfLinkFailsForCopyFilesToOutputDirectory>
  4198.    </PropertyGroup>
  4199.  
  4200.    <PropertyGroup>
  4201.      <CopyBuildOutputToOutputDirectory Condition="'$(CopyBuildOutputToOutputDirectory)'==''">true</CopyBuildOutputToOutputDirectory>
  4202.      <CopyOutputSymbolsToOutputDirectory Condition="'$(CopyOutputSymbolsToOutputDirectory)'==''">true</CopyOutputSymbolsToOutputDirectory>
  4203.      <CopyDocumentationFileToOutputDirectory Condition="'$(CopyDocumentationFileToOutputDirectory)'==''">true</CopyDocumentationFileToOutputDirectory>
  4204.    </PropertyGroup>
  4205.  
  4206.    <!-- Copy the build product (.dll or .exe). -->
  4207.    <Copy
  4208.        SourceFiles="@(IntermediateAssembly)"
  4209.        DestinationFolder="$(OutDir)"
  4210.        SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
  4211.        OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
  4212.        Retries="$(CopyRetryCount)"
  4213.        RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
  4214.        UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)"
  4215.        UseSymboliclinksIfPossible="$(CreateSymbolicLinksForCopyFilesToOutputDirectoryIfPossible)"
  4216.        ErrorIfLinkFails="$(ErrorIfLinkFailsForCopyFilesToOutputDirectory)"
  4217.        Condition="'$(CopyBuildOutputToOutputDirectory)' == 'true' and '$(SkipCopyBuildProduct)' != 'true'"
  4218.            >
  4219.  
  4220.      <Output TaskParameter="DestinationFiles" ItemName="MainAssembly"/>
  4221.      <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
  4222.  
  4223.    </Copy>
  4224.  
  4225.    <!-- Copy the reference assembly build product (.dll or .exe). -->
  4226.    <CopyRefAssembly
  4227.        SourcePath="@(IntermediateRefAssembly)"
  4228.        DestinationPath="$(TargetRefPath)"
  4229.        Condition="'$(ProduceReferenceAssembly)' == 'true' and '$(CopyBuildOutputToOutputDirectory)' == 'true' and '$(SkipCopyBuildProduct)' != 'true'"
  4230.            >
  4231.  
  4232.      <Output TaskParameter="DestinationPath" ItemName="ReferenceAssembly"/>
  4233.      <Output TaskParameter="DestinationPath" ItemName="FileWrites"/>
  4234.  
  4235.    </CopyRefAssembly>
  4236.  
  4237.    <Message Importance="High" Text="$(MSBuildProjectName) -&gt; @(MainAssembly->'%(FullPath)')" Condition="'$(CopyBuildOutputToOutputDirectory)' == 'true' and '$(SkipCopyBuildProduct)'!='true'" />
  4238.  
  4239.    <!-- Copy the additional modules. -->
  4240.    <Copy
  4241.        SourceFiles="@(AddModules)"
  4242.        DestinationFolder="$(OutDir)"
  4243.        SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
  4244.        OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
  4245.        Retries="$(CopyRetryCount)"
  4246.        RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
  4247.        UseHardlinksIfPossible="$(CreateHardLinksForCopyAdditionalFilesIfPossible)"
  4248.        UseSymboliclinksIfPossible="$(CreateSymbolicLinksForCopyAdditionalFilesIfPossible)"
  4249.        Condition="'@(AddModules)' != ''"
  4250.            >
  4251.  
  4252.      <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
  4253.  
  4254.    </Copy>
  4255.  
  4256.    <!-- Copy the serialization assembly if it exists. -->
  4257.    <Copy
  4258.        SourceFiles="$(IntermediateOutputPath)$(_SGenDllName)"
  4259.        DestinationFiles="$(OutDir)$(_SGenDllName)"
  4260.        SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
  4261.        OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
  4262.        Retries="$(CopyRetryCount)"
  4263.        RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
  4264.        UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)"
  4265.        UseSymboliclinksIfPossible="$(CreateSymbolicLinksForCopyFilesToOutputDirectoryIfPossible)"
  4266.        ErrorIfLinkFails="$(ErrorIfLinkFailsForCopyFilesToOutputDirectory)"
  4267.        Condition="'$(_SGenDllCreated)'=='true'">
  4268.  
  4269.      <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
  4270.  
  4271.    </Copy>
  4272.  
  4273.    <!-- Copy the debug information file (.pdb), if any -->
  4274.    <Copy
  4275.        SourceFiles="@(_DebugSymbolsIntermediatePath)"
  4276.        DestinationFiles="@(_DebugSymbolsOutputPath)"
  4277.        SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
  4278.        OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
  4279.        Retries="$(CopyRetryCount)"
  4280.        RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
  4281.        UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)"
  4282.        UseSymboliclinksIfPossible="$(CreateSymbolicLinksForCopyFilesToOutputDirectoryIfPossible)"
  4283.        ErrorIfLinkFails="$(ErrorIfLinkFailsForCopyFilesToOutputDirectory)"
  4284.        Condition="'$(_DebugSymbolsProduced)'=='true' and '$(SkipCopyingSymbolsToOutputDirectory)' != 'true' and '$(CopyOutputSymbolsToOutputDirectory)'=='true'">
  4285.  
  4286.      <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
  4287.  
  4288.    </Copy>
  4289.  
  4290.    <!-- Copy the resulting XML documentation file, if any. -->
  4291.    <Copy
  4292.        SourceFiles="@(DocFileItem)"
  4293.        DestinationFiles="@(FinalDocFile)"
  4294.        SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
  4295.        OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
  4296.        Retries="$(CopyRetryCount)"
  4297.        RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
  4298.        UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)"
  4299.        UseSymboliclinksIfPossible="$(CreateSymbolicLinksForCopyFilesToOutputDirectoryIfPossible)"
  4300.        ErrorIfLinkFails="$(ErrorIfLinkFailsForCopyFilesToOutputDirectory)"
  4301.        Condition="'$(_DocumentationFileProduced)'=='true' and '$(CopyDocumentationFileToOutputDirectory)'=='true'">
  4302.  
  4303.      <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
  4304.  
  4305.    </Copy>
  4306.  
  4307.    <!-- Copy satellite assemblies. -->
  4308.    <Copy
  4309.        SourceFiles="@(IntermediateSatelliteAssembliesWithTargetPath)"
  4310.        DestinationFiles="@(IntermediateSatelliteAssembliesWithTargetPath->'$(OutDir)%(Culture)\$(TargetName).resources.dll')"
  4311.        SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
  4312.        OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
  4313.        Retries="$(CopyRetryCount)"
  4314.        RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
  4315.        UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)"
  4316.        UseSymboliclinksIfPossible="$(CreateSymbolicLinksForCopyFilesToOutputDirectoryIfPossible)"
  4317.        ErrorIfLinkFails="$(ErrorIfLinkFailsForCopyFilesToOutputDirectory)"
  4318.        Condition="'@(IntermediateSatelliteAssembliesWithTargetPath)' != ''"
  4319.            >
  4320.  
  4321.      <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
  4322.  
  4323.    </Copy>
  4324.  
  4325.    <!--
  4326.        Copy COM reference wrappers, isolated COM references, COM references included by
  4327.        native (manifest) references, native (manifest) reference files themselves.
  4328.        -->
  4329.    <Copy
  4330.        SourceFiles="@(ReferenceComWrappersToCopyLocal); @(ResolvedIsolatedComModules); @(_DeploymentLooseManifestFile); @(NativeReferenceFile)"
  4331.        DestinationFolder="$(OutDir)"
  4332.        SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
  4333.        OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
  4334.        Retries="$(CopyRetryCount)"
  4335.        RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
  4336.        UseHardlinksIfPossible="$(CreateHardLinksForCopyAdditionalFilesIfPossible)"
  4337.        UseSymboliclinksIfPossible="$(CreateSymbolicLinksForCopyAdditionalFilesIfPossible)"
  4338.        Condition="'@(ReferenceComWrappersToCopyLocal)' != '' or '@(ResolvedIsolatedComModules)' != '' or '@(_DeploymentLooseManifestFile)' != '' or '@(NativeReferenceFile)' != '' "
  4339.            >
  4340.  
  4341.      <Output TaskParameter="DestinationFiles" ItemName="FileWritesShareable"/>
  4342.  
  4343.    </Copy>
  4344.  
  4345.    <!-- Copy the build product of WinMDExp. -->
  4346.    <Copy
  4347.        SourceFiles="@(WinMDExpArtifacts)"
  4348.        DestinationFolder="$(OutDir)"
  4349.        SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
  4350.        OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
  4351.        Retries="$(CopyRetryCount)"
  4352.        RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
  4353.        UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)"
  4354.        UseSymboliclinksIfPossible="$(CreateSymbolicLinksForCopyFilesToOutputDirectoryIfPossible)"
  4355.        ErrorIfLinkFails="$(ErrorIfLinkFailsForCopyFilesToOutputDirectory)"
  4356.        Condition="'$(SkipCopyWinMDArtifact)' != 'true' and '@(WinMDExpArtifacts)' != ''"
  4357.            >
  4358.      <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
  4359.      <Output TaskParameter="DestinationFiles" ItemName="FinalWinmdExpArtifacts" />
  4360.    </Copy>
  4361.  
  4362.    <Message Importance="High" Text="$(MSBuildProjectName) -&gt; $([System.IO.Path]::GetFullPath('$(_WindowsMetadataOutputPath)'))" Condition="'$(SkipCopyWinMDArtifact)' != 'true' and '$(_WindowsMetadataOutputPath)' != ''" />
  4363.  
  4364.  </Target>
  4365.  
  4366.  <!--
  4367.    ============================================================
  4368.                                        _CopyFilesMarkedCopyLocal
  4369.  
  4370.    Copy references that are marked as "CopyLocal" and their dependencies, including .pdbs, .xmls and satellites.
  4371.    ============================================================
  4372.    -->
  4373.  <Target
  4374.      Name="_CopyFilesMarkedCopyLocal"
  4375.      Condition="'@(ReferenceCopyLocalPaths)' != ''"
  4376.        >
  4377.  
  4378.    <PropertyGroup>
  4379.      <!-- By default we're not using Hard Links to copy to the output directory, and never when building in VS -->
  4380.       <CreateHardLinksForCopyLocalIfPossible Condition="'$(BuildingInsideVisualStudio)' == 'true' or '$(CreateHardLinksForCopyLocalIfPossible)' == ''">false</CreateHardLinksForCopyLocalIfPossible>
  4381.       <CreateSymbolicLinksForCopyLocalIfPossible Condition="'$(BuildingInsideVisualStudio)' == 'true' or '$(CreateSymbolicLinksForCopyLocalIfPossible)' == ''">false</CreateSymbolicLinksForCopyLocalIfPossible>
  4382.     </PropertyGroup>
  4383.  
  4384.     <Copy
  4385.         SourceFiles="@(ReferenceCopyLocalPaths)"
  4386.         DestinationFiles="@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')"
  4387.         SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
  4388.         OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
  4389.         Retries="$(CopyRetryCount)"
  4390.         RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
  4391.         UseHardlinksIfPossible="$(CreateHardLinksForCopyLocalIfPossible)"
  4392.         UseSymboliclinksIfPossible="$(CreateSymbolicLinksForCopyLocalIfPossible)"
  4393.         Condition="'$(UseCommonOutputDirectory)' != 'true'"
  4394.             >
  4395.  
  4396.       <Output TaskParameter="DestinationFiles" ItemName="FileWritesShareable"/>
  4397.       <Output TaskParameter="CopiedFiles" ItemName="ReferencesCopiedInThisBuild"/>
  4398.  
  4399.     </Copy>
  4400.  
  4401.     <!-- If this project produces reference assemblies *and* copied (possibly transitive)
  4402.          references on this build, subsequent builds of projects that depend on it must
  4403.          not be considered up to date, so touch this marker file that is considered an
  4404.          input to projects that reference this one. -->
  4405.     <Touch Files="@(CopyUpToDateMarker)"
  4406.            AlwaysCreate="true"
  4407.            Condition="'@(ReferencesCopiedInThisBuild)' != ''">
  4408.         <Output TaskParameter="TouchedFiles" ItemName="FileWrites" />
  4409.     </Touch>
  4410.  
  4411.   </Target>
  4412.  
  4413.   <!--
  4414.     ============================================================
  4415.                                         _CopySourceItemsToOutputDirectory
  4416.     ============================================================
  4417.     -->
  4418.   <Target
  4419.       Name="_CopySourceItemsToOutputDirectory"
  4420.       DependsOnTargets="
  4421.            GetCopyToOutputDirectoryItems;
  4422.            _CopyOutOfDateSourceItemsToOutputDirectory;
  4423.            _CopyOutOfDateSourceItemsToOutputDirectoryAlways"/>
  4424.  
  4425.  
  4426.   <!--
  4427.     ============================================================
  4428.                                         GetCopyToOutputDirectoryItems
  4429.  
  4430.     Get all project items that may need to be transferred to the output directory.
  4431.     This includes baggage items from transitively referenced projects. It would appear
  4432.     that this target computes full transitive closure of content items for all referenced
  4433.     projects; however that is not the case. It only collects the content items from its
  4434.     immediate children and not children of children. The reason this happens is that
  4435.     the ProjectReferenceWithConfiguration list that is consumed by _SplitProjectReferencesByFileExistence
  4436.     is only populated in the current project and is empty in the children. The empty list
  4437.     causes _MSBuildProjectReferenceExistent to be empty and terminates the recursion.
  4438.     ============================================================
  4439.     -->
  4440.   <PropertyGroup>
  4441.     <GetCopyToOutputDirectoryItemsDependsOn>
  4442.       AssignTargetPaths;
  4443.       _SplitProjectReferencesByFileExistence;
  4444.       _GetProjectReferenceTargetFrameworkProperties
  4445.     </GetCopyToOutputDirectoryItemsDependsOn>
  4446.   </PropertyGroup>
  4447.   <Target
  4448.       Name="GetCopyToOutputDirectoryItems"
  4449.       Returns="@(AllItemsFullPathWithTargetPath)"
  4450.       KeepDuplicateOutputs=" '$(MSBuildDisableGetCopyToOutputDirectoryItemsOptimization)' == '' "
  4451.       DependsOnTargets="$(GetCopyToOutputDirectoryItemsDependsOn)">
  4452.  
  4453.  
  4454.     <!-- In the general case, clients need very little of the metadata which is generated by invoking this target on this project and its children.  For those
  4455.          cases, we can immediately discard the unwanted metadata, reducing memory usage, particularly in very large and interconnected systems of projects.
  4456.          However, if some client does require the original functionality, it is sufficient to set MSBuildDisableGetCopyToOutputDirectoryItemsOptimization to
  4457.          a non-empty value and the original behavior will be restored. -->
  4458.     <PropertyGroup Condition=" '$(MSBuildDisableGetCopyToOutputDirectoryItemsOptimization)' == '' ">
  4459.       <_GCTODIKeepDuplicates>false</_GCTODIKeepDuplicates>
  4460.       <_GCTODIKeepMetadata>CopyToOutputDirectory;TargetPath</_GCTODIKeepMetadata>
  4461.     </PropertyGroup>
  4462.  
  4463.     <!-- Get items from child projects first. -->
  4464.     <MSBuild
  4465.         Projects="@(_MSBuildProjectReferenceExistent)"
  4466.         Targets="GetCopyToOutputDirectoryItems"
  4467.         BuildInParallel="$(BuildInParallel)"
  4468.         Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform); %(_MSBuildProjectReferenceExistent.SetTargetFramework)"
  4469.         Condition="'@(_MSBuildProjectReferenceExistent)' != '' and '$(_GetChildProjectCopyToOutputDirectoryItems)' == 'true' and '%(_MSBuildProjectReferenceExistent.Private)' != 'false' and '$(UseCommonOutputDirectory)' != 'true'"
  4470.         ContinueOnError="$(ContinueOnError)"
  4471.         SkipNonexistentTargets="true"
  4472.         RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
  4473.  
  4474.       <Output TaskParameter="TargetOutputs" ItemName="_AllChildProjectItemsWithTargetPath"/>
  4475.  
  4476.     </MSBuild>
  4477.  
  4478.     <!-- Target outputs must be full paths because they will be consumed by a different project. -->
  4479.     <ItemGroup>
  4480.       <_SourceItemsToCopyToOutputDirectoryAlways KeepDuplicates=" '$(_GCTODIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_AllChildProjectItemsWithTargetPath->'%(FullPath)')" Condition="'%(_AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='Always'"/>
  4481.       <_SourceItemsToCopyToOutputDirectory       KeepDuplicates=" '$(_GCTODIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_AllChildProjectItemsWithTargetPath->'%(FullPath)')" Condition="'%(_AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/>
  4482.     </ItemGroup>
  4483.  
  4484.     <!-- Remove items which we will never again use - they just sit around taking up memory otherwise -->
  4485.     <ItemGroup>
  4486.       <_AllChildProjectItemsWithTargetPath Remove="@(_AllChildProjectItemsWithTargetPath)"/>
  4487.     </ItemGroup>
  4488.  
  4489.     <!-- Get items from this project last so that they will be copied last. -->
  4490.     <ItemGroup>
  4491.       <_SourceItemsToCopyToOutputDirectoryAlways KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(ContentWithTargetPath->'%(FullPath)')" Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)'=='Always'"/>
  4492.       <_SourceItemsToCopyToOutputDirectory       KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(ContentWithTargetPath->'%(FullPath)')" Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/>
  4493.     </ItemGroup>
  4494.  
  4495.     <ItemGroup>
  4496.       <_SourceItemsToCopyToOutputDirectoryAlways KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(EmbeddedResource->'%(FullPath)')" Condition="'%(EmbeddedResource.CopyToOutputDirectory)'=='Always'"/>
  4497.       <_SourceItemsToCopyToOutputDirectory       KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(EmbeddedResource->'%(FullPath)')" Condition="'%(EmbeddedResource.CopyToOutputDirectory)'=='PreserveNewest'"/>
  4498.     </ItemGroup>
  4499.  
  4500.     <ItemGroup>
  4501.       <_CompileItemsToCopy Include="@(Compile->'%(FullPath)')" Condition="'%(Compile.CopyToOutputDirectory)'=='Always' or '%(Compile.CopyToOutputDirectory)'=='PreserveNewest'"/>
  4502.     </ItemGroup>
  4503.  
  4504.     <AssignTargetPath Files="@(_CompileItemsToCopy)" RootFolder="$(MSBuildProjectDirectory)">
  4505.       <Output TaskParameter="AssignedFiles" ItemName="_CompileItemsToCopyWithTargetPath" />
  4506.     </AssignTargetPath>
  4507.  
  4508.     <ItemGroup>
  4509.       <_SourceItemsToCopyToOutputDirectoryAlways KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_CompileItemsToCopyWithTargetPath)" Condition="'%(_CompileItemsToCopyWithTargetPath.CopyToOutputDirectory)'=='Always'"/>
  4510.       <_SourceItemsToCopyToOutputDirectory       KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_CompileItemsToCopyWithTargetPath)" Condition="'%(_CompileItemsToCopyWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/>
  4511.     </ItemGroup>
  4512.  
  4513.     <ItemGroup>
  4514.       <_SourceItemsToCopyToOutputDirectoryAlways KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_NoneWithTargetPath->'%(FullPath)')" Condition="'%(_NoneWithTargetPath.CopyToOutputDirectory)'=='Always'"/>
  4515.       <_SourceItemsToCopyToOutputDirectory       KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_NoneWithTargetPath->'%(FullPath)')" Condition="'%(_NoneWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/>
  4516.     </ItemGroup>
  4517.  
  4518.     <ItemGroup>
  4519.       <AllItemsFullPathWithTargetPath            Include="@(_SourceItemsToCopyToOutputDirectoryAlways->'%(FullPath)');@(_SourceItemsToCopyToOutputDirectory->'%(FullPath)')"/>
  4520.     </ItemGroup>
  4521.  
  4522.   </Target>
  4523.  
  4524.   <!--
  4525.     ============================================================
  4526.                                         GetCopyToPublishDirectoryItems
  4527.  
  4528.     Default implementation of GetCopyToPublishDirectoryItems for projects that do not
  4529.     use Microsoft.NET.Sdk. It simply returns whatever GetCopyToOutputDirectoryItems
  4530.     does with CopyToPublishDirectory implied  by CopyToOutputDirectory, which is the
  4531.     same as Microsoft.NET.Sdk default when its CopyToPublishDirectory is not used.
  4532.  
  4533.     Microsoft.NET.Sdk projects  will override this to allow the publish output to be
  4534.     customized independently from the build output.
  4535.  
  4536.     Having a default implementation here allows the Microsoft.NET.Sdk Publish target
  4537.     to work when a Microsoft.NET.Sdk-based project references a non-Microsoft.NET.Sdk-based
  4538.     project.
  4539.     ============================================================
  4540.     -->
  4541.     <Target
  4542.       Name="GetCopyToPublishDirectoryItems"
  4543.       DependsOnTargets="GetCopyToOutputDirectoryItems"
  4544.       Returns="@(AllPublishItemsFullPathWithTargetPath)">
  4545.  
  4546.     <ItemGroup>
  4547.       <AllPublishItemsFullPathWithTargetPath Include="@(AllItemsFullPathWithTargetPath)">
  4548.         <CopyToPublishDirectory>%(CopyToOutputDirectory)</CopyToPublishDirectory>
  4549.       </AllPublishItemsFullPathWithTargetPath>
  4550.     </ItemGroup>
  4551.   </Target>
  4552.  
  4553.   <!--
  4554.     ============================================================
  4555.                                         _CopyOutOfDateSourceItemsToOutputDirectory
  4556.  
  4557.     Copy files that have the CopyToOutputDirectory attribute set to 'PreserveNewest'.
  4558.     ============================================================
  4559.     -->
  4560.   <Target
  4561.       Name="_CopyOutOfDateSourceItemsToOutputDirectory"
  4562.       Condition=" '@(_SourceItemsToCopyToOutputDirectory)' != '' "
  4563.       Inputs="@(_SourceItemsToCopyToOutputDirectory)"
  4564.       Outputs="@(_SourceItemsToCopyToOutputDirectory->'$(OutDir)%(TargetPath)')">
  4565.  
  4566.     <!--
  4567.         Not using SkipUnchangedFiles="true" because the application may want to change
  4568.         one of these files and not have an incremental build replace it.
  4569.         -->
  4570.     <Copy
  4571.         SourceFiles = "@(_SourceItemsToCopyToOutputDirectory)"
  4572.         DestinationFiles = "@(_SourceItemsToCopyToOutputDirectory->'$(OutDir)%(TargetPath)')"
  4573.         OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
  4574.         Retries="$(CopyRetryCount)"
  4575.         RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
  4576.         UseHardlinksIfPossible="$(CreateHardLinksForAdditionalFilesIfPossible)"
  4577.         UseSymboliclinksIfPossible="$(CreateSymbolicLinksForAdditionalFilesIfPossible)"
  4578.             >
  4579.  
  4580.       <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
  4581.  
  4582.     </Copy>
  4583.  
  4584.   </Target>
  4585.  
  4586.   <!--
  4587.     ============================================================
  4588.                                         _CopyOutOfDateSourceItemsToOutputDirectoryAlways
  4589.  
  4590.     Copy files that have the CopyToOutputDirectory attribute set to 'Always'.
  4591.     ============================================================
  4592.     -->
  4593.   <Target
  4594.       Name="_CopyOutOfDateSourceItemsToOutputDirectoryAlways"
  4595.       Condition=" '@(_SourceItemsToCopyToOutputDirectoryAlways)' != '' ">
  4596.  
  4597.     <!--
  4598.         Not using SkipUnchangedFiles="true" because the application may want to change
  4599.         one of these files and not have an incremental build replace it.
  4600.         -->
  4601.     <Copy
  4602.         SourceFiles = "@(_SourceItemsToCopyToOutputDirectoryAlways)"
  4603.         DestinationFiles = "@(_SourceItemsToCopyToOutputDirectoryAlways->'$(OutDir)%(TargetPath)')"
  4604.         OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
  4605.         Retries="$(CopyRetryCount)"
  4606.         RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
  4607.         UseHardlinksIfPossible="$(CreateHardLinksForAdditionalFilesIfPossible)"
  4608.         UseSymboliclinksIfPossible="$(CreateSymbolicLinksForAdditionalFilesIfPossible)"
  4609.             >
  4610.  
  4611.       <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
  4612.  
  4613.     </Copy>
  4614.  
  4615.   </Target>
  4616.  
  4617.   <!--
  4618.     ============================================================
  4619.                                         _CopyAppConfigFile
  4620.  
  4621.     Copy the application config file.
  4622.     ============================================================
  4623.     -->
  4624.   <Target
  4625.       Name="_CopyAppConfigFile"
  4626.       Condition=" '@(AppConfigWithTargetPath)' != '' "
  4627.       Inputs="@(AppConfigWithTargetPath)"
  4628.       Outputs="@(AppConfigWithTargetPath->'$(OutDir)%(TargetPath)')">
  4629.  
  4630.     <!--
  4631.         Copy the application's .config file, if any.
  4632.        Not using SkipUnchangedFiles="true" because the application may want to change
  4633.        the app.config and not have an incremental build replace it.
  4634.        -->
  4635.    <Copy
  4636.        SourceFiles="@(AppConfigWithTargetPath)"
  4637.        DestinationFiles="@(AppConfigWithTargetPath->'$(OutDir)%(TargetPath)')"
  4638.        OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
  4639.        Retries="$(CopyRetryCount)"
  4640.        RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
  4641.        UseHardlinksIfPossible="$(CreateHardLinksForAdditionalFilesIfPossible)"
  4642.        UseSymboliclinksIfPossible="$(CreateSymbolicLinksForAdditionalFilesIfPossible)"
  4643.            >
  4644.  
  4645.      <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
  4646.  
  4647.    </Copy>
  4648.  
  4649.  </Target>
  4650.  
  4651.  <!--
  4652.    ================================================================
  4653.                                         _CopyManifestFiles
  4654.    ================================================================
  4655.  
  4656.    Copy the built manifests (.exe.manifest, .application/.xbap) to the final directory.
  4657.    -->
  4658.  <Target
  4659.      Name="_CopyManifestFiles"
  4660.      Condition=" '$(_DeploymentCopyApplicationManifest)'=='true' or '$(GenerateClickOnceManifests)'=='true' "
  4661.      DependsOnTargets="PrepareForBuild">
  4662.  
  4663.    <Copy
  4664.        SourceFiles="@(ApplicationManifest)"
  4665.        DestinationFolder="$(OutDir)"
  4666.        SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
  4667.        OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
  4668.        Retries="$(CopyRetryCount)"
  4669.        RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
  4670.        UseHardlinksIfPossible="$(CreateHardLinksForAdditionalFilesIfPossible)"
  4671.        UseSymboliclinksIfPossible="$(CreateSymbolicLinksForAdditionalFilesIfPossible)"
  4672.        Condition="'$(GenerateClickOnceManifests)'=='true' or '$(_DeploymentCopyApplicationManifest)'=='true'">
  4673.  
  4674.      <Output TaskParameter="DestinationFiles" ItemName="_DeploymentMainApplicationManifest"/>
  4675.      <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
  4676.  
  4677.    </Copy>
  4678.  
  4679.    <Message Importance="Normal" Condition="'$(_DeploymentCopyApplicationManifest)'=='true'" Text="$(MSBuildProjectName) -&gt; @(_DeploymentMainApplicationManifest->'%(FullPath)')" />
  4680.  
  4681.    <Copy
  4682.        SourceFiles="@(DeployManifest)"
  4683.        DestinationFolder="$(OutDir)"
  4684.        SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
  4685.        OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
  4686.        Retries="$(CopyRetryCount)"
  4687.        RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
  4688.        UseHardlinksIfPossible="$(CreateHardLinksForAdditionalFilesIfPossible)"
  4689.        UseSymboliclinksIfPossible="$(CreateSymbolicLinksForAdditionalFilesIfPossible)"
  4690.        Condition="'$(GenerateClickOnceManifests)'=='true'">
  4691.  
  4692.      <Output TaskParameter="DestinationFiles" ItemName="_DeploymentMainDeployManifest"/>
  4693.      <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
  4694.  
  4695.    </Copy>
  4696.  
  4697.    <Message Importance="Normal" Condition="'$(GenerateClickOnceManifests)'=='true'" Text="$(MSBuildProjectName) -&gt; @(_DeploymentMainDeployManifest->'%(FullPath)')" />
  4698.  
  4699.  </Target>
  4700.  
  4701.  <!--
  4702.    ================================================================
  4703.                                         _CheckForCompileOutputs
  4704.  
  4705.    Checks each file output from the main "Compile" target to make sure they really exist.
  4706.    If they do, then record them in the clean cache.
  4707.    ============================================================
  4708.    -->
  4709.  <Target
  4710.      Name="_CheckForCompileOutputs">
  4711.  
  4712.    <!--Record the main compile outputs.-->
  4713.    <ItemGroup>
  4714.      <FileWrites Include="@(IntermediateAssembly)" Condition="Exists('@(IntermediateAssembly)')"/>
  4715.      <FileWrites Include="@(IntermediateRefAssembly)" Condition="'$(ProduceReferenceAssembly)' == 'true' and Exists('@(IntermediateRefAssembly)')"/>
  4716.    </ItemGroup>
  4717.  
  4718.    <!-- Record the .xml if one was produced. -->
  4719.    <PropertyGroup>
  4720.      <_DocumentationFileProduced Condition="!Exists('@(DocFileItem)')">false</_DocumentationFileProduced>
  4721.    </PropertyGroup>
  4722.  
  4723.    <ItemGroup>
  4724.      <FileWrites Include="@(DocFileItem)" Condition="'$(_DocumentationFileProduced)'=='true'"/>
  4725.    </ItemGroup>
  4726.  
  4727.    <!-- Record the .pdb if one was produced. -->
  4728.    <PropertyGroup>
  4729.      <_DebugSymbolsProduced Condition="!Exists('@(_DebugSymbolsIntermediatePath)')">false</_DebugSymbolsProduced>
  4730.    </PropertyGroup>
  4731.  
  4732.    <ItemGroup>
  4733.      <FileWrites Include="@(_DebugSymbolsIntermediatePath)" Condition="'$(_DebugSymbolsProduced)'=='true'"/>
  4734.    </ItemGroup>
  4735.  </Target>
  4736.  
  4737.  <!--
  4738.    ============================================================
  4739.                                        _SGenCheckForOutputs
  4740.  
  4741.    Checks each file output from the "GenerateSerializationAssemblies" target to make sure they really exist.
  4742.    If they do, then record them in the clean cache.
  4743.    ============================================================
  4744.    -->
  4745.  <Target
  4746.      Name="_SGenCheckForOutputs"
  4747.      Condition="'$(_SGenGenerateSerializationAssembliesConfig)' == 'On' or ('@(WebReferenceUrl)'!='' and '$(_SGenGenerateSerializationAssembliesConfig)' == 'Auto')"
  4748.        >
  4749.  
  4750.    <!-- Record the serializer .dll if one was produced.-->
  4751.    <PropertyGroup>
  4752.      <_SGenDllCreated Condition="Exists('$(IntermediateOutputPath)$(_SGenDllName)')">true</_SGenDllCreated>
  4753.    </PropertyGroup>
  4754.  
  4755.    <ItemGroup>
  4756.      <FileWrites Include="$(IntermediateOutputPath)$(_SGenDllName)" Condition="Exists('$(IntermediateOutputPath)$(_SGenDllName)')"/>
  4757.    </ItemGroup>
  4758.  
  4759.  </Target>
  4760.  
  4761.  
  4762.  
  4763.  
  4764.  <!--
  4765.    ***********************************************************************************************
  4766.    ***********************************************************************************************
  4767.                                                                UnmanagedRegistration Section
  4768.    ***********************************************************************************************
  4769.    ***********************************************************************************************
  4770.    -->
  4771.  
  4772.  <!--
  4773.    ============================================================
  4774.                                        UnmanagedRegistration
  4775.  
  4776.    Registers the main assembly for COM interop.
  4777.    ============================================================
  4778.    -->
  4779.  <PropertyGroup>
  4780.    <UnmanagedRegistrationDependsOn></UnmanagedRegistrationDependsOn>
  4781.  </PropertyGroup>
  4782.  <Target
  4783.      Name="UnmanagedRegistration"
  4784.      Condition="'$(RegisterForComInterop)'=='true' and '$(OutputType)'=='library'"
  4785.      DependsOnTargets="$(UnmanagedRegistrationDependsOn)"
  4786.        >
  4787.  
  4788.    <PropertyGroup>
  4789.      <RegisterAssemblyMSBuildArchitecture Condition="'$(RegisterAssemblyMSBuildArchitecture)' == ''">$(PlatformTargetAsMSBuildArchitecture)</RegisterAssemblyMSBuildArchitecture>
  4790.    </PropertyGroup>
  4791.  
  4792.    <PropertyGroup Condition="'$(TargetFrameworkAsMSBuildRuntime)' != '' and '$(RegisterAssemblyMSBuildArchitecture)' != ''">
  4793.      <!-- Falling back to the current runtime if we are targeting CLR2 and the task host doesn't exist will lead to
  4794.            incorrect behavior in some cases, but it's the same incorrect behavior as Visual Studio 2010, and thus better
  4795.           than causing build breaks on upgrade to Win8 the way not doing so would.  For more details, see the
  4796.           corresponding comment in GenerateResource. -->
  4797.      <RegisterAssemblyMSBuildRuntime
  4798.          Condition="'$(RegisterAssemblyMSBuildRuntime)' == '' and
  4799.                     $([MSBuild]::DoesTaskHostExist(`$(TargetFrameworkAsMSBuildRuntime)`, `$(RegisterAssemblyMSBuildArchitecture)`))">$(TargetFrameworkAsMSBuildRuntime)</RegisterAssemblyMSBuildRuntime>
  4800.  
  4801.      <!-- If the targeted runtime doesn't exist, fall back to current -->
  4802.       <RegisterAssemblyMSBuildRuntime Condition="'$(RegisterAssemblyMSBuildRuntime)' == ''">CurrentRuntime</RegisterAssemblyMSBuildRuntime>
  4803.     </PropertyGroup>
  4804.  
  4805.     <RegisterAssembly
  4806.         Assemblies="@(_OutputPathItem->'%(FullPath)$(TargetFileName)')"
  4807.         TypeLibFiles="@(_OutputPathItem->'%(FullPath)$(TargetName).tlb')"
  4808.         AssemblyListFile="@(_UnmanagedRegistrationCache)"
  4809.         CreateCodeBase="true"
  4810.         MSBuildRuntime="$(RegisterAssemblyMSBuildRuntime)"
  4811.         MSBuildArchitecture="$(RegisterAssemblyMSBuildArchitecture)"
  4812.         Condition="!Exists('@(_UnmanagedRegistrationCache)')"/>
  4813.  
  4814.     <ItemGroup>
  4815.       <FileWrites Include="@(_OutputPathItem->'%(FullPath)$(TargetName).tlb')"/>
  4816.     </ItemGroup>
  4817.   </Target>
  4818.  
  4819.  
  4820.  
  4821.  
  4822.  
  4823.   <!--
  4824.     ***********************************************************************************************
  4825.     ***********************************************************************************************
  4826.                                                                 IncrementalClean Section
  4827.     ***********************************************************************************************
  4828.     ***********************************************************************************************
  4829.     -->
  4830.  
  4831.   <!--
  4832.     ============================================================
  4833.                                         IncrementalClean
  4834.  
  4835.     Remove files that were produced in a prior build but weren't produced in the current build.
  4836.    The reason is that if, for example, the name of the .exe has changed we want to delete the
  4837.    old copy.
  4838.  
  4839.    Leave the Clean cache file containing only the files produced in the current build.
  4840.    ============================================================
  4841.    -->
  4842.  <Target
  4843.       Name="IncrementalClean"
  4844.       DependsOnTargets="_CleanGetCurrentAndPriorFileWrites">
  4845.  
  4846.    <!-- Subtract list of files produced in prior builds from list of files produced in this build. -->
  4847.    <ItemGroup>
  4848.      <_CleanOrphanFileWrites Include="@(_CleanPriorFileWrites)" Exclude="@(_CleanCurrentFileWrites)"/>
  4849.    </ItemGroup>
  4850.  
  4851.    <!-- Find all files in the final output directory. -->
  4852.    <FindUnderPath Path="$(OutDir)" Files="@(_CleanOrphanFileWrites)">
  4853.      <Output TaskParameter="InPath" ItemName="_CleanOrphanFileWritesInOutput"/>
  4854.    </FindUnderPath>
  4855.  
  4856.    <!-- Find all files in the intermediate output directory. -->
  4857.    <FindUnderPath Path="$(IntermediateOutputPath)"    Files="@(_CleanOrphanFileWrites)">
  4858.      <Output TaskParameter="InPath" ItemName="_CleanOrphanFileWritesInIntermediate"/>
  4859.    </FindUnderPath>
  4860.  
  4861.    <!-- Delete the orphaned files. -->
  4862.    <Delete
  4863.        Files="@(_CleanOrphanFileWritesInIntermediate);@(_CleanOrphanFileWritesInOutput)"
  4864.        TreatErrorsAsWarnings="true">
  4865.  
  4866.      <Output TaskParameter="DeletedFiles" ItemName="_CleanOrphanFilesDeleted"/>
  4867.  
  4868.    </Delete>
  4869.  
  4870.    <!-- Create a list of everything that wasn't deleted or was outside
  4871.              the current final output and intermediate output directories. -->
  4872.     <ItemGroup>
  4873.       <_CleanRemainingFileWritesAfterIncrementalClean Include="@(_CleanPriorFileWrites);@(_CleanCurrentFileWrites)" Exclude="@(_CleanOrphanFilesDeleted)"/>
  4874.     </ItemGroup>
  4875.  
  4876.     <!-- Remove duplicates. -->
  4877.     <RemoveDuplicates Inputs="@(_CleanRemainingFileWritesAfterIncrementalClean)">
  4878.       <Output TaskParameter="Filtered" ItemName="_CleanUniqueRemainingFileWritesAfterIncrementalClean"/>
  4879.     </RemoveDuplicates>
  4880.  
  4881.     <!-- Write new list of current files back to disk, replacing the existing list.-->
  4882.     <WriteLinesToFile
  4883.         File="$(IntermediateOutputPath)$(CleanFile)"
  4884.         Lines="@(_CleanUniqueRemainingFileWritesAfterIncrementalClean)"
  4885.         Condition="'@(_CleanUnfilteredPriorFileWrites)'!='@(_CleanUniqueRemainingFileWritesAfterIncrementalClean)'"
  4886.         Overwrite="true"/>
  4887.  
  4888.   </Target>
  4889.  
  4890.   <!--
  4891.     ============================================================
  4892.                                         _CleanGetCurrentAndPriorFileWrites
  4893.  
  4894.     Get the list of files built in the current build and in prior builds.
  4895.     ============================================================
  4896.     -->
  4897.   <Target
  4898.        Name="_CleanGetCurrentAndPriorFileWrites"
  4899.        DependsOnTargets="_CheckForCompileOutputs;_SGenCheckForOutputs">
  4900.  
  4901.     <!-- Read the list of files produced by a prior builds from disk. -->
  4902.     <ReadLinesFromFile File="$(IntermediateOutputPath)$(CleanFile)">
  4903.       <Output TaskParameter="Lines" ItemName="_CleanUnfilteredPriorFileWrites"/>
  4904.     </ReadLinesFromFile>
  4905.  
  4906.     <!--
  4907.         Convert the list of references to the absolute paths so we can make valid comparisons
  4908.         across two lists
  4909.          -->
  4910.     <ConvertToAbsolutePath Paths="@(_ResolveAssemblyReferenceResolvedFiles)">
  4911.       <Output TaskParameter="AbsolutePaths" ItemName="_ResolveAssemblyReferenceResolvedFilesAbsolute"/>
  4912.     </ConvertToAbsolutePath>
  4913.  
  4914.     <!--
  4915.         Subtract any resolved assembly files from *prior* file writes because deleting
  4916.         these would break subsequent builds because the assemblies would be unresolvable.
  4917.          -->
  4918.     <ItemGroup>
  4919.       <_CleanPriorFileWrites Include="@(_CleanUnfilteredPriorFileWrites)" Exclude="@(_ResolveAssemblyReferenceResolvedFilesAbsolute)"/>
  4920.     </ItemGroup>
  4921.  
  4922.     <!--
  4923.         Of shareable files, keep only those that are in the project's directory.
  4924.        We never clean shareable files outside of the project directory because
  4925.        the build may be to a common output directory and other projects may need
  4926.        them.
  4927.  
  4928.        Only subtract the outputs from ResolveAssemblyReferences target because that's the
  4929.         only "Resolve" target that tries to resolve assemblies directly from the output
  4930.         directory.
  4931.         -->
  4932.     <FindUnderPath Path="$(MSBuildProjectDirectory)" Files="@(FileWritesShareable)" UpdateToAbsolutePaths="true">
  4933.       <Output TaskParameter="InPath" ItemName="FileWrites"/>
  4934.     </FindUnderPath>
  4935.  
  4936.     <!-- Find all files in the final output directory. -->
  4937.     <FindUnderPath Path="$(OutDir)" Files="@(FileWrites)" UpdateToAbsolutePaths="true">
  4938.       <Output TaskParameter="InPath" ItemName="_CleanCurrentFileWritesInOutput"/>
  4939.     </FindUnderPath>
  4940.  
  4941.     <!-- Find all files in the intermediate output directory. -->
  4942.     <FindUnderPath Path="$(IntermediateOutputPath)" Files="@(FileWrites)" UpdateToAbsolutePaths="true">
  4943.       <Output TaskParameter="InPath" ItemName="_CleanCurrentFileWritesInIntermediate"/>
  4944.     </FindUnderPath>
  4945.  
  4946.     <!--
  4947.         Subtract any resolved assembly files from *current* file writes because deleting
  4948.         these would break subsequent builds because the assemblies would be unresolvable.
  4949.  
  4950.         Only subtract the outputs from ResolveAssemblyReferences target because that's the
  4951.        only "Resolve" target that tries to resolve assemblies directly from the output
  4952.        directory.
  4953.         -->
  4954.    <ItemGroup>
  4955.      <_CleanCurrentFileWritesWithNoReferences Include="@(_CleanCurrentFileWritesInOutput);@(_CleanCurrentFileWritesInIntermediate)" Exclude="@(_ResolveAssemblyReferenceResolvedFilesAbsolute)"/>
  4956.    </ItemGroup>
  4957.  
  4958.    <!-- Remove duplicates from files produced in this build. -->
  4959.    <RemoveDuplicates Inputs="@(_CleanCurrentFileWritesWithNoReferences)" >
  4960.      <Output TaskParameter="Filtered" ItemName="_CleanCurrentFileWrites"/>
  4961.    </RemoveDuplicates>
  4962.  
  4963.  </Target>
  4964.  
  4965.  <!--
  4966.    ***********************************************************************************************
  4967.    ***********************************************************************************************
  4968.                                                                Clean Section
  4969.    ***********************************************************************************************
  4970.    ***********************************************************************************************
  4971.    -->
  4972.  
  4973.  <!--
  4974.    ============================================================
  4975.                                        Clean
  4976.  
  4977.    Delete all intermediate and final build outputs.
  4978.    ============================================================
  4979.    -->
  4980.  <PropertyGroup>
  4981.    <CleanDependsOn>
  4982.      BeforeClean;
  4983.      UnmanagedUnregistration;
  4984.      CoreClean;
  4985.      CleanReferencedProjects;
  4986.      CleanPublishFolder;
  4987.      AfterClean
  4988.    </CleanDependsOn>
  4989.  </PropertyGroup>
  4990.  
  4991.  <Target
  4992.      Name="Clean"
  4993.      Condition=" '$(_InvalidConfigurationWarning)' != 'true' "
  4994.      DependsOnTargets="$(CleanDependsOn)" />
  4995.  
  4996.  <!--
  4997.    ============================================================
  4998.                                        BeforeClean
  4999.  
  5000.    Redefine this target in your project in order to run tasks just before Clean.
  5001.    ============================================================
  5002.    -->
  5003.  <Target Name="BeforeClean"/>
  5004.  
  5005.  <!--
  5006.    ============================================================
  5007.                                        AfterClean
  5008.  
  5009.    Redefine this target in your project in order to run tasks just after Clean.
  5010.    ============================================================
  5011.    -->
  5012.  <Target Name="AfterClean"/>
  5013.  
  5014.  <!--
  5015.    ============================================================
  5016.                                        CleanReferencedProjects
  5017.  
  5018.    Call Clean target on all Referenced Projects.
  5019.    ============================================================
  5020.    -->
  5021.  <Target
  5022.      Name="CleanReferencedProjects"
  5023.      DependsOnTargets="PrepareProjectReferences">
  5024.  
  5025.    <!--
  5026.        When building the project directly from the command-line, clean those referenced projects
  5027.        that exist on disk.  For IDE builds and command-line .SLN builds, the solution build manager
  5028.        takes care of this.
  5029.        -->
  5030.    <MSBuild
  5031.        Projects="@(_MSBuildProjectReferenceExistent)"
  5032.        Targets="Clean"
  5033.        Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform); %(_MSBuildProjectReferenceExistent.SetTargetFramework)"
  5034.        BuildInParallel="$(BuildInParallel)"
  5035.        Condition="'$(BuildingInsideVisualStudio)' != 'true' and '$(BuildProjectReferences)' == 'true' and '@(_MSBuildProjectReferenceExistent)' != ''"
  5036.        ContinueOnError="$(ContinueOnError)"
  5037.        RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)"/>
  5038.  
  5039.  </Target>
  5040.  
  5041.  <!--
  5042.    ============================================================
  5043.                                        CoreClean
  5044.    ============================================================
  5045.    -->
  5046.  <PropertyGroup>
  5047.    <CoreCleanDependsOn></CoreCleanDependsOn>
  5048.  </PropertyGroup>
  5049.  <Target
  5050.      Name="CoreClean"
  5051.      DependsOnTargets="$(CoreCleanDependsOn)">
  5052.  
  5053.    <!-- First clean any explicitly specified cleanable files.
  5054.             Declare items of this type if you want Clean to delete them. -->
  5055.    <Delete
  5056.        Files="@(Clean)"
  5057.        TreatErrorsAsWarnings="true"/>
  5058.  
  5059.    <!-- Read in list of files that were written to disk in past builds. -->
  5060.    <ReadLinesFromFile File="$(IntermediateOutputPath)$(CleanFile)">
  5061.      <Output TaskParameter="Lines" ItemName="_CleanPriorFileWrites"/>
  5062.    </ReadLinesFromFile>
  5063.  
  5064.    <!-- Find all files in the final output directory. -->
  5065.    <FindUnderPath Path="$(OutDir)" Files="@(_CleanPriorFileWrites)">
  5066.      <Output TaskParameter="InPath" ItemName="_CleanPriorFileWritesInOutput"/>
  5067.    </FindUnderPath>
  5068.  
  5069.    <!-- Find all files in the intermediate output directory. -->
  5070.    <FindUnderPath Path="$(IntermediateOutputPath)"    Files="@(_CleanPriorFileWrites)">
  5071.      <Output TaskParameter="InPath" ItemName="_CleanPriorFileWritesInIntermediate"/>
  5072.    </FindUnderPath>
  5073.  
  5074.    <!-- Delete those files. -->
  5075.    <Delete
  5076.        Files="@(_CleanPriorFileWritesInOutput);@(_CleanPriorFileWritesInIntermediate)"
  5077.        TreatErrorsAsWarnings="true">
  5078.  
  5079.      <Output TaskParameter="DeletedFiles" ItemName="_CleanPriorFileWritesDeleted"/>
  5080.  
  5081.    </Delete>
  5082.  
  5083.    <!-- Create a list of everything that wasn't deleted. -->
  5084.     <ItemGroup>
  5085.       <_CleanRemainingFileWritesAfterClean Include="@(_CleanPriorFileWrites)" Exclude="@(_CleanPriorFileWritesDeleted)"/>
  5086.     </ItemGroup>
  5087.  
  5088.     <!-- Remove duplicates. -->
  5089.     <RemoveDuplicates Inputs="@(_CleanRemainingFileWritesAfterClean)">
  5090.       <Output TaskParameter="Filtered" ItemName="_CleanUniqueRemainingFileWrites"/>
  5091.     </RemoveDuplicates>
  5092.  
  5093.     <!-- Make sure the directory exists. -->
  5094.     <MakeDir Directories="$(IntermediateOutputPath)"/>
  5095.  
  5096.     <!-- Write new list of current files back to disk. -->
  5097.     <WriteLinesToFile File="$(IntermediateOutputPath)$(CleanFile)" Lines="@(_CleanUniqueRemainingFileWrites)" Overwrite="true" />
  5098.  
  5099.   </Target>
  5100.  
  5101.   <!--
  5102.     ============================================================
  5103.                                         _CleanRecordFileWrites
  5104.  
  5105.     Save the list of all files written to disk so that it can be used for "Clean" later.
  5106.  
  5107.     Files written in prior builds are not removed from Clean cache.
  5108.     ============================================================
  5109.     -->
  5110.   <Target
  5111.        Name="_CleanRecordFileWrites"
  5112.        DependsOnTargets="_CleanGetCurrentAndPriorFileWrites">
  5113.  
  5114.     <!--
  5115.         Merge list of files from prior builds with the current build and then
  5116.         remove duplicates.
  5117.         -->
  5118.     <RemoveDuplicates Inputs="@(_CleanPriorFileWrites);@(_CleanCurrentFileWrites)">
  5119.       <Output TaskParameter="Filtered" ItemName="_CleanUniqueFileWrites"/>
  5120.     </RemoveDuplicates>
  5121.  
  5122.     <!-- Make sure the directory exists. -->
  5123.     <MakeDir Directories="$(IntermediateOutputPath)"/>
  5124.  
  5125.     <!-- Write merged file list back to disk, replacing existing contents. -->
  5126.     <WriteLinesToFile
  5127.         File="$(IntermediateOutputPath)$(CleanFile)"
  5128.         Lines="@(_CleanUniqueFileWrites)"
  5129.         Overwrite="true" />
  5130.  
  5131.   </Target>
  5132.  
  5133.   <!--
  5134.     ============================================================
  5135.                                         CleanPublishFolder
  5136.     ============================================================
  5137.     -->
  5138.   <Target
  5139.       Name="CleanPublishFolder">
  5140.  
  5141.     <RemoveDir
  5142.         Directories="$(PublishDir)"
  5143.         Condition="'$(PublishDir)'=='$(OutputPath)app.publish\' and Exists('$(PublishDir)')"/>
  5144.  
  5145.   </Target>
  5146.  
  5147.  
  5148.  
  5149.  
  5150.   <!--
  5151.     ***********************************************************************************************
  5152.     ***********************************************************************************************
  5153.                                                                 PostBuildEvent Section
  5154.     ***********************************************************************************************
  5155.     ***********************************************************************************************
  5156.     -->
  5157.  
  5158.   <!--
  5159.     ============================================================
  5160.                                         PostBuildEvent
  5161.  
  5162.     Run the post-build event. This step is driven by two parameters:
  5163.  
  5164.     (1) The $(RunPostBuildEvent) property is set by the user through the IDE and can be one of four values.
  5165.  
  5166.         - OnBuildSuccess: In this case, every step of the build must succeed for the post-build step to run.
  5167.         - <Blank>: This is the same as OnBuildSuccess.
  5168.         - OnOutputUpdated: In this case, the post-build step will run only if the main output assembly was
  5169.         actually updated.
  5170.         - Always: The post-build step is always run.
  5171.  
  5172.     (2) The $(_AssemblyTimestampBeforeCompile) and $(_AssemblyTimestampAfterCompile) values are
  5173.         set by the _TimeStampBeforeCompile and _TimeStampAfterCompile targets.  If the assembly was actually
  5174.         rebuilt during this build, then the two values will be different.
  5175.     ============================================================
  5176.     -->
  5177.   <PropertyGroup>
  5178.     <PostBuildEventDependsOn></PostBuildEventDependsOn>
  5179.   </PropertyGroup>
  5180.   <Target
  5181.       Name="PostBuildEvent"
  5182.       Condition="'$(PostBuildEvent)' != '' and ('$(RunPostBuildEvent)' != 'OnOutputUpdated' or '$(_AssemblyTimestampBeforeCompile)' != '$(_AssemblyTimestampAfterCompile)')"
  5183.       DependsOnTargets="$(PostBuildEventDependsOn)">
  5184.  
  5185.     <Exec WorkingDirectory="$(OutDir)" Command="$(PostBuildEvent)" />
  5186.  
  5187.   </Target>
  5188.  
  5189.  
  5190.  
  5191.  
  5192.   <!--
  5193.     ***********************************************************************************************
  5194.     ***********************************************************************************************
  5195.                                                                 Publish Section
  5196.     ***********************************************************************************************
  5197.     ***********************************************************************************************
  5198.     -->
  5199.  
  5200.   <!--
  5201.     ============================================================
  5202.                                         Publish
  5203.  
  5204.     This target is only called when doing ClickOnce publishing outside the IDE, which implicitly builds before publishing.
  5205.     ============================================================
  5206.     -->
  5207.   <PropertyGroup>
  5208.     <PublishDependsOn Condition="'$(PublishableProject)'=='true'">
  5209.       SetGenerateManifests;
  5210.       Build;
  5211.       PublishOnly
  5212.     </PublishDependsOn>
  5213.     <PublishDependsOn Condition="'$(PublishableProject)'!='true'">
  5214.       _DeploymentUnpublishable
  5215.     </PublishDependsOn>
  5216.   </PropertyGroup>
  5217.   <Target
  5218.       Name="Publish"
  5219.       DependsOnTargets="$(PublishDependsOn)"/>
  5220.  
  5221.   <!--
  5222.     ============================================================
  5223.                                         _DeploymentUnpublishable
  5224.  
  5225.     This target is used to block an attempt to ClickOnce publish a non-publishable project, such as a ClassLibrary, when building outside the IDE.
  5226.     ============================================================
  5227.     -->
  5228.   <Target
  5229.       Name="_DeploymentUnpublishable">
  5230.  
  5231.     <Message Text="Skipping unpublishable project."/>
  5232.  
  5233.   </Target>
  5234.  
  5235.   <!--
  5236.     ============================================================
  5237.                                         SetGenerateManifests
  5238.  
  5239.     This target simply assures the GenerateClickOnceManifests property is set whenever the publish target is invoked.
  5240.     ============================================================
  5241.     -->
  5242.   <Target
  5243.       Name="SetGenerateManifests">
  5244.  
  5245.     <Error Condition="'$(OutputType)'!='winexe' and '$(OutputType)'!='exe' and '$(OutputType)'!='appcontainerexe'" Text="Publish is only valid for 'Windows Application' or 'Console Application' project types."/>
  5246.     <Error Condition="'$(_DeploymentSignClickOnceManifests)'=='true' and '$(ManifestCertificateThumbprint)'=='' and '$(ManifestKeyFile)'==''" Text="A signing key is required in order to publish this project. Please specify a ManifestKeyFile or ManifestCertificateThumbprint value. Publishing from Visual Studio will automatically configure a signing key for this project."/>
  5247.  
  5248.     <PropertyGroup>
  5249.       <GenerateClickOnceManifests>true</GenerateClickOnceManifests>
  5250.     </PropertyGroup>
  5251.  
  5252.   </Target>
  5253.  
  5254.   <!--
  5255.     ============================================================
  5256.                                         PublishOnly
  5257.  
  5258.     The "PublishOnly" target is intended for ClickOnce publishing inside the IDE, where the build has already been done
  5259.     by the BuildManager.
  5260.     ============================================================
  5261.     -->
  5262.   <PropertyGroup>
  5263.     <PublishOnlyDependsOn>
  5264.       SetGenerateManifests;
  5265.       PublishBuild;
  5266.       BeforePublish;
  5267.       GenerateManifests;
  5268.       CopyFilesToOutputDirectory;
  5269.       _CopyFilesToPublishFolder;
  5270.       _DeploymentGenerateBootstrapper;
  5271.       ResolveKeySource;
  5272.       _DeploymentSignClickOnceDeployment;
  5273.       AfterPublish
  5274.     </PublishOnlyDependsOn>
  5275.   </PropertyGroup>
  5276.   <Target
  5277.       Name="PublishOnly"
  5278.       DependsOnTargets="$(PublishOnlyDependsOn)"/>
  5279.  
  5280.   <!--
  5281.     ============================================================
  5282.                                         BeforePublish
  5283.  
  5284.     Redefine this target in your project in order to run tasks just before Publish.
  5285.     ============================================================
  5286.     -->
  5287.   <Target Name="BeforePublish"/>
  5288.  
  5289.   <!--
  5290.     ============================================================
  5291.                                         AfterPublish
  5292.  
  5293.     Redefine this target in your project in order to run tasks just after Publish.
  5294.     ============================================================
  5295.     -->
  5296.   <Target Name="AfterPublish"/>
  5297.  
  5298.   <!--
  5299.     ============================================================
  5300.                                         PublishBuild
  5301.  
  5302.     Defines the set of targets that publishing is directly dependent on.
  5303.     ============================================================
  5304.     -->
  5305.   <PropertyGroup>
  5306.     <PublishBuildDependsOn>
  5307.       BuildOnlySettings;
  5308.       PrepareForBuild;
  5309.       ResolveReferences;
  5310.       PrepareResources;
  5311.       ResolveKeySource;
  5312.       GenerateSerializationAssemblies;
  5313.       CreateSatelliteAssemblies;
  5314.     </PublishBuildDependsOn>
  5315.   </PropertyGroup>
  5316.   <Target
  5317.       Name="PublishBuild"
  5318.       DependsOnTargets="$(PublishBuildDependsOn)"/>
  5319.  
  5320.   <!--
  5321.     ============================================================
  5322.                                         _CopyFilesToPublishFolder
  5323.     ============================================================
  5324.     -->
  5325.   <Target
  5326.       Name="_CopyFilesToPublishFolder">
  5327.  
  5328.     <!-- Compute name of application folder, which includes the assembly name plus formatted application version.
  5329.              The application version is formatted to use "_" in place of "." chars (i.e. "1_0_0_0" instead of "1.0.0.0").
  5330.              This is done because some servers misinterpret "." as a file extension. -->
  5331.     <FormatVersion Version="$(ApplicationVersion)" Revision="$(ApplicationRevision)" FormatType="Path">
  5332.       <Output TaskParameter="OutputVersion" PropertyName="_DeploymentApplicationVersionFragment"/>
  5333.     </FormatVersion>
  5334.  
  5335.     <PropertyGroup>
  5336.       <_DeploymentApplicationFolderName>Application Files\$(AssemblyName)_$(_DeploymentApplicationVersionFragment)</_DeploymentApplicationFolderName>
  5337.       <_DeploymentApplicationDir>$(PublishDir)$(_DeploymentApplicationFolderName)\</_DeploymentApplicationDir>
  5338.     </PropertyGroup>
  5339.  
  5340.     <PropertyGroup>
  5341.       <!-- By default we're not using Hard or Symbolic Links to copy to the publish directory, and never when building in VS -->
  5342.      <CreateHardLinksForPublishFilesIfPossible Condition="'$(BuildingInsideVisualStudio)' == 'true' or '$(CreateHardLinksForPublishFilesIfPossible)' == ''">false</CreateHardLinksForPublishFilesIfPossible>
  5343.      <CreateSymbolicLinksForPublishFilesIfPossible Condition="'$(BuildingInsideVisualStudio)' == 'true' or '$(CreateSymbolicLinksForPublishFilesIfPossible)' == ''">false</CreateSymbolicLinksForPublishFilesIfPossible>
  5344.    </PropertyGroup>
  5345.  
  5346.    <!-- Copy files to publish folder -->
  5347.    <Copy
  5348.        SourceFiles=
  5349.                "@(_ApplicationManifestFinal);
  5350.                @(_DeploymentResolvedManifestEntryPoint);
  5351.                @(_DeploymentManifestFiles);
  5352.                @(ReferenceComWrappersToCopyLocal);
  5353.                @(ResolvedIsolatedComModules);
  5354.                @(_DeploymentLooseManifestFile)"
  5355.        DestinationFiles=
  5356.                "@(_ApplicationManifestFinal->'$(_DeploymentApplicationDir)%(TargetPath)');
  5357.                @(_DeploymentManifestEntryPoint->'$(_DeploymentApplicationDir)%(TargetPath)$(_DeploymentFileMappingExtension)');
  5358.                @(_DeploymentManifestFiles->'$(_DeploymentApplicationDir)%(TargetPath)$(_DeploymentFileMappingExtension)');
  5359.                @(ReferenceComWrappersToCopyLocal->'$(_DeploymentApplicationDir)%(FileName)%(Extension)$(_DeploymentFileMappingExtension)');
  5360.                @(ResolvedIsolatedComModules->'$(_DeploymentApplicationDir)%(FileName)%(Extension)$(_DeploymentFileMappingExtension)');
  5361.                @(_DeploymentLooseManifestFile->'$(_DeploymentApplicationDir)%(FileName)%(Extension)$(_DeploymentFileMappingExtension)')"
  5362.        SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
  5363.        OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
  5364.        Retries="$(CopyRetryCount)"
  5365.        UseHardlinksIfPossible="$(CreateHardLinksForPublishFilesIfPossible)"
  5366.        UseSymboliclinksIfPossible="$(CreateSymbolicLinksForPublishFilesIfPossible)"
  5367.        RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"/>
  5368.  
  5369.    <Copy
  5370.        SourceFiles="@(_DeploymentManifestDependencies)"
  5371.        DestinationFiles="@(_DeploymentManifestDependencies->'$(_DeploymentApplicationDir)%(TargetPath)$(_DeploymentFileMappingExtension)')"
  5372.        SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
  5373.        OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
  5374.        Retries="$(CopyRetryCount)"
  5375.        RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
  5376.        UseHardlinksIfPossible="$(CreateHardLinksForPublishFilesIfPossible)"
  5377.        UseSymboliclinksIfPossible="$(CreateSymbolicLinksForPublishFilesIfPossible)"
  5378.        Condition="'%(_DeploymentManifestDependencies.DependencyType)'=='Install'"/>
  5379.  
  5380.    <Copy
  5381.        SourceFiles="@(_ReferenceScatterPaths)"
  5382.        DestinationFiles="@(_ReferenceScatterPaths->'$(_DeploymentApplicationDir)%(Filename)%(Extension)$(_DeploymentFileMappingExtension)')"
  5383.        SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
  5384.        OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
  5385.        Retries="$(CopyRetryCount)"
  5386.        RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
  5387.        UseHardlinksIfPossible="$(CreateHardLinksForPublishFilesIfPossible)"
  5388.        UseSymboliclinksIfPossible="$(CreateSymbolicLinksForPublishFilesIfPossible)"
  5389.            />
  5390.  
  5391.    <FormatUrl InputUrl="$(_DeploymentApplicationUrl)">
  5392.      <Output TaskParameter="OutputUrl" PropertyName="_DeploymentFormattedApplicationUrl"/>
  5393.    </FormatUrl>
  5394.  
  5395.    <FormatUrl InputUrl="$(_DeploymentComponentsUrl)">
  5396.      <Output TaskParameter="OutputUrl" PropertyName="_DeploymentFormattedComponentsUrl"/>
  5397.    </FormatUrl>
  5398.  
  5399.  </Target>
  5400.  
  5401.  <!--
  5402.    ============================================================
  5403.                                        _DeploymentGenerateBootstrapper
  5404.    ============================================================
  5405.    -->
  5406.  <Target
  5407.      Name="_DeploymentGenerateBootstrapper">
  5408.  
  5409.    <!-- Build setup.exe bootstrapper and copy referenced packages -->
  5410.    <GenerateBootstrapper
  5411.        ApplicationFile="$(TargetDeployManifestFileName)"
  5412.        ApplicationName="$(AssemblyName)"
  5413.        ApplicationUrl="$(_DeploymentFormattedApplicationUrl)"
  5414.        BootstrapperItems="@(BootstrapperPackage)"
  5415.        ComponentsLocation="$(BootstrapperComponentsLocation)"
  5416.        ComponentsUrl="$(_DeploymentFormattedComponentsUrl)"
  5417.        Culture="$(TargetCulture)"
  5418.        FallbackCulture="$(FallbackCulture)"
  5419.        OutputPath="$(PublishDir)"
  5420.        SupportUrl="$(_DeploymentFormattedSupportUrl)"
  5421.        Path="$(GenerateBootstrapperSdkPath)"
  5422.        VisualStudioVersion="$(VisualStudioVersion)"
  5423.        Condition="'$(BootstrapperEnabled)'=='true'"/>
  5424.  
  5425.  </Target>
  5426.  
  5427.  <!--
  5428.    ============================================================
  5429.                                        _DeploymentSignClickOnceDeployment
  5430.    ============================================================
  5431.    -->
  5432.  <Target
  5433.      Name="_DeploymentSignClickOnceDeployment">
  5434.  
  5435.    <!-- Sign manifests and the bootstrapper -->
  5436.    <SignFile
  5437.        CertificateThumbprint="$(_DeploymentResolvedManifestCertificateThumbprint)"
  5438.        TimestampUrl="$(ManifestTimestampUrl)"
  5439.        SigningTarget="$(_DeploymentApplicationDir)$(_DeploymentTargetApplicationManifestFileName)"
  5440.        TargetFrameworkVersion="$(TargetFrameworkVersion)"
  5441.        Condition="'$(_DeploymentSignClickOnceManifests)'=='true'" />
  5442.  
  5443.    <!-- Update entry point path in deploy manifest -->
  5444.    <UpdateManifest
  5445.        ApplicationPath="$(_DeploymentApplicationFolderName)\$(_DeploymentTargetApplicationManifestFileName)"
  5446.        TargetFrameworkVersion="$(TargetFrameworkVersion)"
  5447.        ApplicationManifest="$(_DeploymentApplicationDir)$(_DeploymentTargetApplicationManifestFileName)"
  5448.        InputManifest="$(OutDir)$(TargetDeployManifestFileName)"
  5449.        OutputManifest="$(PublishDir)$(TargetDeployManifestFileName)">
  5450.  
  5451.      <Output TaskParameter="OutputManifest" ItemName="PublishedDeployManifest"/>
  5452.  
  5453.    </UpdateManifest>
  5454.  
  5455.    <SignFile
  5456.        CertificateThumbprint="$(_DeploymentResolvedManifestCertificateThumbprint)"
  5457.        TimestampUrl="$(ManifestTimestampUrl)"
  5458.        SigningTarget="$(PublishDir)$(TargetDeployManifestFileName)"
  5459.        TargetFrameworkVersion="$(TargetFrameworkVersion)"
  5460.        Condition="'$(_DeploymentSignClickOnceManifests)'=='true'" />
  5461.  
  5462.    <SignFile
  5463.        CertificateThumbprint="$(_DeploymentResolvedManifestCertificateThumbprint)"
  5464.        TimestampUrl="$(ManifestTimestampUrl)"
  5465.        SigningTarget="$(PublishDir)\setup.exe"
  5466.        Condition="'$(BootstrapperEnabled)'=='true' and '$(_DeploymentSignClickOnceManifests)'=='true'" />
  5467.  
  5468.  
  5469.  </Target>
  5470.  
  5471.  
  5472.  
  5473.  
  5474.  <!--
  5475.    ***********************************************************************************************
  5476.    ***********************************************************************************************
  5477.                                                                AllProjectOutputGroups Section
  5478.    ***********************************************************************************************
  5479.    ***********************************************************************************************
  5480.    -->
  5481.  
  5482.  <!--
  5483.    ============================================================
  5484.                                        AllProjectOutputGroups
  5485.  
  5486.    The targets below drive output groups, which provide generic information about a
  5487.    project's inputs (e.g., content files, compilation sources, etc.) and built outputs
  5488.     (e.g., built EXE/DLL, PDB, XML documentation files, etc.)
  5489.  
  5490.     Each target may produce two kinds of items:  outputs and dependencies.  Outputs are
  5491.     items from the current project; dependencies are items that are brought into the
  5492.     current project as a result of referencing other projects or components.
  5493.  
  5494.     For both outputs and dependencies, the Include attribute
  5495.     specifies the location of the output/dependency; it must be a full path.  Any number
  5496.     of additional attributes may be placed on an output/dependency item.
  5497.     ============================================================
  5498.     -->
  5499.   <Target
  5500.       Name="AllProjectOutputGroups"
  5501.       DependsOnTargets="
  5502.            BuiltProjectOutputGroup;
  5503.            DebugSymbolsProjectOutputGroup;
  5504.            DocumentationProjectOutputGroup;
  5505.            SatelliteDllsProjectOutputGroup;
  5506.            SourceFilesProjectOutputGroup;
  5507.            ContentFilesProjectOutputGroup;
  5508.            SGenFilesOutputGroup"/>
  5509.  
  5510.   <!--
  5511.     This is the key output for the BuiltProjectOutputGroup and is meant to be read directly from the IDE.
  5512.     Reading an item is faster than invoking a target.
  5513.     -->
  5514.   <ItemGroup Condition=" '$(OutputType)' != 'winmdobj' ">
  5515.     <BuiltProjectOutputGroupKeyOutput Include="@(IntermediateAssembly->'%(FullPath)')">
  5516.       <IsKeyOutput>true</IsKeyOutput>
  5517.       <FinalOutputPath>$(TargetPath)</FinalOutputPath>
  5518.       <TargetPath>$(TargetFileName)</TargetPath>
  5519.       <COM2REG Condition="'$(RegisterForComInterop)'=='true' and '$(OutputType)'=='library'">true</COM2REG>
  5520.     </BuiltProjectOutputGroupKeyOutput>
  5521.   </ItemGroup>
  5522.  
  5523.   <ItemGroup Condition=" '$(OutputType)' == 'winmdobj' ">
  5524.     <WinMDExpOutputWindowsMetadataFileItem Include="$(_IntermediateWindowsMetadataPath)" Condition="'$(_IntermediateWindowsMetadataPath)' != ''" />
  5525.     <BuiltProjectOutputGroupKeyOutput Include="@(WinMDExpOutputWindowsMetadataFileItem->'%(FullPath)')">
  5526.       <IsKeyOutput>true</IsKeyOutput>
  5527.       <FinalOutputPath>$(TargetPath)</FinalOutputPath>
  5528.       <TargetPath>$(TargetFileName)</TargetPath>
  5529.     </BuiltProjectOutputGroupKeyOutput>
  5530.   </ItemGroup>
  5531.  
  5532.   <!--
  5533.     ============================================================
  5534.                                         BuiltProjectOutputGroup
  5535.     ============================================================
  5536.     -->
  5537.   <PropertyGroup>
  5538.     <BuiltProjectOutputGroupDependsOn>PrepareForBuild</BuiltProjectOutputGroupDependsOn>
  5539.     <AddAppConfigToBuildOutputs Condition="('$(AddAppConfigToBuildOutputs)'=='') and ('$(OutputType)'!='library' and '$(OutputType)'!='winmdobj')">true</AddAppConfigToBuildOutputs>
  5540.   </PropertyGroup>
  5541.   <Target
  5542.       Name="BuiltProjectOutputGroup"
  5543.       Returns="@(BuiltProjectOutputGroupOutput)"
  5544.       DependsOnTargets="$(BuiltProjectOutputGroupDependsOn)">
  5545.  
  5546.     <ItemGroup>
  5547.       <_BuiltProjectOutputGroupOutputIntermediate Include="@(BuiltProjectOutputGroupKeyOutput)"/>
  5548.     </ItemGroup>
  5549.  
  5550.     <!-- This item represents the app.config file -->
  5551.     <ItemGroup>
  5552.       <_BuiltProjectOutputGroupOutputIntermediate Include="$(AppConfig)"  Condition="'$(AddAppConfigToBuildOutputs)'=='true'">
  5553.         <FinalOutputPath>$(TargetDir)$(TargetFileName).config</FinalOutputPath>
  5554.         <TargetPath>$(TargetFileName).config</TargetPath>
  5555.         <!-- For compatibility with 2.0 -->
  5556.         <OriginalItemSpec>$(AppConfig)</OriginalItemSpec>
  5557.       </_BuiltProjectOutputGroupOutputIntermediate>
  5558.     </ItemGroup>
  5559.  
  5560.     <ItemGroup>
  5561.       <_IsolatedComReference Include="@(COMReference)" Condition=" '%(COMReference.Isolated)' == 'true' "/>
  5562.       <_IsolatedComReference Include="@(COMFileReference)" Condition=" '%(COMFileReference.Isolated)' == 'true' "/>
  5563.     </ItemGroup>
  5564.  
  5565.     <!-- This item represents the native manifest, example: WindowsApplication1.exe.manifest or Native.ClassLibrary1.manifest -->
  5566.     <ItemGroup>
  5567.       <_BuiltProjectOutputGroupOutputIntermediate Include="$(OutDir)$(_DeploymentTargetApplicationManifestFileName)" Condition="'@(NativeReference)'!='' or '@(_IsolatedComReference)'!=''">
  5568.         <TargetPath>$(_DeploymentTargetApplicationManifestFileName)</TargetPath>
  5569.         <!-- For compatibility with 2.0 -->
  5570.         <OriginalItemSpec>$(OutDir)$(_DeploymentTargetApplicationManifestFileName)</OriginalItemSpec>
  5571.       </_BuiltProjectOutputGroupOutputIntermediate>
  5572.     </ItemGroup>
  5573.  
  5574.     <!-- Convert intermediate items into final items; this way we can get the full path for each item -->
  5575.     <ItemGroup>
  5576.       <BuiltProjectOutputGroupOutput Include="@(_BuiltProjectOutputGroupOutputIntermediate->'%(FullPath)')">
  5577.         <!-- For compatibility with 2.0 -->
  5578.         <OriginalItemSpec Condition="'%(_BuiltProjectOutputGroupOutputIntermediate.OriginalItemSpec)' == ''">%(_BuiltProjectOutputGroupOutputIntermediate.FullPath)</OriginalItemSpec>
  5579.       </BuiltProjectOutputGroupOutput>
  5580.     </ItemGroup>
  5581.  
  5582.   </Target>
  5583.  
  5584.   <!--
  5585.     ============================================================
  5586.                                         DebugSymbolsProjectOutputGroup
  5587.  
  5588.     This target performs population of the Debug Symbols project output group.
  5589.     ============================================================
  5590.     -->
  5591.   <PropertyGroup>
  5592.     <DebugSymbolsProjectOutputGroupDependsOn></DebugSymbolsProjectOutputGroupDependsOn>
  5593.   </PropertyGroup>
  5594.   <ItemGroup Condition="'$(_DebugSymbolsProduced)' != 'false' and '$(OutputType)' != 'winmdobj'">
  5595.     <DebugSymbolsProjectOutputGroupOutput Include="@(_DebugSymbolsIntermediatePath->'%(FullPath)')">
  5596.       <FinalOutputPath>@(_DebugSymbolsOutputPath->'%(FullPath)')</FinalOutputPath>
  5597.       <TargetPath>@(_DebugSymbolsIntermediatePath->'%(Filename)%(Extension)')</TargetPath>
  5598.     </DebugSymbolsProjectOutputGroupOutput>
  5599.   </ItemGroup>
  5600.   <ItemGroup Condition="'$(_DebugSymbolsProduced)' != 'false' and '$(OutputType)' == 'winmdobj'">
  5601.     <WinMDExpOutputPdbItem Include="$(WinMDExpOutputPdb)" Condition="'$(WinMDExpOutputPdb)' != ''" />
  5602.     <WinMDExpFinalOutputPdbItem Include="$(_WinMDDebugSymbolsOutputPath)" Condition="'$(_WinMDDebugSymbolsOutputPath)' != ''" />
  5603.     <DebugSymbolsProjectOutputGroupOutput Include="@(WinMDExpOutputPdbItem->'%(FullPath)')">
  5604.       <FinalOutputPath>@(WinMDExpFinalOutputPdbItem->'%(FullPath)')</FinalOutputPath>
  5605.       <TargetPath>@(WinMDExpOutputPdbItem->'%(Filename)%(Extension)')</TargetPath>
  5606.     </DebugSymbolsProjectOutputGroupOutput>
  5607.   </ItemGroup>
  5608.   <Target
  5609.       Name="DebugSymbolsProjectOutputGroup"
  5610.       Returns="@(DebugSymbolsProjectOutputGroupOutput)"
  5611.       DependsOnTargets="$(DebugSymbolsProjectOutputGroupDependsOn)"/>
  5612.  
  5613.   <!--
  5614.     ============================================================
  5615.                                         DocumentationProjectOutputGroup
  5616.  
  5617.     This target performs population of the Documentation project output group.
  5618.     ============================================================
  5619.     -->
  5620.   <PropertyGroup>
  5621.     <DocumentationProjectOutputGroupDependsOn></DocumentationProjectOutputGroupDependsOn>
  5622.   </PropertyGroup>
  5623.   <ItemGroup Condition="'$(DocumentationFile)'!='' and '$(OutputType)' != 'winmdobj'">
  5624.     <DocumentationProjectOutputGroupOutput Include="@(DocFileItem->'%(FullPath)')">
  5625.       <FinalOutputPath>@(FinalDocFile->'%(FullPath)')</FinalOutputPath>
  5626.       <IsKeyOutput>true</IsKeyOutput>
  5627.       <TargetPath>@(DocFileItem->'%(Filename)%(Extension)')</TargetPath>
  5628.     </DocumentationProjectOutputGroupOutput>
  5629.   </ItemGroup>
  5630.   <ItemGroup Condition="'$(DocumentationFile)' != '' and '$(OutputType)' == 'winmdobj'">
  5631.     <WinMDOutputDocumentationFileItem Include="$(WinMDOutputDocumentationFile)" Condition="'$(WinMDOutputDocumentationFile)' != ''" />
  5632.     <WinMDExpFinalOutputDocItem Include="$(_WinMDDocFileOutputPath)" Condition="'$(_WinMDDocFileOutputPath)' != ''" />
  5633.     <DocumentationProjectOutputGroupOutput Include="@(WinMDOutputDocumentationFileItem->'%(FullPath)')">
  5634.       <FinalOutputPath>@(WinMDExpFinalOutputDocItem->'%(FullPath)')</FinalOutputPath>
  5635.       <TargetPath>@(WinMDOutputDocumentationFileItem->'%(Filename)%(Extension)')</TargetPath>
  5636.     </DocumentationProjectOutputGroupOutput>
  5637.   </ItemGroup>
  5638.   <Target
  5639.       Name="DocumentationProjectOutputGroup"
  5640.       Returns="@(DocumentationProjectOutputGroupOutput)"
  5641.       DependsOnTargets="$(DocumentationProjectOutputGroupDependsOn)"/>
  5642.  
  5643.   <!--
  5644.     ============================================================
  5645.                                         SatelliteDllsProjectOutputGroup
  5646.  
  5647.     This target performs population of the Satellite Files project output group.
  5648.     ============================================================
  5649.     -->
  5650.   <PropertyGroup>
  5651.     <SatelliteDllsProjectOutputGroupDependsOn>PrepareForBuild;PrepareResourceNames</SatelliteDllsProjectOutputGroupDependsOn>
  5652.   </PropertyGroup>
  5653.   <Target
  5654.       Name="SatelliteDllsProjectOutputGroup"
  5655.       Returns="@(SatelliteDllsProjectOutputGroupOutput)"
  5656.       DependsOnTargets="$(SatelliteDllsProjectOutputGroupDependsOn)">
  5657.  
  5658.     <ItemGroup>
  5659.       <SatelliteDllsProjectOutputGroupOutputIntermediate Include="$(IntermediateOutputPath)%(EmbeddedResource.Culture)\$(TargetName).resources.dll"
  5660.                                                          Condition="'%(EmbeddedResource.WithCulture)' == 'true'">
  5661.         <TargetPath>%(EmbeddedResource.Culture)\$(TargetName).resources.dll</TargetPath>
  5662.         <Culture>%(EmbeddedResource.Culture)</Culture>
  5663.       </SatelliteDllsProjectOutputGroupOutputIntermediate>
  5664.     </ItemGroup>
  5665.  
  5666.     <!-- Convert intermediate items into final items; this way we can get the full path for each item. -->
  5667.     <ItemGroup>
  5668.       <SatelliteDllsProjectOutputGroupOutput Include="@(SatelliteDllsProjectOutputGroupOutputIntermediate->'%(FullPath)')">
  5669.         <FinalOutputPath Condition=" '%(SatelliteDllsProjectOutputGroupOutputIntermediate.FinalOutputPath)' == '' ">$(TargetDir)%(SatelliteDllsProjectOutputGroupOutputIntermediate.TargetPath)</FinalOutputPath>
  5670.         <!-- For compatibility with 2.0 -->
  5671.         <OriginalItemSpec>%(SatelliteDllsProjectOutputGroupOutputIntermediate.Identity)</OriginalItemSpec>
  5672.       </SatelliteDllsProjectOutputGroupOutput>
  5673.     </ItemGroup>
  5674.  
  5675.   </Target>
  5676.  
  5677.   <!--
  5678.     ============================================================
  5679.                                         SourceFilesProjectOutputGroup
  5680.  
  5681.     This target performs population of the Source Files project output group.
  5682.     Source files are items in the project whose type is "Compile" and "EmbeddedResource".
  5683.     ============================================================
  5684.     -->
  5685.   <PropertyGroup>
  5686.     <SourceFilesProjectOutputGroupDependsOn>PrepareForBuild;AssignTargetPaths</SourceFilesProjectOutputGroupDependsOn>
  5687.   </PropertyGroup>
  5688.   <Target
  5689.       Name="SourceFilesProjectOutputGroup"
  5690.       Returns="@(SourceFilesProjectOutputGroupOutput)"
  5691.       DependsOnTargets="$(SourceFilesProjectOutputGroupDependsOn)">
  5692.  
  5693.     <AssignTargetPath Files="@(Compile)" RootFolder="$(MSBuildProjectDirectory)">
  5694.       <Output TaskParameter="AssignedFiles" ItemName="_CompileWithTargetPath" />
  5695.     </AssignTargetPath>
  5696.  
  5697.     <ItemGroup>
  5698.       <!-- First we deal with Compile, EmbeddedResource and AppConfig -->
  5699.       <SourceFilesProjectOutputGroupOutput Include="@(_CompileWithTargetPath->'%(FullPath)');@(EmbeddedResource->'%(FullPath)');@(_LicxFile->'%(FullPath)');@(AppConfigWithTargetPath->'%(FullPath)')"/>
  5700.  
  5701.       <!-- Include the project file -->
  5702.       <SourceFilesProjectOutputGroupOutput Include="$(MSBuildProjectFullPath)">
  5703.         <!-- For compatibility with 2.0 -->
  5704.         <OriginalItemSpec>$(MSBuildProjectFullPath)</OriginalItemSpec>
  5705.         <TargetPath>$(ProjectFileName)</TargetPath>
  5706.       </SourceFilesProjectOutputGroupOutput>
  5707.     </ItemGroup>
  5708.  
  5709.   </Target>
  5710.  
  5711.   <!-- Get just the compile items -->
  5712.   <Target Name="GetCompile" Returns="@(Compile)"/>
  5713.  
  5714.   <!--
  5715.     ============================================================
  5716.                                         ContentFilesProjectOutputGroup
  5717.  
  5718.     This target performs population of the Content Files project output group.
  5719.     Content files are items in the project whose type is "Content".
  5720.     ============================================================
  5721.     -->
  5722.   <PropertyGroup>
  5723.     <ContentFilesProjectOutputGroupDependsOn>PrepareForBuild;AssignTargetPaths</ContentFilesProjectOutputGroupDependsOn>
  5724.   </PropertyGroup>
  5725.   <Target
  5726.       Name="ContentFilesProjectOutputGroup"
  5727.       Returns="@(ContentFilesProjectOutputGroupOutput)"
  5728.       DependsOnTargets="$(ContentFilesProjectOutputGroupDependsOn)">
  5729.  
  5730.     <!-- Convert items into final items; this way we can get the full path for each item. -->
  5731.     <ItemGroup>
  5732.       <ContentFilesProjectOutputGroupOutput Include="@(ContentWithTargetPath->'%(FullPath)')"/>
  5733.     </ItemGroup>
  5734.  
  5735.   </Target>
  5736.  
  5737.   <!--
  5738.     ============================================================
  5739.                                         SGenFilesOutputGroup
  5740.  
  5741.     This target performs population of the GenerateSerializationAssemblies Files project output group.
  5742.     GenerateSerializationAssemblies files are those generated by the GenerateSerializationAssemblies target and task.
  5743.     ============================================================
  5744.     -->
  5745.   <PropertyGroup>
  5746.     <SGenFilesOutputGroupDependsOn></SGenFilesOutputGroupDependsOn>
  5747.   </PropertyGroup>
  5748.   <ItemGroup
  5749.       Condition="'$(_SGenGenerateSerializationAssembliesConfig)' == 'On' or ('@(WebReferenceUrl)'!='' and '$(_SGenGenerateSerializationAssembliesConfig)' == 'Auto')">
  5750.     <SGenFilesOutputGroupOutput Include="@(_OutputPathItem->'%(FullPath)$(_SGenDllName)')">
  5751.       <FinalOutputPath>@(_OutputPathItem->'%(FullPath)$(_SGenDllName)')</FinalOutputPath>
  5752.       <TargetPath>$(_SGenDllName)</TargetPath>
  5753.     </SGenFilesOutputGroupOutput>
  5754.   </ItemGroup>
  5755.   <Target
  5756.       Name="SGenFilesOutputGroup"
  5757.       Returns="@(SGenFilesOutputGroupOutput)"
  5758.       DependsOnTargets="$(SGenFilesOutputGroupDependsOn)"/>
  5759.  
  5760.   <!--
  5761.     ============================================================
  5762.                                         SDKRelated Output groups
  5763.  
  5764.     These targets are to gather information from the SDKs.
  5765.     ============================================================
  5766.    -->
  5767.   <!-- Get the resolved SDK reference items -->
  5768.   <Target Name="GetResolvedSDKReferences" DependsOnTargets="ResolveSDKReferences" Returns="@(ResolvedSDKReference)"/>
  5769.  
  5770.   <!-- Target will return no results by default but will be populated by other targets elsewhere.
  5771.        Needed for certain build environments that import partial sets of targets. -->
  5772.   <Target Name="CollectReferencedNuGetPackages" Returns="@(ReferencedNuGetPackages)"/>
  5773.  
  5774.   <!--
  5775.     ============================================================
  5776.                                         PriFilesOutputGroup
  5777.  
  5778.     This target performs population of the pri files output group
  5779.     ============================================================
  5780.     -->
  5781.   <Target
  5782.       Name="PriFilesOutputGroup"
  5783.       Condition="'@(_ReferenceRelatedPaths)' != ''"
  5784.       DependsOnTargets="BuildOnlySettings;PrepareForBuild;AssignTargetPaths;ResolveReferences"
  5785.       Returns="@(PriFilesOutputGroupOutput)">
  5786.  
  5787.     <!-- This item represents dependent pri file's -->
  5788.    <ItemGroup>
  5789.      <PriFilesOutputGroupOutput Include="@(_ReferenceRelatedPaths->'%(FullPath)')" Condition="'%(Extension)' == '.pri'"/>
  5790.    </ItemGroup>
  5791.  
  5792.  </Target>
  5793.  
  5794.  <PropertyGroup>
  5795.    <SDKRedistOutputGroupDependsOn>ResolveSDKReferences;ExpandSDKReferences</SDKRedistOutputGroupDependsOn>
  5796.  </PropertyGroup>
  5797.  
  5798.  <!--
  5799.    ============================================================
  5800.                                        SDKRedistOutputGroup
  5801.  
  5802.    This target gathers the Redist folders from the SDKs which have been resolved.
  5803.    ============================================================
  5804.  -->
  5805.  <Target
  5806.      Name="SDKRedistOutputGroup"
  5807.      Returns="@(SDKRedistOutputGroupOutput)"
  5808.      DependsOnTargets="$(SDKRedistOutputGroupDependsOn)">
  5809.  
  5810.       <!-- This list starts with the least specific files to the most specific so that later files can overwrite earlier files-->
  5811.    <ItemGroup>
  5812.      <SDKRedistOutputGroupOutput Include="@(ResolvedRedistFiles)"/>
  5813.    </ItemGroup>
  5814.  </Target>
  5815.  
  5816.  <!--
  5817.    ***********************************************************************************************
  5818.    ***********************************************************************************************
  5819.                                                                AllProjectOutputGroupsDependencies Section
  5820.    ***********************************************************************************************
  5821.    ***********************************************************************************************
  5822.    -->
  5823.  
  5824.  <!--
  5825.    ============================================================
  5826.                                        CommonOutputGroupsDependsOn
  5827.  
  5828.    Dependencies common to many of the *OutputGroupDependencies targets.
  5829.    ============================================================
  5830.    -->
  5831.  <PropertyGroup>
  5832.    <CommonOutputGroupsDependsOn>
  5833.      $(CommonOutputGroupsDependsOn);
  5834.      BuildOnlySettings;
  5835.      PrepareForBuild;
  5836.      AssignTargetPaths;
  5837.      ResolveReferences
  5838.    </CommonOutputGroupsDependsOn>
  5839.  </PropertyGroup>
  5840.  
  5841.  <!--
  5842.    ============================================================
  5843.                                        AllProjectOutputGroupsDependencies
  5844.    ============================================================
  5845.    -->
  5846.  <Target
  5847.      Name="AllProjectOutputGroupsDependencies"
  5848.      DependsOnTargets="
  5849.            BuiltProjectOutputGroupDependencies;
  5850.            DebugSymbolsProjectOutputGroupDependencies;
  5851.            SatelliteDllsProjectOutputGroupDependencies;
  5852.            DocumentationProjectOutputGroupDependencies;
  5853.            SGenFilesOutputGroupDependencies"/>
  5854.  
  5855.  <!--
  5856.    ============================================================
  5857.                                        BuiltProjectOutputGroupDependencies
  5858.  
  5859.    This target performs population of the Built project output group dependencies.
  5860.    ============================================================
  5861.    -->
  5862.  <PropertyGroup>
  5863.    <BuiltProjectOutputGroupDependenciesDependsOn>
  5864.      $(BuiltProjectOutputGroupDependenciesDependsOn);
  5865.      $(CommonOutputGroupsDependsOn)
  5866.    </BuiltProjectOutputGroupDependenciesDependsOn>
  5867.  </PropertyGroup>
  5868.  
  5869.  <Target
  5870.      Name="BuiltProjectOutputGroupDependencies"
  5871.      DependsOnTargets="$(BuiltProjectOutputGroupDependenciesDependsOn)"
  5872.      Returns="@(BuiltProjectOutputGroupDependency)">
  5873.  
  5874.    <ItemGroup>
  5875.      <BuiltProjectOutputGroupDependency  Include="@(ReferencePath->'%(FullPath)');
  5876.                                                         @(ReferenceDependencyPaths->'%(FullPath)');
  5877.                                                         @(NativeReferenceFile->'%(FullPath)');
  5878.                                                         @(_DeploymentLooseManifestFile->'%(FullPath)');
  5879.                                                         @(ResolvedIsolatedComModules->'%(FullPath)')"/>
  5880.    </ItemGroup>
  5881.  
  5882.  </Target>
  5883.  
  5884.  <!--
  5885.    ============================================================
  5886.                                        DebugSymbolsProjectOutputGroupDependencies
  5887.  
  5888.    This target performs population of the dependencies for the debug symbols project output group.
  5889.    ============================================================
  5890.    -->
  5891.  <PropertyGroup>
  5892.    <DebugSymbolsProjectOutputGroupDependenciesDependsOn>
  5893.      $(DebugSymbolsProjectOutputGroupDependenciesDependsOn);
  5894.      $(CommonOutputGroupsDependsOn)
  5895.    </DebugSymbolsProjectOutputGroupDependenciesDependsOn>
  5896.  </PropertyGroup>
  5897.  
  5898.  <Target
  5899.      Name="DebugSymbolsProjectOutputGroupDependencies"
  5900.      Condition="'$(DebugSymbols)'!='false'"
  5901.      DependsOnTargets="$(DebugSymbolsProjectOutputGroupDependenciesDependsOn)"
  5902.      Returns="@(DebugSymbolsProjectOutputGroupDependency)">
  5903.  
  5904.    <!-- This item represents dependent PDB's -->
  5905.     <ItemGroup>
  5906.       <DebugSymbolsProjectOutputGroupDependency Include="@(_ReferenceRelatedPaths->'%(FullPath)')" Condition="'%(Extension)' == '.pdb'"/>
  5907.     </ItemGroup>
  5908.  
  5909.   </Target>
  5910.  
  5911.   <!--
  5912.     ============================================================
  5913.                                         SatelliteDllsProjectOutputGroupDependencies
  5914.  
  5915.     This target performs population of the dependencies for the satellite files project output group.
  5916.     ============================================================
  5917.     -->
  5918.   <PropertyGroup>
  5919.     <SatelliteDllsProjectOutputGroupDependenciesDependsOn>
  5920.       $(SatelliteDllsProjectOutputGroupDependenciesDependsOn);
  5921.       $(CommonOutputGroupsDependsOn)
  5922.     </SatelliteDllsProjectOutputGroupDependenciesDependsOn>
  5923.   </PropertyGroup>
  5924.  
  5925.   <Target
  5926.       Name="SatelliteDllsProjectOutputGroupDependencies"
  5927.       DependsOnTargets="$(SatelliteDllsProjectOutputGroupDependenciesDependsOn)"
  5928.       Returns="@(SatelliteDllsProjectOutputGroupDependency)">
  5929.  
  5930.     <!-- This item represents dependent satellites -->
  5931.     <ItemGroup>
  5932.       <SatelliteDllsProjectOutputGroupDependency Include="@(ReferenceSatellitePaths->'%(FullPath)')"/>
  5933.     </ItemGroup>
  5934.  
  5935.   </Target>
  5936.  
  5937.   <!--
  5938.     ============================================================
  5939.                                         DocumentationProjectOutputGroupDependencies
  5940.  
  5941.     This target performs population of the dependencies for the documentation project output group.
  5942.     ============================================================
  5943.     -->
  5944.   <PropertyGroup>
  5945.     <DocumentationProjectOutputGroupDependenciesDependsOn>
  5946.       $(DocumentationProjectOutputGroupDependenciesDependsOn);
  5947.       $(CommonOutputGroupsDependsOn)
  5948.     </DocumentationProjectOutputGroupDependenciesDependsOn>
  5949.   </PropertyGroup>
  5950.  
  5951.   <Target
  5952.       Name="DocumentationProjectOutputGroupDependencies"
  5953.       Condition="'$(DocumentationFile)'!=''"
  5954.       DependsOnTargets="$(DocumentationProjectOutputGroupDependenciesDependsOn)"
  5955.       Returns="@(DocumentationProjectOutputGroupDependency)">
  5956.  
  5957.     <!-- This item represents dependent XMLs -->
  5958.     <ItemGroup>
  5959.       <DocumentationProjectOutputGroupDependency Include="@(_ReferenceRelatedPaths->'%(FullPath)')" Condition="'%(Extension)' == '.xml'"/>
  5960.     </ItemGroup>
  5961.  
  5962.   </Target>
  5963.  
  5964.   <!--
  5965.     ============================================================
  5966.                                         SGenFilesOutputGroupDependencies
  5967.  
  5968.     This target performs population of the dependencies for the GenerateSerializationAssemblies project output group.
  5969.     ============================================================
  5970.     -->
  5971.   <PropertyGroup>
  5972.     <SGenFilesOutputGroupDependenciesDependsOn>
  5973.       $(SGenFilesOutputGroupDependenciesDependsOn);
  5974.       $(CommonOutputGroupsDependsOn)
  5975.     </SGenFilesOutputGroupDependenciesDependsOn>
  5976.   </PropertyGroup>
  5977.  
  5978.   <Target
  5979.       Name="SGenFilesOutputGroupDependencies"
  5980.       DependsOnTargets="$(SGenFilesOutputGroupDependenciesDependsOn)"
  5981.       Returns="@(SGenFilesOutputGroupDependency)">
  5982.  
  5983.     <!-- This item represents sgen xml serializer dll's -->
  5984.    <ItemGroup>
  5985.      <SGenFilesOutputGroupDependency Include="@(_ReferenceSerializationAssemblyPaths->'%(FullPath)')" Condition="'%(Extension)' == '.dll'"/>
  5986.    </ItemGroup>
  5987.  
  5988.  </Target>
  5989.  
  5990.  <!--
  5991.    ============================================================
  5992.                                        ReferenceCopyLocalPathsOutputGroup
  5993.  
  5994.    Exposes the set of items that should be copied locally based on the project's references.
  5995.     ============================================================
  5996.     -->
  5997.   <PropertyGroup>
  5998.     <ReferenceCopyLocalPathsOutputGroupDependsOn>
  5999.       $(ReferenceCopyLocalPathsOutputGroupDependsOn);
  6000.       $(CommonOutputGroupsDependsOn)
  6001.     </ReferenceCopyLocalPathsOutputGroupDependsOn>
  6002.   </PropertyGroup>
  6003.  
  6004.   <Target
  6005.       Name="ReferenceCopyLocalPathsOutputGroup"
  6006.       DependsOnTargets="$(ReferenceCopyLocalPathsOutputGroupDependsOn)"
  6007.       Returns="@(ReferenceCopyLocalPathsOutputGroupOutput)">
  6008.  
  6009.     <ItemGroup>
  6010.       <ReferenceCopyLocalPathsOutputGroupOutput Include="@(ReferenceCopyLocalPaths)">
  6011.         <TargetPath>%(ReferenceCopyLocalPaths.DestinationSubDirectory)%(ReferenceCopyLocalPaths.Filename)%(ReferenceCopyLocalPaths.Extension)</TargetPath>
  6012.       </ReferenceCopyLocalPathsOutputGroupOutput>
  6013.     </ItemGroup>
  6014.  
  6015.   </Target>
  6016.  
  6017.   <!--
  6018.     ============================================================
  6019.          DesignerRuntimeImplementationProjectOutputGroup
  6020.  
  6021.     Exposes build items to be used by designer. The default is empty, but
  6022.     SDKs can override it as appropriate. The empty stub is required so that
  6023.     the project system can always rely on calling it even if it is not
  6024.     overridden.
  6025.     ============================================================
  6026.     -->
  6027.   <PropertyGroup>
  6028.     <DesignerRuntimeImplementationProjectOutputGroupDependsOn>
  6029.       $(DesignerRuntimeImplementationProjectOutputGroupDependsOn);
  6030.       $(CommonOutputGroupsDependsOn)
  6031.     </DesignerRuntimeImplementationProjectOutputGroupDependsOn>
  6032.   </PropertyGroup>
  6033.  
  6034.   <Target
  6035.       Name="DesignerRuntimeImplementationProjectOutputGroup"
  6036.       DependsOnTargets="$(DesignerRuntimeImplementationProjectOutputGroupDependsOn)"
  6037.       Returns="@(DesignerRuntimeImplementationProjectOutputGroupOutput)">
  6038.   </Target>
  6039.  
  6040.   <!--
  6041.     ============================================================
  6042.                        .editorconfig support
  6043.     ============================================================
  6044.   -->
  6045.   <!-- Expose the set of potential .editorconfig files so the project system can
  6046.        retrieve them. -->
  6047.   <Target Name="GetPotentialEditorConfigFiles" Returns="@(PotentialEditorConfigFiles)" />
  6048.  
  6049.   <PropertyGroup>
  6050.     <CodeAnalysisTargets Condition="'$(CodeAnalysisTargets)'==''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeAnalysis\Microsoft.CodeAnalysis.targets</CodeAnalysisTargets>
  6051.   </PropertyGroup>
  6052.  
  6053.   <Import Project="$(CodeAnalysisTargets)" Condition="Exists('$(CodeAnalysisTargets)')"/>
  6054.  
  6055.   <Import Project="$(ReportingServicesTargets)" Condition="Exists('$(ReportingServicesTargets)')"/>
  6056.  
  6057.   <Import Project="$(MSBuildToolsPath)\Microsoft.NETFramework.targets" Condition="('$(TargetFrameworkIdentifier)' == ''  or '$(TargetFrameworkIdentifier)' == '.NETFramework') and ('$(TargetRuntime)' == 'Managed')"/>
  6058.  
  6059.   <PropertyGroup>
  6060.     <ImportXamlTargets Condition="'$(ImportXamlTargets)'=='' and ('$(TargetFrameworkVersion)' != 'v2.0' and '$(TargetFrameworkVersion)' != 'v3.5') and Exists('$(MSBuildToolsPath)\Microsoft.Xaml.targets')">true</ImportXamlTargets>
  6061.   </PropertyGroup>
  6062.  
  6063.   <Import Project="$(MSBuildToolsPath)\Microsoft.Xaml.targets" Condition="('$(ImportXamlTargets)' == 'true')" />
  6064.  
  6065.   <!-- imports Microsoft.WorkflowBuildExtensions.targets only if TargetFrameworkVersion is v4.5 or above or TargetFrameworkfVersion specified does not conform to the format of vX.X[.X.X] -->
  6066.   <!-- Underlying assumption is that there shouldn't be any other versions between v4.0.* and v4.5 -->
  6067.  <Import Project="$(MSBuildToolsPath)\Microsoft.WorkflowBuildExtensions.targets"
  6068.          Condition="('$(TargetFrameworkVersion)' != 'v2.0' and '$(TargetFrameworkVersion)' != 'v3.5' and (!$([System.String]::IsNullOrEmpty('$(TargetFrameworkVersion)')) and !$(TargetFrameworkVersion.StartsWith('v4.0')))) and Exists('$(MSBuildToolsPath)\Microsoft.WorkflowBuildExtensions.targets')"/>
  6069.  
  6070.  <!-- This import is temporary and will be removed once it is moved into the silverlight targets -->
  6071.  <Import Project="$(MSBuildToolsPath)\Microsoft.WinFX.targets" Condition="'$(TargetFrameworkIdentifier)' == 'Silverlight' and Exists('$(MSBuildToolsPath)\Microsoft.WinFX.targets')"/>
  6072.  
  6073.  <PropertyGroup>
  6074.    <MsTestToolsTargets Condition="'$(MsTestToolsTargets)'==''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TeamTest\Microsoft.TeamTest.targets</MsTestToolsTargets>
  6075.  </PropertyGroup>
  6076.  
  6077.  <Import Project="$(MsTestToolsTargets)" Condition="Exists('$(MsTestToolsTargets)')" />
  6078.  
  6079.  <!-- App packaging support -->
  6080.  
  6081.  <!--
  6082.    Following two targets are needed to be present in every project being built
  6083.    because the app packaging targets recursively scan all projects referenced
  6084.    from projects that generate app packages for them.
  6085.  -->
  6086.  <Target Name="CleanAppxPackage" />
  6087.  <Target Name="GetPackagingOutputs" />
  6088.  
  6089.  <PropertyGroup>
  6090.    <MsAppxPackageTargets Condition="'$(MsAppxPackageTargets)'==''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\AppxPackage\Microsoft.AppXPackage.Targets</MsAppxPackageTargets>
  6091.  </PropertyGroup>
  6092.  
  6093.  <Import Project="$(MsAppxPackageTargets)" Condition="'$(WindowsAppContainer)' == 'true' and Exists('$(MsAppxPackageTargets)')" />
  6094.  
  6095.  <!-- This import is temporary and will be removed once it is moved into the silverlight targets -->
  6096.  <Import Project="$(MSBuildToolsPath)\Microsoft.Data.Entity.targets" Condition="'$(TargetFrameworkIdentifier)' == 'Silverlight' and Exists('$(MSBuildToolsPath)\Microsoft.Data.Entity.targets')"/>
  6097.  
  6098.  <!-- Import NuGet.targets (required for GetReferenceNearestTargetFrameworkTask and used for Restore functionality) -->
  6099.  <PropertyGroup>
  6100.    <NuGetRestoreTargets Condition="'$(NuGetRestoreTargets)'=='' and '$([MSBuild]::IsRunningFromVisualStudio())'=='true'">$(MSBuildToolsPath32)\..\..\..\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets</NuGetRestoreTargets>
  6101.    <NuGetRestoreTargets Condition="'$(NuGetRestoreTargets)'==''">$(MSBuildToolsPath)\NuGet.targets</NuGetRestoreTargets>
  6102.  </PropertyGroup>
  6103.  
  6104.  <Import Condition="Exists('$(NuGetRestoreTargets)')" Project="$(NuGetRestoreTargets)" />
  6105.  
  6106.  <Import Project="$(CustomAfterMicrosoftCommonTargets)" Condition="'$(CustomAfterMicrosoftCommonTargets)' != '' and Exists('$(CustomAfterMicrosoftCommonTargets)')"/>
  6107.  
  6108.  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.targets\ImportAfter\*" Condition="'$(ImportByWildcardAfterMicrosoftCommonTargets)' == 'true' and exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.targets\ImportAfter')"/>
  6109.  <Import Project="$(MSBuildUserExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.targets\ImportAfter\*" Condition="'$(ImportUserLocationsByWildcardAfterMicrosoftCommonTargets)' == 'true' and exists('$(MSBuildUserExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.targets\ImportAfter')"/>
  6110.  
  6111. </Project>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement