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