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