2 ***********************************************************************************************
3 Microsoft.Common.CurrentVersion.targets
5 WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
6 created a backup copy. Incorrect changes to this file will make it
7 impossible to load or build your projects from the command-line or the IDE.
9 This file defines the steps in the standard build process for .NET projects. It
10 contains all the steps that are common among the different .NET languages, such as
11 Visual Basic, and Visual C#.
13 Copyright (C) Microsoft Corporation. All rights reserved.
14 ***********************************************************************************************
17 <Project DefaultTargets="Build" TreatAsLocalProperty="OutDir" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
19 <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="'$(MicrosoftCommonPropsHasBeenImported)' != 'true' and Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
22 <ImportByWildcardBeforeMicrosoftCommonTargets Condition="'$(ImportByWildcardBeforeMicrosoftCommonTargets)' == ''">true</ImportByWildcardBeforeMicrosoftCommonTargets>
23 <ImportByWildcardAfterMicrosoftCommonTargets Condition="'$(ImportByWildcardAfterMicrosoftCommonTargets)' == ''">true</ImportByWildcardAfterMicrosoftCommonTargets>
24 <ImportUserLocationsByWildcardBeforeMicrosoftCommonTargets Condition="'$(ImportUserLocationsByWildcardBeforeMicrosoftCommonTargets)' == ''">true</ImportUserLocationsByWildcardBeforeMicrosoftCommonTargets>
25 <ImportUserLocationsByWildcardAfterMicrosoftCommonTargets Condition="'$(ImportUserLocationsByWildcardAfterMicrosoftCommonTargets)' == ''">true</ImportUserLocationsByWildcardAfterMicrosoftCommonTargets>
28 <Import Project="$(MSBuildUserExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.targets\ImportBefore\*" Condition="'$(ImportUserLocationsByWildcardBeforeMicrosoftCommonTargets)' == 'true' and exists('$(MSBuildUserExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.targets\ImportBefore')"/>
29 <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.targets\ImportBefore\*" Condition="'$(ImportByWildcardBeforeMicrosoftCommonTargets)' == 'true' and exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.targets\ImportBefore')"/>
31 <Import Project="$(MSBuildProjectFullPath).user" Condition="Exists('$(MSBuildProjectFullPath).user')"/>
34 <!-- VS10 without SP1 and without VS11 will not have VisualStudioVersion set, so do that here -->
36 <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
40 <CustomBeforeMicrosoftCommonTargets Condition="'$(CustomBeforeMicrosoftCommonTargets)'==''">$(MSBuildExtensionsPath)\v$(MSBuildToolsVersion)\Custom.Before.Microsoft.Common.targets</CustomBeforeMicrosoftCommonTargets>
41 <CustomAfterMicrosoftCommonTargets Condition="'$(CustomAfterMicrosoftCommonTargets)'==''">$(MSBuildExtensionsPath)\v$(MSBuildToolsVersion)\Custom.After.Microsoft.Common.targets</CustomAfterMicrosoftCommonTargets>
42 <ReportingServicesTargets Condition="'$(ReportingServicesTargets)'==''">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\ReportingServices\Microsoft.ReportingServices.targets</ReportingServicesTargets>
45 <Import Project="$(CustomBeforeMicrosoftCommonTargets)" Condition="'$(CustomBeforeMicrosoftCommonTargets)' != '' and Exists('$(CustomBeforeMicrosoftCommonTargets)')"/>
47 <!-- By default, we are creating a managed app because .NET 2.0 projects did not have this property. -->
48 <PropertyGroup Condition="'$(TargetRuntime)' == ''">
49 <TargetRuntime>Managed</TargetRuntime>
52 <!-- Because .NET 2.0 apps did not set TargetFrameworkIdentifier, we need to set it for them here by default. If
53 the runtime is set to Managed, we also need to set these. Otherwise they should be blank (for instance Javascript or
54 Native apps) because they do not target a .NET Framework. -->
55 <PropertyGroup Condition="'$(TargetRuntime)' == 'Managed'">
56 <TargetFrameworkIdentifier Condition="'$(TargetFrameworkIdentifier)' == ''">.NETFramework</TargetFrameworkIdentifier>
57 <TargetFrameworkVersion Condition=" '$(TargetFrameworkVersion)' == '' ">v4.0</TargetFrameworkVersion>
60 <!-- AvailablePlatforms is the list of platform targets available. -->
62 <AvailablePlatforms Condition="'$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == ''">Any CPU,x86,x64,Itanium</AvailablePlatforms>
63 <AvailablePlatforms Condition="'$(VisualStudioVersion)' != '' and '$(VisualStudioVersion)' > '10.0'">Any CPU,x86,x64</AvailablePlatforms>
66 <!-- Import does NOT apply to .NETCore -->
67 <Import Project="Microsoft.NETFramework.props" Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' or '$(TargetFrameworkIdentifier)' == 'Silverlight'"/>
70 <!-- Yield optimization properties -->
71 <YieldDuringToolExecution Condition="'$(YieldDuringToolExecution)' == ''">true</YieldDuringToolExecution>
74 <PropertyGroup Condition="'$(TargetFrameworkIdentifier)' != '' and '$(TargetFrameworkVersion)' != ''">
75 <TargetFrameworkMoniker Condition="'$(TargetFrameworkMoniker)' == '' and '$(TargetFrameworkProfile)' != ''">$(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion),Profile=$(TargetFrameworkProfile)</TargetFrameworkMoniker>
76 <TargetFrameworkMoniker Condition="'$(TargetFrameworkMoniker)' == ''">$(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion)</TargetFrameworkMoniker>
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
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
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).-->
81 <FrameworkPathOverride Condition="'$(FrameworkPathOverride)' == ''">$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPathToStandardLibraries($(TargetFrameworkIdentifier), $(TargetFrameworkVersion), $(TargetFrameworkProfile), $(PlatformTarget), $(TargetFrameworkRootPath)))</FrameworkPathOverride>
82 <FrameworkPathOverride Condition="!Exists('$(FrameworkPathOverride)\mscorlib.dll')">$(MSBuildFrameworkToolsPath)</FrameworkPathOverride>
86 <TargetPlatformIdentifier Condition="'$(TargetPlatformIdentifier)' == ''">Windows</TargetPlatformIdentifier>
87 <TargetPlatformVersion Condition="'$(TargetPlatformVersion)' == ''">7.0</TargetPlatformVersion>
88 <TargetPlatformSdkPath Condition="'$(TargetPlatformSdkPath)' == '' and '$(TargetPlatformSdkRootOverride)' != ''">$(TargetPlatformSdkRootOverride)\</TargetPlatformSdkPath>
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>
90 <TargetPlatformSdkPath Condition="'$(TargetPlatformSdkPath)' == ''">$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformSDKLocation($(TargetPlatformIdentifier), $(TargetPlatformVersion)))</TargetPlatformSdkPath>
91 <TargetPlatformSdkMetadataLocation Condition="'$(TargetPlatformSdkMetadataLocation)' == '' and Exists('$(TargetPlatformSdkPath)')">$(TargetPlatformSdkPath)Windows Metadata</TargetPlatformSdkMetadataLocation>
92 <TargetPlatformSdkMetadataLocation Condition="Exists('$(TargetPlatformSdkPath)') and ('$(TargetPlatformSdkMetadataLocation)' == '' or !Exists('$(TargetPlatformSdkMetadataLocation)'))">$(TargetPlatformSdkPath)References\CommonConfiguration\Neutral</TargetPlatformSdkMetadataLocation>
93 <TargetPlatformWinMDLocation Condition="'$(TargetPlatformWinMDLocation)' == '' and Exists('$(TargetPlatformSdkMetadataLocation)')">$(TargetPlatformSdkMetadataLocation)</TargetPlatformWinMDLocation>
94 <UseOSWinMdReferences Condition="'$(UseOSWinMdReferences)' == '' and ('$(TargetPlatformWinMDLocation)' == '' and '$(TargetPlatformIdentifier)' == 'Windows' and '$(TargetPlatformVersion)' > '7.0')">true</UseOSWinMdReferences>
95 <TargetPlatformWinMDLocation Condition="'$(UseOsWinMdReferences)' == 'true'">$(WinDir)\System32\WinMetadata</TargetPlatformWinMDLocation>
96 <TargetPlatformMoniker Condition="'$(TargetPlatformMoniker)' == ''">$(TargetPlatformIdentifier),Version=$(TargetPlatformVersion)</TargetPlatformMoniker>
97 <TargetPlatformDisplayName Condition="'$(TargetPlatformDisplayName)' == ''">$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformSDKDisplayName($(TargetPlatformIdentifier), $(TargetPlatformVersion)))</TargetPlatformDisplayName>
101 Several properties must be set in the main project file, before using this .TARGETS file.
102 However, if the properties are not set, we pick some defaults.
105 Indicates the final output location for the project or solution. When building a solution,
106 OutDir can be used to gather multiple project outputs in one location. In addition,
107 OutDir is included in AssemblySearchPaths used for resolving references.
110 This property is usually specified in the project file and is used to initialize OutDir.
111 OutDir and OutputPath are distinguished for legacy reasons, and OutDir should be used if at all possible.
113 BaseIntermediateOutputPath:
114 This is the top level folder where all configuration specific intermediate output folders will be created.
115 Default value is obj\
117 IntermediateOutputPath:
118 This is the full intermediate Output Path, and is derived from BaseIntermediateOutputPath, if none specified
119 (eg. obj\debug). If this property is overridden, then setting BaseIntermediateOutputPath has no effect.
123 <!-- Ensure any OutputPath has a trailing slash, so it can be concatenated -->
124 <OutputPath Condition="'$(OutputPath)' != '' and !HasTrailingSlash('$(OutputPath)')">$(OutputPath)\</OutputPath>
125 <AssemblyName Condition=" '$(AssemblyName)'=='' ">$(MSBuildProjectName)</AssemblyName>
127 Be careful not to give OutputPath a default value in the case of an invalid Configuration/Platform.
128 We use OutputPath specifically to check for invalid configurations/platforms.
130 <OutputPath Condition=" '$(Platform)'=='' and '$(Configuration)'=='' and '$(OutputPath)'=='' ">bin\Debug\</OutputPath>
131 <_OriginalConfiguration>$(Configuration)</_OriginalConfiguration>
132 <_OriginalPlatform>$(Platform)</_OriginalPlatform>
133 <Configuration Condition=" '$(Configuration)'=='' ">Debug</Configuration>
134 <ConfigurationName Condition=" '$(ConfigurationName)' == '' ">$(Configuration)</ConfigurationName>
135 <!-- Example, Debug -->
136 <Platform Condition=" '$(Platform)'=='' ">AnyCPU</Platform>
138 <OutputType Condition=" '$(TargetType)' != ''">$(TargetType)</OutputType>
139 <OutputType Condition=" '$(TargetType)' == 'Container' or '$(TargetType)' == 'DocumentContainer' ">library</OutputType>
140 <OutputType Condition=" '$(OutputType)' == '' ">exe</OutputType>
142 <DebugSymbols Condition=" '$(ConfigurationName)' == 'Debug' and '$(DebugSymbols)' == '' and '$(DebugType)'==''">true</DebugSymbols>
144 <!-- Whether or not a .pdb file is produced. -->
145 <_DebugSymbolsProduced>false</_DebugSymbolsProduced>
146 <_DebugSymbolsProduced Condition="'$(DebugSymbols)'=='true'">true</_DebugSymbolsProduced>
147 <_DebugSymbolsProduced Condition="'$(DebugType)'=='none'">false</_DebugSymbolsProduced>
148 <_DebugSymbolsProduced Condition="'$(DebugType)'=='pdbonly'">true</_DebugSymbolsProduced>
149 <_DebugSymbolsProduced Condition="'$(DebugType)'=='full'">true</_DebugSymbolsProduced>
150 <_DebugSymbolsProduced Condition="'$(DebugType)'=='portable'">true</_DebugSymbolsProduced>
151 <_DebugSymbolsProduced Condition="'$(DebugType)'=='embedded'">false</_DebugSymbolsProduced>
153 <!-- Whether or not a .xml file is produced. -->
154 <_DocumentationFileProduced>true</_DocumentationFileProduced>
155 <_DocumentationFileProduced Condition="'$(DocumentationFile)'==''">false</_DocumentationFileProduced>
157 <!-- Whether or not a reference assembly is produced. -->
158 <ProduceReferenceAssembly Condition="'$(ProduceReferenceAssembly)' == ''">false</ProduceReferenceAssembly>
161 <PropertyGroup Condition=" '$(OutputPath)' == '' ">
163 A blank OutputPath at this point means that the user passed in an invalid Configuration/Platform
164 combination. Whether this is considered an error or a warning depends on the value of
165 $(SkipInvalidConfigurations).
167 <_InvalidConfigurationError Condition=" '$(SkipInvalidConfigurations)' != 'true' ">true</_InvalidConfigurationError>
168 <_InvalidConfigurationWarning Condition=" '$(SkipInvalidConfigurations)' == 'true' ">true</_InvalidConfigurationWarning>
172 IDE Macros available from both integrated builds and from command line builds.
173 The following properties are 'macros' that are available via IDE for
174 pre and post build steps.
177 <TargetExt Condition="'$(TargetExt)' == '' and '$(OutputType)'=='exe'">.exe</TargetExt>
178 <TargetExt Condition="'$(TargetExt)' == '' and '$(OutputType)'=='winexe'">.exe</TargetExt>
179 <TargetExt Condition="'$(TargetExt)' == '' and '$(OutputType)'=='appcontainerexe'">.exe</TargetExt>
180 <TargetExt Condition="'$(TargetExt)' == '' and '$(OutputType)'=='library'">.dll</TargetExt>
181 <TargetExt Condition="'$(TargetExt)' == '' and '$(OutputType)'=='module'">.netmodule</TargetExt>
182 <TargetExt Condition="'$(TargetExt)' == '' and '$(OutputType)'=='winmdobj'">.winmdobj</TargetExt>
187 <!-- Required for enabling Team Build for packaging app package-generating projects -->
188 <OutDirWasSpecified Condition=" '$(OutDir)'!='' and '$(OutDirWasSpecified)'=='' ">true</OutDirWasSpecified>
190 <OutDir Condition=" '$(OutDir)' == '' ">$(OutputPath)</OutDir>
191 <!-- Example, bin\Debug\ -->
192 <!-- Ensure OutDir has a trailing slash, so it can be concatenated -->
193 <OutDir Condition="'$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)')">$(OutDir)\</OutDir>
194 <ProjectName Condition=" '$(ProjectName)' == '' ">$(MSBuildProjectName)</ProjectName>
195 <!-- Example, MyProject -->
197 <!-- For projects that generate app packages or ones that want a per-project output directory, update OutDir to include the project name -->
198 <OutDir Condition="'$(OutDir)' != '' and '$(OutDirWasSpecified)' == 'true' and (('$(WindowsAppContainer)' == 'true' and '$(GenerateProjectSpecificOutputFolder)' != 'false') or '$(GenerateProjectSpecificOutputFolder)' == 'true')">$(OutDir)$(ProjectName)\</OutDir>
200 <TargetName Condition="'$(TargetName)' == '' and '$(OutputType)' == 'winmdobj' and '$(RootNamespace)' != ''">$(RootNamespace)</TargetName>
201 <TargetName Condition=" '$(TargetName)' == '' ">$(AssemblyName)</TargetName>
202 <!-- Example, MyAssembly -->
203 <ProjectFileName Condition=" '$(ProjectFileName)' == '' ">$(MSBuildProjectFile)</ProjectFileName>
204 <!-- Example, MyProject.csproj -->
205 <ProjectExt Condition=" '$(ProjectExt)' == '' ">$(MSBuildProjectExtension)</ProjectExt>
206 <!-- Example, .csproj -->
207 <WinMDExpOutputWindowsMetadataFilename Condition="'$(WinMDExpOutputWindowsMetadataFilename)' == '' and '$(OutputType)' == 'winmdobj'">$(TargetName).winmd</WinMDExpOutputWindowsMetadataFilename>
208 <TargetFileName Condition=" '$(TargetFileName)' == '' and '$(OutputType)' == 'winmdobj'">$(WinMDExpOutputWindowsMetadataFilename)</TargetFileName>
209 <TargetFileName Condition=" '$(TargetFileName)' == '' ">$(TargetName)$(TargetExt)</TargetFileName>
211 <!-- Example, MyAssembly.dll -->
216 The PublishableProject property is used when invoking the publish target on a solution that
217 contains multiple projects. The property determines which projects should be published, and
218 which projects should be skipped in the publish target. By default any "Windows Application"
219 or "Console Application" project type is publishable. However, a project that would otherwise
220 be published can be skipped by defining the PublishableProject property in the project itself.
222 <_DeploymentPublishableProjectDefault Condition="'$(OutputType)'=='winexe' or '$(OutputType)'=='exe' or '$(OutputType)'=='appcontainerexe'">true</_DeploymentPublishableProjectDefault>
223 <PublishableProject Condition="'$(PublishableProject)'==''">$(_DeploymentPublishableProjectDefault)</PublishableProject>
225 <_DeploymentTargetApplicationManifestFileName Condition="'$(OutputType)'=='library'">Native.$(AssemblyName).manifest</_DeploymentTargetApplicationManifestFileName>
226 <!-- Example, Native.MyAssembly.manifest -->
227 <_DeploymentTargetApplicationManifestFileName Condition="'$(OutputType)'=='winexe'">$(TargetFileName).manifest</_DeploymentTargetApplicationManifestFileName>
228 <!-- Example, MyAssembly.exe.manifest -->
229 <_DeploymentTargetApplicationManifestFileName Condition="'$(OutputType)'=='exe'">$(TargetFileName).manifest</_DeploymentTargetApplicationManifestFileName>
230 <!-- Example, MyAssembly.exe.manifest -->
231 <_DeploymentTargetApplicationManifestFileName Condition="'$(OutputType)'=='appcontainerexe'">$(TargetFileName).manifest</_DeploymentTargetApplicationManifestFileName>
232 <!-- Example, MyAssembly.exe.manifest -->
233 <TargetDeployManifestFileName Condition="'$(TargetDeployManifestFileName)' == '' and '$(HostInBrowser)' != 'true'">$(AssemblyName).application</TargetDeployManifestFileName>
234 <!-- Example, MyAssembly.application -->
235 <TargetDeployManifestFileName Condition="'$(TargetDeployManifestFileName)' == '' and '$(HostInBrowser)' == 'true'">$(AssemblyName).xbap</TargetDeployManifestFileName>
236 <!-- Example, MyAssembly.xbap -->
237 <GenerateClickOnceManifests Condition="'$(OutputType)'=='winexe' or '$(OutputType)'=='exe' or '$(OutputType)'=='appcontainerexe'">$(GenerateManifests)</GenerateClickOnceManifests>
239 <_DeploymentApplicationManifestIdentity Condition="'$(OutputType)'=='library'">Native.$(AssemblyName)</_DeploymentApplicationManifestIdentity>
240 <_DeploymentApplicationManifestIdentity Condition="'$(OutputType)'=='winexe'">$(AssemblyName).exe</_DeploymentApplicationManifestIdentity>
241 <_DeploymentApplicationManifestIdentity Condition="'$(OutputType)'=='exe'">$(AssemblyName).exe</_DeploymentApplicationManifestIdentity>
242 <_DeploymentApplicationManifestIdentity Condition="'$(OutputType)'=='appcontainerexe'">$(AssemblyName).exe</_DeploymentApplicationManifestIdentity>
243 <_DeploymentDeployManifestIdentity Condition="'$(HostInBrowser)' != 'true'">$(AssemblyName).application</_DeploymentDeployManifestIdentity>
244 <_DeploymentDeployManifestIdentity Condition="'$(HostInBrowser)' == 'true'">$(AssemblyName).xbap</_DeploymentDeployManifestIdentity>
246 <_DeploymentFileMappingExtension Condition="'$(MapFileExtensions)'=='true'">.deploy</_DeploymentFileMappingExtension>
247 <_DeploymentFileMappingExtension Condition="'$(MapFileExtensions)'!='true'"></_DeploymentFileMappingExtension>
249 <_DeploymentBuiltUpdateInterval Condition="'$(UpdatePeriodically)'=='true'">$(UpdateInterval)</_DeploymentBuiltUpdateInterval>
250 <_DeploymentBuiltUpdateIntervalUnits Condition="'$(UpdatePeriodically)'=='true'">$(UpdateIntervalUnits)</_DeploymentBuiltUpdateIntervalUnits>
251 <_DeploymentBuiltUpdateInterval Condition="'$(UpdatePeriodically)'!='true'">0</_DeploymentBuiltUpdateInterval>
252 <_DeploymentBuiltUpdateIntervalUnits Condition="'$(UpdatePeriodically)'!='true'">Days</_DeploymentBuiltUpdateIntervalUnits>
253 <_DeploymentBuiltMinimumRequiredVersion Condition="'$(UpdateRequired)'=='true' and '$(Install)'=='true'">$(MinimumRequiredVersion)</_DeploymentBuiltMinimumRequiredVersion>
255 <MaxTargetPath Condition="'$(MaxTargetPath)'==''">100</MaxTargetPath>
260 By default, GenerateApplicationManifest puts all satellite assemblies to the manifest
261 record by default by setting TargetCulture to *.
263 <TargetCulture Condition="'$(TargetCulture)'==''">*</TargetCulture>
264 <FallbackCulture Condition="'$(UICulture)'!='' and '$(FallbackCulture)'==''">$(UICulture)</FallbackCulture>
268 <!-- Not used any more-->
269 <_OutputPathItem Include="$(OutDir)"/>
271 <_UnmanagedRegistrationCache Include="$(BaseIntermediateOutputPath)$(MSBuildProjectFile).UnmanagedRegistration.cache"/>
272 <_ResolveComReferenceCache Include="$(IntermediateOutputPath)$(MSBuildProjectFile).ResolveComReference.cache"/>
276 <!-- Example, c:\MyProjects\MyProject\bin\debug\ -->
278 Condition intentionally omitted on this one, because it causes problems
279 when we pick up the value of an environment variable named TargetDir
281 <TargetDir Condition="'$(OutDir)' != ''">$([MSBuild]::Escape($([System.IO.Path]::GetFullPath(`$([System.IO.Path]::Combine(`$(MSBuildProjectDirectory)`, `$(OutDir)`))`))))</TargetDir>
283 <!-- Example, c:\MyProjects\MyProject\bin\debug\MyAssembly.dll -->
284 <TargetPath Condition=" '$(TargetPath)' == '' ">$(TargetDir)$(TargetFileName)</TargetPath>
286 <TargetRefPath Condition=" '$(TargetRefPath)' == '' and '$(ProduceReferenceAssembly)' == 'true' ">$([MSBuild]::NormalizePath($(TargetDir), 'ref', $(TargetFileName)))</TargetRefPath>
288 <!-- Example, c:\MyProjects\MyProject\ -->
289 <ProjectDir Condition=" '$(ProjectDir)' == '' ">$(MSBuildProjectDirectory)\</ProjectDir>
291 <!-- Example, c:\MyProjects\MyProject\MyProject.csproj -->
292 <ProjectPath Condition=" '$(ProjectPath)' == '' ">$(ProjectDir)$(ProjectFileName)</ProjectPath>
294 <!-- Example, AnyCPU -->
295 <PlatformName Condition=" '$(PlatformName)' == '' ">$(Platform)</PlatformName>
299 <!-- This is not used here but remains for backwards compatibility -->
300 <AppConfigFileDestination Include="$(OutDir)$(TargetFileName).config"/>
304 IDE Macros available only from integrated builds.
305 The following properties are 'macros' that are available via IDE for
306 pre and post build steps. However, they are not defined when directly building
307 a project from the command line, only when building a solution.
310 <DevEnvDir Condition="'$(DevEnvDir)'==''">*Undefined*</DevEnvDir>
311 <SolutionName Condition="'$(SolutionName)'==''">*Undefined*</SolutionName>
312 <!-- Example, MySolution -->
313 <SolutionFileName Condition="'$(SolutionFileName)'==''">*Undefined*</SolutionFileName>
314 <!-- Example, MySolution.sln -->
315 <SolutionPath Condition="'$(SolutionPath)'==''">*Undefined*</SolutionPath>
316 <!-- Example, f:\MySolutions\MySolution\MySolution.sln -->
317 <SolutionDir Condition="'$(SolutionDir)'==''">*Undefined*</SolutionDir>
318 <!-- Example, f:\MySolutions\MySolution\ -->
319 <SolutionExt Condition="'$(SolutionExt)'==''">*Undefined*</SolutionExt>
320 <!-- Example, .sln -->
324 <GenerateBindingRedirectsOutputType Condition="'$(OutputType)'=='exe' or '$(OutputType)'=='winexe'">true</GenerateBindingRedirectsOutputType>
326 <PropertyGroup Condition="'$(AutoUnifyAssemblyReferences)' == ''">
327 <AutoUnifyAssemblyReferences>true</AutoUnifyAssemblyReferences>
328 <AutoUnifyAssemblyReferences Condition="'$(GenerateBindingRedirectsOutputType)' == 'true' and '$(AutoGenerateBindingRedirects)' != 'true'">false</AutoUnifyAssemblyReferences>
331 <BaseIntermediateOutputPath Condition="!HasTrailingSlash('$(BaseIntermediateOutputPath)')">$(BaseIntermediateOutputPath)\</BaseIntermediateOutputPath>
332 <CleanFile Condition="'$(CleanFile)'==''">$(MSBuildProjectFile).FileListAbsolute.txt</CleanFile>
333 <!-- During DesignTime Builds, skip project reference build as Design time is only queueing information.-->
334 <BuildProjectReferences Condition="'$(BuildProjectReferences)' == '' and '$(DesignTimeBuild)' == 'true'">false</BuildProjectReferences>
335 <!-- By default we will build (and if applicable, clean) all project references. But this can be used to disable that-->
336 <BuildProjectReferences Condition="'$(BuildProjectReferences)' == ''">true</BuildProjectReferences>
337 <BuildInParallel Condition="'$(BuildInParallel)' == ''">true</BuildInParallel>
338 <_ResolveReferenceDependencies Condition="'$(_ResolveReferenceDependencies)' == ''">false</_ResolveReferenceDependencies>
339 <_GetChildProjectCopyToOutputDirectoryItems Condition="'$(_GetChildProjectCopyToOutputDirectoryItems)' == ''">true</_GetChildProjectCopyToOutputDirectoryItems>
340 <OverwriteReadOnlyFiles Condition="'$(OverwriteReadOnlyFiles)' == ''">false</OverwriteReadOnlyFiles>
341 <ComReferenceNoClassMembers Condition="'$(ComReferenceNoClassMembers)' == ''">false</ComReferenceNoClassMembers>
344 <PropertyGroup Condition=" $(IntermediateOutputPath) == '' ">
345 <IntermediateOutputPath Condition=" '$(PlatformName)' == 'AnyCPU' ">$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath>
346 <IntermediateOutputPath Condition=" '$(PlatformName)' != 'AnyCPU' ">$(BaseIntermediateOutputPath)$(PlatformName)\$(Configuration)\</IntermediateOutputPath>
349 <IntermediateOutputPath Condition="!HasTrailingSlash('$(IntermediateOutputPath)')">$(IntermediateOutputPath)\</IntermediateOutputPath>
350 <_GenerateBindingRedirectsIntermediateAppConfig>$(IntermediateOutputPath)$(MSBuildProjectFile).$(TargetFileName).config</_GenerateBindingRedirectsIntermediateAppConfig>
353 <IntermediateAssembly Include="$(IntermediateOutputPath)$(TargetName)$(TargetExt)"/>
354 <FinalDocFile Include="@(DocFileItem->'$(OutDir)%(Filename)%(Extension)')"/>
355 <CopyUpToDateMarker Include="$([MSBuild]::NormalizePath('$(MSBuildProjectDirectory)', '$(IntermediateOutputPath)', '$(MSBuildProjectFile).CopyComplete'))" />
358 <ItemGroup Condition="'$(ProduceReferenceAssembly)' == 'true'">
359 <IntermediateRefAssembly Include="$(IntermediateOutputPath)ref\$(TargetName)$(TargetExt)" Condition="'@(IntermediateRefAssembly)' == ''" />
360 <CreateDirectory Include="@(IntermediateRefAssembly->'%(RootDir)%(Directory)')" />
361 <CreateDirectory Include="$(OutDir)ref" />
364 <ItemGroup Condition="'$(_DebugSymbolsProduced)' == 'true'">
365 <_DebugSymbolsIntermediatePath Include="$(IntermediateOutputPath)$(TargetName).compile.pdb" Condition="'$(OutputType)' == 'winmdobj' and '@(_DebugSymbolsIntermediatePath)' == ''"/>
366 <_DebugSymbolsIntermediatePath Include="$(IntermediateOutputPath)$(TargetName).pdb" Condition="'$(OutputType)' != 'winmdobj' and '@(_DebugSymbolsIntermediatePath)' == ''"/>
367 <_DebugSymbolsOutputPath Include="@(_DebugSymbolsIntermediatePath->'$(OutDir)%(Filename)%(Extension)')" />
370 <PropertyGroup Condition="'$(_DebugSymbolsProduced)' == 'true' and '$(OutputType)' == 'winmdobj'">
371 <WinMDExpOutputPdb Condition="'$(WinMDExpOutputPdb)' == ''">$(IntermediateOutputPath)$(TargetName).pdb</WinMDExpOutputPdb>
372 <_WinMDDebugSymbolsOutputPath>$([System.IO.Path]::Combine('$(OutDir)', $([System.IO.Path]::GetFileName('$(WinMDExpOutputPdb)'))))</_WinMDDebugSymbolsOutputPath>
375 <PropertyGroup Condition="'$(OutputType)' == 'winmdobj' and '$(DocumentationFile)'!=''">
376 <WinMDOutputDocumentationFile Condition="'$(WinMDOutputDocumentationFile)' == ''">$(IntermediateOutputPath)$(TargetName).xml</WinMDOutputDocumentationFile>
377 <_WinMDDocFileOutputPath>$([System.IO.Path]::Combine('$(OutDir)', $([System.IO.Path]::GetFileName('$(WinMDOutputDocumentationFile)'))))</_WinMDDocFileOutputPath>
380 <PropertyGroup Condition="'$(WinMDExpOutputWindowsMetadataFilename)' != ''">
381 <_IntermediateWindowsMetadataPath>$(IntermediateOutputPath)$(WinMDExpOutputWindowsMetadataFilename)</_IntermediateWindowsMetadataPath>
382 <_WindowsMetadataOutputPath>$(OutDir)$(WinMDExpOutputWindowsMetadataFilename)</_WindowsMetadataOutputPath>
386 <!-- Create an item for entry point of the ClickOnce application (Example: WindowsApplication1.exe) -->
387 <_DeploymentManifestEntryPoint Include="@(IntermediateAssembly)">
388 <TargetPath>$(TargetFileName)</TargetPath>
389 </_DeploymentManifestEntryPoint>
391 <!-- Create an item for the application icon if one exists in the project (Example: app.ico) -->
392 <!-- NOTE: The item Include and the Exists function are operating relative to the PROJECT (.csproj, .vbproj etc.) directory in this case -->
393 <_DeploymentManifestIconFile Include="$(ApplicationIcon)" Condition="Exists('$(ApplicationIcon)')">
394 <TargetPath>$(ApplicationIcon)</TargetPath>
395 </_DeploymentManifestIconFile>
397 <!-- Create an item for the output application manifest (Example: WindowsApplication1.exe.manifeset) -->
398 <ApplicationManifest Include="$(IntermediateOutputPath)$(_DeploymentTargetApplicationManifestFileName)">
399 <TargetPath>$(_DeploymentTargetApplicationManifestFileName)</TargetPath>
400 </ApplicationManifest>
402 <!-- Create an item for the final application manifest (Example: WindowsApplication1.exe.manifeset)
403 This item represents the final output application manifest used for project-to-project
404 references and for copying to the publish output location. -->
405 <_ApplicationManifestFinal Include="$(OutDir)$(_DeploymentTargetApplicationManifestFileName)">
406 <TargetPath>$(_DeploymentTargetApplicationManifestFileName)</TargetPath>
407 </_ApplicationManifestFinal>
409 <!-- Create an item for the output deploy manifest (Example: WindowsApplication1.application) -->
410 <DeployManifest Include="$(IntermediateOutputPath)$(TargetDeployManifestFileName)">
411 <TargetPath>$(TargetDeployManifestFileName)</TargetPath>
414 <!-- Create an item for the intermediate trust info file -->
415 <_DeploymentIntermediateTrustInfoFile Include="$(IntermediateOutputPath)$(TargetName).TrustInfo.xml" Condition="'$(TargetZone)'!=''"/>
419 Determine the <deploymentProvider> (_DeploymentUrl) for the ClickOnce deployment manifest.
420 Prefer the UpdateUrl, falling back to InstallUrl or PublishUrl if not specified.
421 If the UpdateUrl is specified then _DeploymentUrl is always set to the UpdateUrl.
422 Otherwise, only set the _DeploymentUrl if it's an installed app and updates are enabled.
425 <_DeploymentUrl Condition="'$(_DeploymentUrl)'==''">$(UpdateUrl)</_DeploymentUrl>
426 <_DeploymentUrl Condition="'$(_DeploymentUrl)'==''">$(InstallUrl)</_DeploymentUrl>
427 <_DeploymentUrl Condition="'$(_DeploymentUrl)'==''">$(PublishUrl)</_DeploymentUrl>
428 <_DeploymentUrl Condition="!('$(UpdateUrl)'=='') and '$(Install)'=='false'"></_DeploymentUrl>
429 <_DeploymentUrl Condition="'$(_DeploymentUrl)'!=''">$(_DeploymentUrl)$(TargetDeployManifestFileName)</_DeploymentUrl>
431 Need to explicitly blank out the _DeploymentUrl when it's not used. Otherwise an
432 inappropriate value may be used. For example a local path from the PublishUrl
433 is something we never want to see in the manifest because it means you could
434 only install the app from that machine.
436 <_DeploymentUrl Condition="'$(UpdateUrl)'=='' and !('$(Install)'=='true' and '$(UpdateEnabled)'=='true')"></_DeploymentUrl>
437 <_DeploymentUrl Condition="'$(ExcludeDeploymentUrl)'=='true'"></_DeploymentUrl>
440 <!-- Determine the URLs for the bootstrapper. -->
442 <_DeploymentApplicationUrl Condition="'$(IsWebBootstrapper)'=='true'">$(InstallUrl)</_DeploymentApplicationUrl>
443 <_DeploymentApplicationUrl Condition="'$(IsWebBootstrapper)'=='true' and '$(InstallUrl)'==''">$(PublishUrl)</_DeploymentApplicationUrl>
444 <_DeploymentComponentsUrl Condition="'$(BootstrapperComponentsLocation)'=='Absolute'">$(BootstrapperComponentsUrl)</_DeploymentComponentsUrl>
447 <!-- Output location for publish target. -->
449 <PublishDir Condition="'$(PublishDir)' != '' and !HasTrailingSlash('$(PublishDir)')">$(PublishDir)\</PublishDir>
450 <PublishDir Condition="'$(PublishDir)'==''">$(OutputPath)app.publish\</PublishDir>
454 ProcessorArchitecture is the target processor architecture.
456 <PropertyGroup Condition="'$(ProcessorArchitecture)'==''">
458 If ProcessorArchitecture is not set, set it to PlatformTarget
459 Note: if $(PlatformTarget) is also blank resolve assembly reference defaults to msil which is the
460 desired behavior in this case
462 <ProcessorArchitecture>$(PlatformTarget)</ProcessorArchitecture>
465 If Processor architecture is not set and PlatformTarget is a known target translate the
466 PlatformTarget into something ResolveAssemblyReference knows about
468 <ProcessorArchitecture Condition=" '$(PlatformTarget)' == 'AnyCpu' ">msil</ProcessorArchitecture>
469 <ProcessorArchitecture Condition=" '$(PlatformTarget)' == 'x64' ">amd64</ProcessorArchitecture>
470 <ProcessorArchitecture Condition=" '$(PlatformTarget)' == 'Itanium' ">ia64</ProcessorArchitecture>
471 <ProcessorArchitecture Condition=" '$(PlatformTarget)' == 'x86' ">x86</ProcessorArchitecture>
472 <ProcessorArchitecture Condition=" '$(PlatformTarget)' == 'ARM' ">arm</ProcessorArchitecture>
476 <ConsiderPlatformAsProcessorArchitecture Condition="'$(ConsiderPlatformAsProcessorArchitecture)' == ''">true</ConsiderPlatformAsProcessorArchitecture>
479 <PropertyGroup Condition="'$(ProcessorArchitecture)' == '' and '$(ConsiderPlatformAsProcessorArchitecture)' == 'true'">
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 -->
481 <ProcessorArchitectureAsPlatform>$(Platform)</ProcessorArchitectureAsPlatform>
482 <ProcessorArchitecture Condition=" '$(ProcessorArchitectureAsPlatform)' == 'AnyCpu' or '$(ProcessorArchitectureAsPlatform)' == 'Any Cpu'">msil</ProcessorArchitecture>
483 <ProcessorArchitecture Condition=" '$(ProcessorArchitectureAsPlatform)' == 'x64' or '$(ProcessorArchitectureAsPlatform)' == 'amd64'">amd64</ProcessorArchitecture>
484 <ProcessorArchitecture Condition=" '$(ProcessorArchitectureAsPlatform)' == 'Itanium' ">ia64</ProcessorArchitecture>
485 <ProcessorArchitecture Condition=" '$(ProcessorArchitectureAsPlatform)' == 'x86' or '$(ProcessorArchitectureAsPlatform)' == 'win32'">x86</ProcessorArchitecture>
486 <ProcessorArchitecture Condition=" '$(ProcessorArchitectureAsPlatform)' == 'ARM' ">arm</ProcessorArchitecture>
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-->
489 <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch Condition="'$(ProcessorArchitecture)'==''">None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
490 <ProcessorArchitecture Condition="'$(ProcessorArchitecture)'==''">$(PROCESSOR_ARCHITECTURE)</ProcessorArchitecture>
494 <!-- Sensible defaults for the most-commonly-desired MSBuildRuntime and MSBuildArchitecture values -->
495 <PropertyGroup Condition="'$(DisableOutOfProcTaskHost)' == ''">
496 <TargetFrameworkAsMSBuildRuntime Condition="'$(TargetFrameworkVersion)' == 'v2.0' or '$(TargetFrameworkVersion)' == 'v3.0' or '$(TargetFrameworkVersion)' == 'v3.5'">CLR2</TargetFrameworkAsMSBuildRuntime>
497 <TargetFrameworkAsMSBuildRuntime Condition="'$(TargetFrameworkVersion)' == 'v4.0' or '$(TargetFrameworkVersion)' == 'v4.5'">CLR4</TargetFrameworkAsMSBuildRuntime>
498 <TargetFrameworkAsMSBuildRuntime Condition="'$(TargetFrameworkAsMSBuildRuntime)' == ''">CurrentRuntime</TargetFrameworkAsMSBuildRuntime>
500 <PlatformTargetAsMSBuildArchitectureExplicitlySet Condition="'$(PlatformTargetAsMSBuildArchitecture)' != ''">true</PlatformTargetAsMSBuildArchitectureExplicitlySet>
501 <PlatformTargetAsMSBuildArchitectureExplicitlySet Condition="'$(PlatformTargetAsMSBuildArchitecture)' == ''">false</PlatformTargetAsMSBuildArchitectureExplicitlySet>
503 <PlatformTargetAsMSBuildArchitecture Condition="'$(PlatformTarget)' == 'x86' or ('$(PlatformTarget)' == 'x64' and '$(MSBuildExtensionsPath64)' != '')">$(PlatformTarget)</PlatformTargetAsMSBuildArchitecture>
504 <PlatformTargetAsMSBuildArchitecture Condition="'$(PlatformTarget)' == 'arm'">x86</PlatformTargetAsMSBuildArchitecture>
505 <PlatformTargetAsMSBuildArchitecture Condition="('$(PlatformTarget)' == 'ia64' and '$(MSBuildExtensionsPath64)' != '')">x64</PlatformTargetAsMSBuildArchitecture>
506 <PlatformTargetAsMSBuildArchitecture Condition="'$(PlatformTargetAsMSBuildArchitecture)' == ''">CurrentArchitecture</PlatformTargetAsMSBuildArchitecture>
509 <!-- Flavor is the project flavor. For example, Client, Smart Devices, SQL Server, etc. -->
511 <ProjectFlavor Condition="'$(ProjectFlavor)'==''">Client</ProjectFlavor>
515 The default for compilers is to not delay-sign. If $(DelaySign) is false, let the compiler
516 use its default rather than forcing a no-delay-sign flag to be passed in. This is so that
517 attributes in the source code can override this decision.
520 <DelaySign Condition="'$(SignAssembly)' != 'true'">false</DelaySign>
521 <DelaySign Condition="'$(DelaySign)'!='true'"></DelaySign>
524 <!-- These properties control web reference proxy generation. -->
526 <WebReference_EnableProperties Condition=" '$(WebReference_EnableProperties)' == '' ">true</WebReference_EnableProperties>
527 <WebReference_EnableSQLTypes Condition=" '$(WebReference_EnableSQLTypes)' == '' ">true</WebReference_EnableSQLTypes>
528 <WebReference_EnableLegacyEventingModel Condition=" '$(WebReference_EnableLegacyEventingModel)' == '' ">false</WebReference_EnableLegacyEventingModel>
532 <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildProjectFullPath);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
533 <MSBuildAllProjects Condition="Exists('$(MSBuildProjectFullPath).user')">$(MSBuildAllProjects);$(MSBuildProjectFullPath).user</MSBuildAllProjects>
537 These parameters control where to look in the registry for directories to search for
538 assemblies in the assembly resolution tasks.
541 <AssemblyFoldersSuffix Condition=" '$(AssemblyFoldersSuffix)' == '' ">AssemblyFoldersEx</AssemblyFoldersSuffix>
542 <FrameworkRegistryBase Condition=" '$(FrameworkRegistryBase)' == '' ">Software\Microsoft\$(TargetFrameworkIdentifier)</FrameworkRegistryBase>
543 <TargetPlatformRegistryBase Condition="'$(TargetPlatformRegistryBase)' == ''">Software\Microsoft\Microsoft SDKs\$(TargetPlatformIdentifier)</TargetPlatformRegistryBase>
544 <AssemblyFoldersConfigFile Condition="'$(AssemblyFoldersConfigFile)' == ''">$(MSBuildToolsPath32)\AssemblyFolders.config</AssemblyFoldersConfigFile>
545 <AssemblyFoldersConfigFileSearchPath Condition="Exists('$(AssemblyFoldersConfigFile)')">{AssemblyFoldersFromConfig:$(AssemblyFoldersConfigFile),$(TargetFrameworkVersion)};</AssemblyFoldersConfigFileSearchPath>
547 The SearchPaths property is set to find assemblies in the following order:
549 (1) Files from current project - indicated by {CandidateAssemblyFiles}
550 (2) $(ReferencePath) - the reference path property, which comes from the .USER file.
551 (3) The hintpath from the referenced item itself, indicated by {HintPathFromItem}.
552 (4) The directory of MSBuild's "target" runtime from GetFrameworkPath.
553 The "target" runtime folder is the folder of the runtime that MSBuild is a part of.
554 (5) Registered assembly folders, indicated by {Registry:*,*,*}
555 (6) Assembly folders from AssemblyFolders.config file (provided by Visual Studio Dev15+).
556 (7) Legacy registered assembly folders, indicated by {AssemblyFolders}
557 (8) Resolve to the GAC.
558 (9) Treat the reference's Include as if it were a real file name.
559 (10) Look in the application's output folder (like bin\debug)
561 <AssemblySearchPaths Condition=" '$(AssemblySearchPaths)' == ''">
562 {CandidateAssemblyFiles};
565 {TargetFrameworkDirectory};
566 $(AssemblyFoldersConfigFileSearchPath)
567 {Registry:$(FrameworkRegistryBase),$(TargetFrameworkVersion),$(AssemblyFoldersSuffix)$(AssemblyFoldersExConditions)};
572 </AssemblySearchPaths>
575 These are the extensions that assembly reference resolution will consider for resolution.
576 Add new extensions here if you want to add new file types to consider (for example, .metadata_dll).
577 Put the most likely extensions first for reference resolution speed.
579 <AllowedReferenceAssemblyFileExtensions Condition=" '$(AllowedReferenceAssemblyFileExtensions)' == '' ">
583 </AllowedReferenceAssemblyFileExtensions>
586 These are the extensions that reference resolution will consider when looking for files related
587 to resolved references. Add new extensions here if you want to add new file types to consider.
589 <AllowedReferenceRelatedFileExtensions Condition=" '$(AllowedReferenceRelatedFileExtensions)' == '' ">
595 </AllowedReferenceRelatedFileExtensions>
598 These names are used when determining which TargetFramework subset to use. If the any of the FullReferenceAssemblyNames
599 are seen in the list of client subsets, RAR will assume that no client subset is being used. The list is semicolon seperated
600 For example : Full;Complete;AllThere
602 <FullReferenceAssemblyNames Condition="'$(FullReferenceAssemblyNames)' == ''">Full</FullReferenceAssemblyNames>
605 <!-- ContinueOnError takes 3 values: WarnAndContinue (true), ErrorAndStop (false), and ErrorAndContinue.
606 Default to ErrorAndStop, since that matches the behaviour in previous versions, and what users
609 <ContinueOnError Condition="'$(ContinueOnError)' == ''">false</ContinueOnError>
612 <!-- Common Project System support -->
614 <CommonXamlResourcesDirectory Condition=" '$(CommonXamlResourcesDirectory)' == '' ">$(MSBuildThisFileDirectory)$(LangName)\</CommonXamlResourcesDirectory>
617 <!-- We need to fallback to en-US in case the xaml rules are not localized (possibly happen on community languages). -->
618 <PropertyGroup Condition="!Exists('$(CommonXamlResourcesDirectory)')">
619 <CommonXamlResourcesDirectory>$(MSBuildThisFileDirectory)en-US\</CommonXamlResourcesDirectory>
622 <ItemGroup Condition=" '$(DefineCommonItemSchemas)' == 'true' ">
623 <PropertyPageSchema Include="$(CommonXamlResourcesDirectory)ProjectItemsSchema.xaml"/>
625 <PropertyPageSchema Include="
626 $(CommonXamlResourcesDirectory)General.xaml;
627 $(CommonXamlResourcesDirectory)Debugger_General.xaml">
628 <Context>Project</Context>
629 </PropertyPageSchema>
631 <PropertyPageSchema Include="$(CommonXamlResourcesDirectory)General.BrowseObject.xaml">
632 <Context>BrowseObject</Context>
633 </PropertyPageSchema>
635 <PropertyPageSchema Include="$(CommonXamlResourcesDirectory)General_File.xaml">
636 <Context>File</Context>
637 </PropertyPageSchema>
639 <PropertyPageSchema Include="$(CommonXamlResourcesDirectory)SCC.xaml">
640 <Context>Invisible</Context>
641 </PropertyPageSchema>
643 <PropertyPageSchema Include="
644 $(CommonXamlResourcesDirectory)Folder.xaml;
645 $(CommonXamlResourcesDirectory)None.xaml;
646 $(CommonXamlResourcesDirectory)Content.xaml;
647 $(CommonXamlResourcesDirectory)EmbeddedResource.xaml;
649 <Context>File;BrowseObject</Context>
650 </PropertyPageSchema>
652 <PropertyPageSchema Include="$(CommonXamlResourcesDirectory)SpecialFolder.xaml;">
653 <Context>File;ProjectSubscriptionService</Context>
654 </PropertyPageSchema>
658 <DefineCommonReferenceSchemas Condition=" '$(DefineCommonReferenceSchemas)' == '' ">$(DefineCommonItemSchemas)</DefineCommonReferenceSchemas>
661 <ItemGroup Condition=" '$(DefineCommonReferenceSchemas)' == 'true' ">
662 <!-- Assembly references -->
663 <PropertyPageSchema Include="$(CommonXamlResourcesDirectory)assemblyreference.xaml">
664 <Context>;BrowseObject</Context>
665 </PropertyPageSchema>
666 <PropertyPageSchema Include="$(CommonXamlResourcesDirectory)ResolvedAssemblyReference.xaml">
667 <Context>ProjectSubscriptionService;BrowseObject</Context>
668 </PropertyPageSchema>
670 <!-- COM references -->
671 <PropertyPageSchema Include="$(CommonXamlResourcesDirectory)COMReference.xaml">
672 <Context>;BrowseObject</Context>
673 </PropertyPageSchema>
674 <PropertyPageSchema Include="$(CommonXamlResourcesDirectory)ResolvedCOMReference.xaml">
675 <Context>ProjectSubscriptionService;BrowseObject</Context>
676 </PropertyPageSchema>
678 <!-- Project references -->
679 <PropertyPageSchema Include="$(CommonXamlResourcesDirectory)ProjectReference.xaml">
680 <Context>;BrowseObject</Context>
681 </PropertyPageSchema>
682 <PropertyPageSchema Include="$(CommonXamlResourcesDirectory)ResolvedProjectReference.xaml">
683 <Context>ProjectSubscriptionService;BrowseObject</Context>
684 </PropertyPageSchema>
687 <ItemGroup Condition=" '$(DefineCommonCapabilities)' == 'true' ">
688 <ProjectCapability Include="
692 SharedProjectReferences;
694 AllTargetOutputGroups;
695 VisualStudioWellKnownOutputGroups;
696 SingleFileGenerators;
700 <ProjectCapability Condition=" '$(TargetPlatformIdentifier)' == 'Windows' and '$(TargetPlatformVersion)' < 8.0 "
701 Include="BuildWindowsDesktopTarget" />
704 <ItemDefinitionGroup Condition=" '$(DefineExplicitDefaults)' == 'true' ">
706 <CopyToOutputDirectory>Never</CopyToOutputDirectory>
709 <CopyToOutputDirectory>Never</CopyToOutputDirectory>
712 <CopyToOutputDirectory>Never</CopyToOutputDirectory>
715 <CopyToOutputDirectory>Never</CopyToOutputDirectory>
717 </ItemDefinitionGroup>
720 ***********************************************************************************************
721 ***********************************************************************************************
723 ***********************************************************************************************
724 ***********************************************************************************************
728 ============================================================
729 _CheckForInvalidConfigurationAndPlatform
731 This target checks for errors in statically defined properties. By setting BeforeTargets, we try
732 to ensure that the target runs before any build related targets.
733 If your target requires this check and is running as a BeforeTargets of one of the first targets
734 of $(BuildDependsOn), $(RebuildDependsOn), or $(CleanDependsOn) you will need to set your DependsOn
736 ============================================================
739 Name="_CheckForInvalidConfigurationAndPlatform"
740 BeforeTargets="$(BuildDependsOn);Build;$(RebuildDependsOn);Rebuild;$(CleanDependsOn);Clean">
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>
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>
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>
748 <Error Condition=" '$(_InvalidConfigurationError)' == 'true' " Text="$(_InvalidConfigurationMessageText)"/>
749 <Warning Condition=" '$(_InvalidConfigurationWarning)' == 'true' " Text="$(_InvalidConfigurationMessageText)"/>
751 <Message Condition="'$(DesignTimeBuild)' != 'true'" Text="Configuration=$(Configuration)" Importance="Low" />
752 <Message Condition="'$(DesignTimeBuild)' != 'true'" Text="Platform=$(Platform)" Importance="Low" />
754 <!-- Although we try to ensure a trailing slash, it's possible to circumvent this if the property is set on the command line -->
755 <Error Condition="'$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)')" Text="The OutDir property must end with a trailing slash." />
756 <Error Condition="'$(BaseIntermediateOutputPath)' != '' and !HasTrailingSlash('$(BaseIntermediateOutputPath)')" Text="The BaseIntermediateOutputPath must end with a trailing slash." />
757 <Error Condition="'$(IntermediateOutputPath)' != '' and !HasTrailingSlash('$(IntermediateOutputPath)')" Text="The IntermediateOutputPath must end with a trailing slash." />
759 <!-- Also update the value of PlatformTargetAsMSBuildArchitecture per the value of Prefer32Bit. We are doing
760 this here because Prefer32Bit may be set anywhere in the targets, so we can't depend on it having the
761 correct value when we're trying to figure out PlatformTargetAsMSBuildArchitecture -->
762 <PropertyGroup Condition="'$(Prefer32Bit)' == 'true' and ('$(PlatformTarget)' == 'AnyCPU' or '$(PlatformTarget)' == '') and '$(PlatformTargetAsMSBuildArchitectureExplicitlySet)' != 'true'">
763 <PlatformTargetAsMSBuildArchitecture>x86</PlatformTargetAsMSBuildArchitecture>
768 ============================================================
771 The main build entry point.
772 ============================================================
783 Condition=" '$(_InvalidConfigurationWarning)' != 'true' "
784 DependsOnTargets="$(BuildDependsOn)"
785 Returns="@(TargetPathWithTargetPlatformMoniker)" />
788 ============================================================
791 Redefine this target in your project in order to run tasks just before Build
792 ============================================================
794 <Target Name="BeforeBuild"/>
797 ============================================================
800 Redefine this target in your project in order to run tasks just after Build
801 ============================================================
803 <Target Name="AfterBuild"/>
806 ============================================================
809 The core build step calls each of the build targets.
810 ============================================================
822 UnmanagedUnregistration;
823 GenerateSerializationAssemblies;
824 CreateSatelliteAssemblies;
828 UnmanagedRegistration;
831 </CoreBuildDependsOn>
835 DependsOnTargets="$(CoreBuildDependsOn)">
837 <OnError ExecuteTargets="_TimeStampAfterCompile;PostBuildEvent" Condition="'$(RunPostBuildEvent)'=='Always' or '$(RunPostBuildEvent)'=='OnOutputUpdated'"/>
838 <OnError ExecuteTargets="_CleanRecordFileWrites"/>
843 ============================================================
846 Delete all intermediate and final build outputs, and then build the project from scratch.
847 ============================================================
851 <_ProjectDefaultTargets Condition="'$(MSBuildProjectDefaultTargets)' != ''">$(MSBuildProjectDefaultTargets)</_ProjectDefaultTargets>
852 <_ProjectDefaultTargets Condition="'$(MSBuildProjectDefaultTargets)' == ''">Build</_ProjectDefaultTargets>
857 $(_ProjectDefaultTargets);
861 <RebuildDependsOn Condition=" '$(MSBuildProjectDefaultTargets)' == 'Rebuild' " >
871 Condition=" '$(_InvalidConfigurationWarning)' != 'true' "
872 DependsOnTargets="$(RebuildDependsOn)"
873 Returns="$(TargetPath)"/>
876 ============================================================
879 Redefine this target in your project in order to run tasks just before Rebuild
880 ============================================================
882 <Target Name="BeforeRebuild"/>
885 ============================================================
888 Redefine this target in your project in order to run tasks just after Rebuild
889 ============================================================
891 <Target Name="AfterRebuild"/>
894 ============================================================
897 Redefine this target in your project in order to run tasks for BuildGenerateSources
899 Set BuildPassReferences to enable P2P builds
900 ============================================================
903 <BuildGenerateSourcesAction>Build</BuildGenerateSourcesAction>
906 <Target Name="BuildGenerateSources" DependsOnTargets="BuildGenerateSourcesTraverse;$(BuildGenerateSourcesAction)" />
908 <Target Name="BuildGenerateSourcesTraverse" DependsOnTargets="PrepareProjectReferences">
910 Projects="@(_MSBuildProjectReferenceExistent)"
911 Targets="BuildGenerateSources"
912 BuildInParallel="$(BuildInParallel)"
913 Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform); %(_MSBuildProjectReferenceExistent.SetTargetFramework);"
914 Condition="'$(BuildPassReferences)' == 'true' and '@(ProjectReferenceWithConfiguration)' != '' and '@(_MSBuildProjectReferenceExistent)' != '' and '%(_MSBuildProjectReferenceExistent.BuildReference)' == 'true'"
915 ContinueOnError="!$(BuildingProject)"
916 RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
921 ============================================================
924 Redefine this target in your project in order to run tasks for BuildCompile
925 ============================================================
928 <BuildCompileAction>Build</BuildCompileAction>
931 <Target Name="BuildCompile" DependsOnTargets="BuildCompileTraverse;$(BuildCompileAction)" />
933 <Target Name="BuildCompileTraverse" DependsOnTargets="PrepareProjectReferences">
935 Projects="@(_MSBuildProjectReferenceExistent)"
936 Targets="BuildCompile"
937 BuildInParallel="$(BuildInParallel)"
938 Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform); %(_MSBuildProjectReferenceExistent.SetTargetFramework)"
939 Condition="'$(BuildPassReferences)' == 'true' and '@(ProjectReferenceWithConfiguration)' != '' and '@(_MSBuildProjectReferenceExistent)' != '' and '%(_MSBuildProjectReferenceExistent.BuildReference)' == 'true'"
940 ContinueOnError="!$(BuildingProject)"
941 RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
946 ============================================================
949 Redefine this target in your project in order to run tasks for BuildLink
950 ============================================================
953 <BuildLinkAction>Build</BuildLinkAction>
956 <Target Name="BuildLink" DependsOnTargets="BuildLinkTraverse;$(BuildLinkAction)" />
958 <Target Name="BuildLinkTraverse" DependsOnTargets="PrepareProjectReferences" >
960 Projects="@(_MSBuildProjectReferenceExistent)"
962 BuildInParallel="$(BuildInParallel)"
963 Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform); %(_MSBuildProjectReferenceExistent.SetTargetFramework)"
964 Condition="'$(BuildPassReferences)' == 'true' and '@(ProjectReferenceWithConfiguration)' != '' and '@(_MSBuildProjectReferenceExistent)' != '' and '%(_MSBuildProjectReferenceExistent.BuildReference)' == 'true'"
965 ContinueOnError="!$(BuildingProject)"
966 RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
971 ============================================================
972 CopyRunEnvironmentFiles
974 Copy environment files necessary to run the user's app to the final directory.
975 This is a public target that can be invoked by an IDE.
977 This may be used by an IDE to make the app.config file available for running
979 ============================================================
982 Name="CopyRunEnvironmentFiles"
983 DependsOnTargets="PrepareForBuild;SetWin32ManifestProperties;_CopyAppConfigFile;_CleanRecordFileWrites"/>
986 ============================================================
989 Run the final build output if it is a .EXE
990 ============================================================
993 <RunDependsOn></RunDependsOn>
997 DependsOnTargets="$(RunDependsOn)">
999 <Error Text="Cannot run '$(TargetPath)' because project output type is not '.exe'" Condition="'$(TargetExt)'!='.exe'"/>
1000 <Exec Command="$(TargetPath) $(StartArguments)" WorkingDirectory="$(OutDir)" Condition=" '$(StartWorkingDirectory)' == '' "/>
1001 <Exec Command="$(TargetPath) $(StartArguments)" WorkingDirectory="$(StartWorkingDirectory)" Condition=" '$(StartWorkingDirectory)' != '' "/>
1009 ***********************************************************************************************
1010 ***********************************************************************************************
1011 BuildOnlySettings Section
1012 ***********************************************************************************************
1013 ***********************************************************************************************
1017 ============================================================
1020 This target is called only when doing a real build. It is specifically not called during project load.
1021 ============================================================
1024 <BuildingProject>false</BuildingProject>
1027 Name="BuildOnlySettings">
1029 <BuildingProject>true</BuildingProject>
1037 ***********************************************************************************************
1038 ***********************************************************************************************
1039 PrepareForBuild Section
1040 ***********************************************************************************************
1041 ***********************************************************************************************
1045 ============================================================
1048 Prepare the prerequisites for building.
1049 ============================================================
1052 <PrepareForBuildDependsOn>GetFrameworkPaths;GetReferenceAssemblyPaths;AssignLinkMetadata</PrepareForBuildDependsOn>
1055 Name="PrepareForBuild"
1056 DependsOnTargets="$(PrepareForBuildDependsOn)">
1059 <AppConfigWithTargetPath Include="$(AppConfig)" Condition="'$(AppConfig)'!=''">
1060 <TargetPath>$(TargetFileName).config</TargetPath>
1061 </AppConfigWithTargetPath>
1064 <FindAppConfigFile PrimaryList="@(None)" SecondaryList="@(Content)" TargetPath="$(TargetFileName).config" Condition="'$(AppConfig)'==''">
1065 <Output TaskParameter="AppConfigFile" ItemName="AppConfigWithTargetPath"/>
1066 <Output TaskParameter="AppConfigFile" PropertyName="AppConfig"/>
1067 </FindAppConfigFile>
1069 <!-- Create the directories for intermediate and final build products, and any other arbitrary directories. -->
1070 <!-- We are going to continue on error here so that if the tree is read only we will still get intellisense -->
1071 <MakeDir Directories="$(OutDir);$(IntermediateOutputPath);@(DocFileItem->'%(RelativeDir)');@(CreateDirectory)" ContinueOnError="True"/>
1076 ============================================================
1079 Get the paths for the .NET Framework installation directory
1081 These paths are not used directly by this .targets file but are available for pre and
1083 ============================================================
1086 <Framework40Dir>@(_TargetFramework40DirectoryItem)</Framework40Dir>
1087 <Framework35Dir>@(_TargetFramework35DirectoryItem)</Framework35Dir>
1088 <Framework30Dir>@(_TargetFramework30DirectoryItem)</Framework30Dir>
1089 <Framework20Dir>@(_TargetFramework20DirectoryItem)</Framework20Dir>
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.-->
1091 <FrameworkDir Condition="'$(FrameworkDir)' == '' and ('$(TargetFrameworkVersion)' == 'v2.0' or '$(TargetFrameworkVersion)' == 'v3.5' or '$(TargetFrameworkVersion)' == 'v4.0')">@(_TargetFramework20DirectoryItem)</FrameworkDir>
1092 <FrameworkDir Condition="'$(FrameworkDir)' == ''">@(_TargetFramework40DirectoryItem)</FrameworkDir>
1093 <TargetedFrameworkDir Condition="'$(TargetedFrameworkDir)' == ''">@(_TargetedFrameworkDirectoryItem)</TargetedFrameworkDir>
1094 <FrameworkSDKDir Condition="'$(FrameworkSDKDir)' == ''">@(_TargetFrameworkSDKDirectoryItem)</FrameworkSDKDir>
1095 <GetFrameworkPathsDependsOn></GetFrameworkPathsDependsOn>
1098 <!-- This is a generally overriden target, for example it is overriden in the Microsoft.NETFramework.targets file -->
1099 <Target Name="GetFrameworkPaths"/>
1102 ============================================================
1103 GetReferenceAssemblyPaths
1105 Get the paths for the Reference Assemblies for the known versions of the
1108 These paths are used by the build process in order to resolve the correct
1109 assemblies from the various directories, and to support multi-targeting
1110 ============================================================
1113 Name="GetReferenceAssemblyPaths"
1114 DependsOnTargets="$(GetReferenceAssemblyPathsDependsOn)">
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 -->
1118 <TargetFrameworkDirectory Condition="'@(_CombinedTargetFrameworkDirectoriesItem)' == '$(TargetFrameworkDirectory)'"/>
1121 <!-- By default if there is no root path set then the task will assume it is Program Files\Reference Assemblies\Microsoft\Framework-->
1122 <GetReferenceAssemblyPaths
1123 Condition="'$(TargetFrameworkMoniker)' != '' and ('$(_TargetFrameworkDirectories)' == '' or '$(_FullFrameworkReferenceAssemblyPaths)' == '')"
1124 TargetFrameworkMoniker="$(TargetFrameworkMoniker)"
1125 RootPath="$(TargetFrameworkRootPath)"
1126 BypassFrameworkInstallChecks="$(BypassFrameworkInstallChecks)"
1128 <Output TaskParameter="ReferenceAssemblyPaths" PropertyName="_TargetFrameworkDirectories"/>
1129 <Output TaskParameter="FullFrameworkReferenceAssemblyPaths" PropertyName="_FullFrameworkReferenceAssemblyPaths"/>
1130 <Output TaskParameter="TargetFrameworkMonikerDisplayName" PropertyName="TargetFrameworkMonikerDisplayName" Condition="'$(TargetFrameworkMonikerDisplayName)' == ''"/>
1131 </GetReferenceAssemblyPaths>
1134 <TargetFrameworkDirectory>$(_TargetFrameworkDirectories);$(TargetFrameworkDirectory);$(WinFXAssemblyDirectory)</TargetFrameworkDirectory>
1135 <TargetFrameworkDirectory Condition="'$(TargetPlatformWinMDLocation)' != '' and Exists('$(TargetPlatformWinMDLocation)')">$(TargetFrameworkDirectory);$(TargetPlatformWinMDLocation)</TargetFrameworkDirectory>
1138 <!-- Remove the AssemblyFolders if no target framework directories could be found. This is to prevent us from
1139 resolving from the assemblyfolders global location if we are not acutally targeting a framework-->
1142 <RemoveAssemblyFoldersIfNoTargetFramework Condition="'$(RemoveAssemblyFoldersIfNoTargetFramework)' == ''">true</RemoveAssemblyFoldersIfNoTargetFramework>
1145 <PropertyGroup Condition="'$(_TargetFrameworkDirectories)' == '' and '$(AssemblySearchPaths)' != '' and '$(RemoveAssemblyFoldersIfNoTargetFramework)' == 'true'">
1146 <AssemblySearchPaths>$(AssemblySearchPaths.Replace('{AssemblyFolders}', '').Split(';'))</AssemblySearchPaths>
1149 <ItemGroup Condition="'$(ImplicitlyExpandDesignTimeFacades)' == 'true'">
1150 <DesignTimeFacadeDirectoryRoots Include="$(TargetFrameworkDirectory)" />
1151 <DesignTimeFacadeDirectories Include="%(DesignTimeFacadeDirectoryRoots.Identity)Facades\" Condition="Exists('%(DesignTimeFacadeDirectoryRoots.Identity)Facades\')" />
1154 <PropertyGroup Condition="'@(DesignTimeFacadeDirectories)' != ''">
1155 <TargetFrameworkDirectory>$(TargetFrameworkDirectory);@(DesignTimeFacadeDirectories)</TargetFrameworkDirectory>
1158 <PropertyGroup Condition="'$(_TargetFrameworkDirectories)' == ''">
1159 <TargetFrameworkProfile/>
1163 <!-- Returns target framework moniker. E.g. ".NETFramework,Version=v4.0.1" -->
1164 <Target Name="GetTargetFrameworkMoniker"
1165 Returns="$(TargetFrameworkMoniker)"/>
1167 <!-- Returns target framework moniker display name. E.g. ".NET Framework 4 Platform Update 1 (KB2478063)" -->
1168 <Target Name="GetTargetFrameworkMonikerDisplayName"
1169 DependsOnTargets="GetFrameworkPaths;GetReferenceAssemblyPaths"
1170 Returns="$(TargetFrameworkMonikerDisplayName)"/>
1172 <!-- Returns semicolon separated list of target framework directories.
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\" -->
1174 <Target Name="GetTargetFrameworkDirectories"
1175 DependsOnTargets="GetFrameworkPaths;GetReferenceAssemblyPaths"
1176 Returns="$(TargetFrameworkDirectory)"/>
1179 ============================================================
1182 For items of a certain set of whitelisted types, make sure that
1183 if they are defined in a file other than the project file, that
1184 they have "Link" metadata set to an appropriate default.
1185 ============================================================
1187 <Target Name="AssignLinkMetadata" Condition=" '$(SynthesizeLinkMetadata)' == 'true' ">
1189 <AssignLinkMetadata Items="@(None)"
1190 Condition="'@(None)' != '' and '%(None.DefiningProjectFullPath)' != '$(MSBuildProjectFullPath)'">
1191 <Output TaskParameter="OutputItems" ItemName="_Temp" />
1192 </AssignLinkMetadata>
1195 <None Remove="@(_Temp)" />
1196 <None Include="@(_Temp)" />
1197 <_Temp Remove="@(_Temp)" />
1200 <!-- CONTENT ITEMS -->
1201 <AssignLinkMetadata Items="@(Content)"
1202 Condition="'@(Content)' != '' and '%(Content.DefiningProjectFullPath)' != '$(MSBuildProjectFullPath)'">
1203 <Output TaskParameter="OutputItems" ItemName="_Temp" />
1204 </AssignLinkMetadata>
1207 <Content Remove="@(_Temp)" />
1208 <Content Include="@(_Temp)" />
1209 <_Temp Remove="@(_Temp)" />
1214 <AssignLinkMetadata Items="@(Page)"
1215 Condition="'@(Page)' != '' and '%(Page.DefiningProjectFullPath)' != '$(MSBuildProjectFullPath)'">
1216 <Output TaskParameter="OutputItems" ItemName="_Temp" />
1217 </AssignLinkMetadata>
1220 <Page Remove="@(_Temp)" />
1221 <Page Include="@(_Temp)" />
1222 <_Temp Remove="@(_Temp)" />
1226 <!-- APPLICATIONDEFINITION ITEMS -->
1227 <AssignLinkMetadata Items="@(ApplicationDefinition)"
1228 Condition="'@(ApplicationDefinition)' != '' and '%(ApplicationDefinition.DefiningProjectFullPath)' != '$(MSBuildProjectFullPath)'">
1229 <Output TaskParameter="OutputItems" ItemName="_Temp" />
1230 </AssignLinkMetadata>
1233 <ApplicationDefinition Remove="@(_Temp)" />
1234 <ApplicationDefinition Include="@(_Temp)" />
1235 <_Temp Remove="@(_Temp)" />
1238 <!-- EMBEDDEDRESOURCE ITEMS -->
1239 <AssignLinkMetadata Items="@(EmbeddedResource)"
1240 Condition="'@(EmbeddedResource)' != '' and '%(EmbeddedResource.DefiningProjectFullPath)' != '$(MSBuildProjectFullPath)'">
1241 <Output TaskParameter="OutputItems" ItemName="_Temp" />
1242 </AssignLinkMetadata>
1245 <EmbeddedResource Remove="@(_Temp)" />
1246 <EmbeddedResource Include="@(_Temp)" />
1247 <_Temp Remove="@(_Temp)" />
1252 ***********************************************************************************************
1253 ***********************************************************************************************
1254 PreBuildEvent Section
1255 ***********************************************************************************************
1256 ***********************************************************************************************
1260 ============================================================
1263 Run the pre-build event if there is one.
1264 ============================================================
1267 <PreBuildEventDependsOn></PreBuildEventDependsOn>
1270 Name="PreBuildEvent"
1271 Condition="'$(PreBuildEvent)'!=''"
1272 DependsOnTargets="$(PreBuildEventDependsOn)">
1274 <Exec WorkingDirectory="$(OutDir)" Command="$(PreBuildEvent)" />
1282 ***********************************************************************************************
1283 ***********************************************************************************************
1284 UnmanagedUnregistration Section
1285 ***********************************************************************************************
1286 ***********************************************************************************************
1290 ============================================================
1291 UnmanagedUnregistration
1293 If the main assembly had previously been registered for COM interop, unregister it now.
1294 We will re-register the new version after it has been built.
1295 ============================================================
1298 <UnmanagedUnregistrationDependsOn></UnmanagedUnregistrationDependsOn>
1301 Name="UnmanagedUnregistration"
1302 Condition="(('$(_AssemblyTimestampBeforeCompile)' != '$(_AssemblyTimestampAfterCompile)' or '$(RegisterForComInterop)' != 'true' or '$(OutputType)' != 'library') or
1303 ('$(_AssemblyTimestampBeforeCompile)' == '')) and
1304 Exists('@(_UnmanagedRegistrationCache)')"
1305 DependsOnTargets="$(UnmanagedUnregistrationDependsOn)">
1308 <UnregisterAssemblyMSBuildArchitecture Condition="'$(UnregisterAssemblyMSBuildArchitecture)' == ''">$(PlatformTargetAsMSBuildArchitecture)</UnregisterAssemblyMSBuildArchitecture>
1311 <PropertyGroup Condition="'$(TargetFrameworkAsMSBuildRuntime)' != '' and '$(UnregisterAssemblyMSBuildArchitecture)' != ''">
1312 <!-- Falling back to the current runtime if we are targeting CLR2 and the task host doesn't exist will lead to
1313 incorrect behavior in some cases, but it's the same incorrect behavior as Visual Studio 2010, and thus better
1314 than causing build breaks on upgrade to Win8 the way not doing so would. For more details, see the
1315 corresponding comment in GenerateResource. -->
1316 <UnregisterAssemblyMSBuildRuntime
1317 Condition="'$(UnregisterAssemblyMSBuildRuntime)' == '' and
1318 $([MSBuild]::DoesTaskHostExist(`$(TargetFrameworkAsMSBuildRuntime)`, `$(UnregisterAssemblyMSBuildArchitecture)`))">$(TargetFrameworkAsMSBuildRuntime)</UnregisterAssemblyMSBuildRuntime>
1320 <!-- If the targeted runtime doesn't exist, fall back to current -->
1321 <UnregisterAssemblyMSBuildRuntime Condition="'$(UnregisterAssemblyMSBuildRuntime)' == ''">CurrentRuntime</UnregisterAssemblyMSBuildRuntime>
1325 <UnregisterAssembly AssemblyListFile="@(_UnmanagedRegistrationCache)"
1326 MSBuildArchitecture="$(UnregisterAssemblyMSBuildArchitecture)"
1327 MSBuildRuntime="$(UnregisterAssemblyMSBuildRuntime)" />
1335 ***********************************************************************************************
1336 ***********************************************************************************************
1337 ResolveReferences Section
1338 ***********************************************************************************************
1339 ***********************************************************************************************
1342 ============================================================
1343 GetTargetFrameworkVersion
1345 This stand-alone target returns the target framework version (i.e. v3.5, v4.0, etc.)
1346 that would be used if we built this project.
1348 ============================================================
1352 Name="GetTargetFrameworkVersion"
1353 Returns="$(TargetFrameworkVersion)">
1357 ============================================================
1359 ============================================================
1362 <ResolveReferencesDependsOn>
1363 BeforeResolveReferences;
1364 AssignProjectConfiguration;
1365 ResolveProjectReferences;
1366 FindInvalidProjectReferences;
1367 ResolveNativeReferences;
1368 ResolveAssemblyReferences;
1369 GenerateBindingRedirects;
1370 ResolveComReferences;
1371 AfterResolveReferences
1372 </ResolveReferencesDependsOn>
1376 Name="ResolveReferences"
1377 DependsOnTargets="$(ResolveReferencesDependsOn)"/>
1380 ============================================================
1381 BeforeResolveReferences
1383 Redefine this target in your project in order to run tasks just before ResolveReferences
1384 ============================================================
1386 <Target Name="BeforeResolveReferences"/>
1389 ============================================================
1390 AfterResolveReferences
1392 Redefine this target in your project in order to run tasks just after ResolveReferences
1393 ============================================================
1395 <Target Name="AfterResolveReferences"/>
1398 ============================================================
1399 AssignProjectConfiguration
1401 Assigns the appropriate configuration to each project in the list of project references passed in.
1402 Adds to the project references passed in any project references implied by dependencies expressed in the solution file, if any.
1405 @(ProjectReference) - the list of all project references
1408 @(ProjectReferenceWithConfiguration) - the list of project references (MSBuild and potentially VSIP projects)
1409 with metadata values FullConfiguration, Configuration, Platform,
1410 SetConfiguration, and SetPlatform
1411 ============================================================
1414 Name="AssignProjectConfiguration"
1415 Condition="'$(CurrentSolutionConfigurationContents)' != '' or '@(ProjectReference)'!=''">
1418 <OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration Condition="'$(OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration)' == ''">true</OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration>
1419 <ShouldUnsetParentConfigurationAndPlatform Condition="'$(ShouldUnsetParentConfigurationAndPlatform)' == '' and ('$(BuildingInsideVisualStudio)' == 'true' or '$(BuildingSolutionFile)' == 'true')">true</ShouldUnsetParentConfigurationAndPlatform>
1420 <ShouldUnsetParentConfigurationAndPlatform Condition="'$(ShouldUnsetParentConfigurationAndPlatform)' == ''">false</ShouldUnsetParentConfigurationAndPlatform>
1422 <!-- Web Application projects can "secretly" reference Silverlight projects, which can take project dependencies on that same Web Application. If the project
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
1424 want this to happen, so just turn off synthetic project reference generation for Silverlight projects. -->
1425 <AddSyntheticProjectReferencesForSolutionDependencies Condition="'$(AddSyntheticProjectReferencesForSolutionDependencies)' == '' and '$(TargetFrameworkIdentifier)' == 'Silverlight'">false</AddSyntheticProjectReferencesForSolutionDependencies>
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-->
1428 <AddSyntheticProjectReferencesForSolutionDependencies Condition="'$(AddSyntheticProjectReferencesForSolutionDependencies)' == '' and '$(BuildingInsideVisualStudio)' != 'true'">true</AddSyntheticProjectReferencesForSolutionDependencies>
1431 <!-- Assign a project configuration to each project reference if we're building a solution file. -->
1432 <AssignProjectConfiguration
1433 ProjectReferences="@(ProjectReference)"
1434 CurrentProject="$(MSBuildProjectFullPath)"
1435 CurrentProjectConfiguration="$(Configuration)"
1436 CurrentProjectPlatform="$(Platform)"
1437 DefaultToVcxPlatformMapping="$(DefaultToVcxPlatformMapping)"
1438 VcxToDefaultPlatformMapping="$(VcxToDefaultPlatformMapping)"
1439 OutputType="$(OutputType)"
1440 ResolveConfigurationPlatformUsingMappings="false"
1441 SolutionConfigurationContents="$(CurrentSolutionConfigurationContents)"
1442 AddSyntheticProjectReferencesForSolutionDependencies="$(AddSyntheticProjectReferencesForSolutionDependencies)"
1443 OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration = "$(OnlyReferenceAndBuildProjectsEnabledInSolutionConfiguration)"
1444 ShouldUnsetParentConfigurationAndPlatform = "$(ShouldUnsetParentConfigurationAndPlatform)" >
1446 <!-- EMITTED FOR COMPATIBILITY REASONS ONLY. CONSUME PROJECTREFERENCEWITHCONFIGURATION INSTEAD -->
1447 <Output TaskParameter="AssignedProjects" ItemName="_ProjectReferenceWithConfiguration"/>
1448 <Output TaskParameter="UnassignedProjects" ItemName="_ProjectReferenceWithConfiguration"/>
1450 <Output TaskParameter="AssignedProjects" ItemName="ProjectReferenceWithConfiguration"/>
1451 <Output TaskParameter="UnassignedProjects" ItemName="ProjectReferenceWithConfiguration"/>
1452 </AssignProjectConfiguration>
1455 <_ProjectReferenceWithConfiguration>
1456 <BuildReference Condition="'%(_ProjectReferenceWithConfiguration.BuildReference)' == ''">true</BuildReference>
1457 <ReferenceOutputAssembly Condition="'%(_ProjectReferenceWithConfiguration.ReferenceOutputAssembly)' == ''">true</ReferenceOutputAssembly>
1458 </_ProjectReferenceWithConfiguration>
1459 <ProjectReferenceWithConfiguration>
1460 <BuildReference Condition="'%(ProjectReferenceWithConfiguration.BuildReference)' == ''">true</BuildReference>
1461 <ReferenceOutputAssembly Condition="'%(ProjectReferenceWithConfiguration.ReferenceOutputAssembly)' == ''">true</ReferenceOutputAssembly>
1462 </ProjectReferenceWithConfiguration>
1467 ============================================================
1468 _SplitProjectReferencesByFileExistence
1470 Split referenced projects into two lists: those that exist on
1471 disk and those that don't.
1472 ============================================================
1476 Name="_SplitProjectReferencesByFileExistence">
1479 Use this task for matching projects with pre-resolved project outputs set by the IDE
1480 if building inside the IDE. The IDE only includes non-MSBuild projects in the output list. We'll
1481 use MSBuild to resolve MSBuild projects.
1482 This task will resolve VSIP (3rd party) project references and create a new item list with only project references
1483 to projects in the MSBuild format.
1485 <ResolveNonMSBuildProjectOutput
1486 ProjectReferences="@(ProjectReferenceWithConfiguration)"
1487 PreresolvedProjectOutputs="$(VSIDEResolvedNonMSBuildProjectOutputs)"
1488 Condition="'$(BuildingInsideVisualStudio)'=='true' and '@(ProjectReferenceWithConfiguration)'!=''">
1490 <Output TaskParameter="ResolvedOutputPaths" ItemName="_ResolvedProjectReferencePaths"/>
1491 <Output TaskParameter="UnresolvedProjectReferences" ItemName="_MSBuildProjectReference"/>
1493 </ResolveNonMSBuildProjectOutput>
1496 If building from the command line, simply copy the ProjectReferenceWithConfiguration item list to _MSBuildProjectReference,
1497 since we have to assume all projects are in the MSBuild format. We have no way of building
1498 VSIP (3rd party) projects from the command line.
1501 <_MSBuildProjectReference Include="@(ProjectReferenceWithConfiguration)" Condition="'$(BuildingInsideVisualStudio)'!='true' and '@(ProjectReferenceWithConfiguration)'!=''"/>
1504 <!-- Break the project list into two lists: those that exist on disk and those that don't. -->
1506 <_MSBuildProjectReferenceExistent Include="@(_MSBuildProjectReference)" Condition="Exists('%(Identity)')"/>
1507 <_MSBuildProjectReferenceNonexistent Include="@(_MSBuildProjectReference)" Condition="!Exists('%(Identity)')"/>
1513 ====================================================================================
1514 _GetProjectReferenceTargetFrameworkProperties
1516 Builds the GetTargetFrameworkProperties target of all existent project references,
1517 passing $(TargetFrameworkMoniker) as $(ReferringTargetFramework) and sets the
1518 SetTargetFramework metadata of the project reference to the value that is returned.
1520 This allows a cross-targeting project to select how it should be configured to
1521 build against the most appropriate target for the referring target framework.
1523 ======================================================================================
1525 <Target Name="_GetProjectReferenceTargetFrameworkProperties"
1526 Outputs="%(_MSBuildProjectReferenceExistent.Identity)">
1528 Honor SkipGetTargetFrameworkProperties=true metadata on project references
1529 to mean that the project reference is known not to target multiple frameworks
1530 and the mechanism here for selecting the best one can be skipped as an optimization.
1532 We give this treatment to .vcxproj by default since no .vcxproj can target more
1536 <_MSBuildProjectReferenceExistent Condition="'%(_MSBuildProjectReferenceExistent.SkipGetTargetFrameworkProperties)' == '' and '%(Extension)' == '.vcxproj'">
1537 <SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
1538 </_MSBuildProjectReferenceExistent>
1542 Allow project references to specify which target framework properties to set and their values
1543 without consulting the referenced project. This has two use cases:
1545 1. A caller may wish to pick a compatible but sub-optimal target framework. For example,
1546 to unit test the .NETStandard implementation using a .NETFramework caller even though
1547 there is also a .NETFramework implementation.
1549 2. As an escape hatch for cases where the compatibility check performed by
1550 GetTargetFrameworkProperties is faulty.
1553 <_MSBuildProjectReferenceExistent Condition="'%(_MSBuildProjectReferenceExistent.SetTargetFramework)' != ''">
1554 <SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
1555 </_MSBuildProjectReferenceExistent>
1559 Select the moniker to send to each project reference if not already set. NugetTargetMoniker (NTM) is preferred by default over
1560 TargetFrameworkMoniker (TFM) because it is required to disambiguate the UWP case where TFM is fixed at .NETCore,Version=v5.0 and
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
1562 invocation below to fail by passing invalid properties. Therefore we do not use the NTM if it contains a semicolon.
1564 <PropertyGroup Condition="'$(ReferringTargetFrameworkForProjectReferences)' == ''">
1565 <ReferringTargetFrameworkForProjectReferences Condition="'$(NugetTargetMoniker)' != '' and !$(NuGetTargetMoniker.Contains(';'))">$(NugetTargetMoniker)</ReferringTargetFrameworkForProjectReferences>
1566 <ReferringTargetFrameworkForProjectReferences Condition="'$(NugetTargetMoniker)' == ''">$(TargetFrameworkMoniker)</ReferringTargetFrameworkForProjectReferences>
1570 Projects="%(_MSBuildProjectReferenceExistent.Identity)"
1571 Targets="GetTargetFrameworkProperties"
1572 BuildInParallel="$(BuildInParallel)"
1573 Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform); ReferringTargetFramework=$(ReferringTargetFrameworkForProjectReferences)"
1574 ContinueOnError="!$(BuildingProject)"
1575 RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove);TargetFramework;RuntimeIdentifier"
1576 Condition="'%(_MSBuildProjectReferenceExistent.SkipGetTargetFrameworkProperties)' != 'true'">
1578 <Output TaskParameter="TargetOutputs" PropertyName="_ProjectReferenceTargetFrameworkProperties" />
1582 <_MSBuildProjectReferenceExistent Condition="'%(_MSBuildProjectReferenceExistent.Identity)' == '%(Identity)' and '$(_ProjectReferenceTargetFrameworkProperties)' != ''">
1583 <SetTargetFramework>$(_ProjectReferenceTargetFrameworkProperties)</SetTargetFramework>
1585 <UndefineProperties Condition="$(_ProjectReferenceTargetFrameworkProperties.Contains(`ProjectHasSingleTargetFramework=true`))">%(_MSBuildProjectReferenceExistent.UndefineProperties);TargetFramework;ProjectHasSingleTargetFramework</UndefineProperties>
1586 <!-- Unconditionally remove the property that was set as a marker to indicate that for this call we should remove TargetFramework -->
1587 <UndefineProperties Condition="!$(_ProjectReferenceTargetFrameworkProperties.Contains(`ProjectHasSingleTargetFramework=true`))">%(_MSBuildProjectReferenceExistent.UndefineProperties);ProjectHasSingleTargetFramework</UndefineProperties>
1588 </_MSBuildProjectReferenceExistent>
1592 <_MSBuildProjectReferenceExistent Condition="'%(_MSBuildProjectReferenceExistent.Identity)' == '%(Identity)' and '$(_ProjectReferenceTargetFrameworkProperties)' != ''">
1593 <UndefineProperties Condition="$(_ProjectReferenceTargetFrameworkProperties.Contains(`ProjectIsRidAgnostic=true`))">%(_MSBuildProjectReferenceExistent.UndefineProperties);RuntimeIdentifier;ProjectIsRidAgnostic</UndefineProperties>
1594 <!-- Unconditionally remove the property that was set as a marker to indicate that for this call we should remove RuntimeIdentifier -->
1595 <UndefineProperties Condition="!$(_ProjectReferenceTargetFrameworkProperties.Contains(`ProjectIsRidAgnostic=true`))">%(_MSBuildProjectReferenceExistent.UndefineProperties);ProjectIsRidAgnostic</UndefineProperties>
1596 </_MSBuildProjectReferenceExistent>
1600 <_ProjectReferenceTargetFrameworkProperties />
1605 ============================================================
1606 GetTargetFrameworkProperties
1608 Overrridden by cross-targeting projects to return the set of
1609 properties (in the form "key1=value1;...keyN=valueN") needed
1610 to build it with the best target for the referring project's
1613 The referring project's $(TargetFrameworkMoniker) is passed
1614 in as $(ReferringTargetFramework)
1616 <Target Name="GetTargetFrameworkProperties" />
1619 ============================================================
1620 PrepareProjectReferences
1622 Prepares project references for consumption by other targets.
1625 @(ProjectReference) - The list of project references.
1628 @(ProjectReferenceWithConfiguration) - Project references with apporpriate metadata
1629 @(_MSBuildProjectReferenceExistent) - Subset of @(ProjectReferenceWithConfiguration) that exist
1630 with added SetTargetFramework metadata for cross-targeting
1631 @(_MSBuildProjectReferenceNonExistent) - Subset of @(ProjectReferenceWithConfiguration) that do not exist
1632 ============================================================
1635 <PrepareProjectReferencesDependsOn>
1636 AssignProjectConfiguration;
1637 _SplitProjectReferencesByFileExistence;
1638 _GetProjectReferenceTargetFrameworkProperties
1639 </PrepareProjectReferencesDependsOn>
1641 <Target Name="PrepareProjectReferences" DependsOnTargets="$(PrepareProjectReferencesDependsOn)" />
1644 ============================================================
1645 ResolveProjectReferences
1647 Build referenced projects:
1650 @(ProjectReferenceWithConfiguration) - The list of project references.
1653 @(_ResolvedNativeProjectReferencePaths) - Paths to referenced native projects.
1654 @(_ResolvedProjectReferencePaths) - Paths to referenced managed projects.
1655 ============================================================
1657 <!-- By default, the outputs of project references are passed to the compiler -->
1658 <ItemDefinitionGroup>
1660 <!-- Target to build in the project reference; by default, this property is blank, indicating the default targets-->
1661 <Targets>$(ProjectReferenceBuildTargets)</Targets>
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. -->
1664 <ReferenceSourceTarget>ProjectReference</ReferenceSourceTarget>
1666 </ItemDefinitionGroup>
1669 Name="ResolveProjectReferences"
1670 DependsOnTargets="PrepareProjectReferences"
1671 Returns="@(_ResolvedNativeProjectReferencePaths);@(_ResolvedProjectReferencePaths)">
1674 When building this project from the IDE, just gather the referenced build outputs.
1675 The IDE will already have built the project, so there's no need to do it again here.
1677 The ContinueOnError setting is here so that, during project load, as
1678 much information as possible will be passed to the compilers.
1682 Projects="@(_MSBuildProjectReferenceExistent)"
1683 Targets="GetTargetPath"
1684 BuildInParallel="$(BuildInParallel)"
1685 Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform); %(_MSBuildProjectReferenceExistent.SetTargetFramework)"
1686 Condition="'%(_MSBuildProjectReferenceExistent.BuildReference)' == 'true' and '@(ProjectReferenceWithConfiguration)' != '' and ('$(BuildingInsideVisualStudio)' == 'true' or '$(BuildProjectReferences)' != 'true') and '$(VisualStudioVersion)' != '10.0' and '@(_MSBuildProjectReferenceExistent)' != ''"
1687 ContinueOnError="!$(BuildingProject)"
1688 RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
1690 <Output TaskParameter="TargetOutputs" ItemName="_ResolvedProjectReferencePaths" Condition="'%(_MSBuildProjectReferenceExistent.ReferenceOutputAssembly)'=='true'"/>
1691 <Output TaskParameter="TargetOutputs" ItemName="%(_MSBuildProjectReferenceExistent.OutputItemType)" Condition="'%(_MSBuildProjectReferenceExistent.OutputItemType)' != ''"/>
1698 In the 4.0 version of the targets, we built the targets specified in the Targets metadata in addition to
1699 GetTargetPath when building in the IDE. In 4.5, we changed this to just GetTargetPath because it was
1700 causing performance trouble with certain systems that specified targets that did a significant amount of
1701 work in the Targets metadata, expecting them to only build when doing a real build.
1703 However, that change broke C++ unit testing in Dev10 + 4.5 scenarios, because they required use of the
1704 Targets metadata in order to get design time builds to work properly. Thus, we need to make sure we
1705 restore the Dev10 behavior when building on Dev10.
1709 Projects="@(_MSBuildProjectReferenceExistent)"
1710 Targets="%(_MSBuildProjectReferenceExistent.Targets);GetTargetPath"
1711 BuildInParallel="$(BuildInParallel)"
1712 Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform); %(_MSBuildProjectReferenceExistent.SetTargetFramework)"
1713 Condition="'%(_MSBuildProjectReferenceExistent.BuildReference)' == 'true' and '@(ProjectReferenceWithConfiguration)' != '' and ('$(BuildingInsideVisualStudio)' == 'true' or '$(BuildProjectReferences)' != 'true') and '$(VisualStudioVersion)' == '10.0' and '@(_MSBuildProjectReferenceExistent)' != ''"
1714 ContinueOnError="!$(BuildingProject)"
1715 RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
1717 <Output TaskParameter="TargetOutputs" ItemName="_ResolvedProjectReferencePaths" Condition="'%(_MSBuildProjectReferenceExistent.ReferenceOutputAssembly)'=='true'"/>
1718 <Output TaskParameter="TargetOutputs" ItemName="%(_MSBuildProjectReferenceExistent.OutputItemType)" Condition="'%(_MSBuildProjectReferenceExistent.OutputItemType)' != ''"/>
1723 Build referenced projects when building from the command line.
1726 Projects="@(_MSBuildProjectReferenceExistent)"
1727 Targets="%(_MSBuildProjectReferenceExistent.Targets)"
1728 BuildInParallel="$(BuildInParallel)"
1729 Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform); %(_MSBuildProjectReferenceExistent.SetTargetFramework)"
1730 Condition="'%(_MSBuildProjectReferenceExistent.BuildReference)' == 'true' and '@(ProjectReferenceWithConfiguration)' != '' and '$(BuildingInsideVisualStudio)' != 'true' and '$(BuildProjectReferences)' == 'true' and '@(_MSBuildProjectReferenceExistent)' != ''"
1731 ContinueOnError="$(ContinueOnError)"
1732 RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
1734 <Output TaskParameter="TargetOutputs" ItemName="_ResolvedProjectReferencePaths" Condition="'%(_MSBuildProjectReferenceExistent.ReferenceOutputAssembly)'=='true' or '$(DesignTimeBuild)' == 'true'"/>
1735 <Output TaskParameter="TargetOutputs" ItemName="%(_MSBuildProjectReferenceExistent.OutputItemType)" Condition="'%(_MSBuildProjectReferenceExistent.OutputItemType)' != ''"/>
1740 Get manifest items from the (non-exe) built project references (to feed them into ResolveNativeReference).
1743 Projects="@(_MSBuildProjectReferenceExistent)"
1744 Targets="GetNativeManifest"
1745 BuildInParallel="$(BuildInParallel)"
1746 Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform); %(_MSBuildProjectReferenceExistent.SetTargetFramework)"
1747 Condition="'%(_MSBuildProjectReferenceExistent.BuildReference)' == 'true' and '@(ProjectReferenceWithConfiguration)' != '' and '$(BuildingProject)' == 'true' and '@(_MSBuildProjectReferenceExistent)' != ''"
1748 ContinueOnError="$(ContinueOnError)"
1749 RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
1751 <Output TaskParameter="TargetOutputs" ItemName="NativeReference" Condition="'%(_MSBuildProjectReferenceExistent.ReferenceOutputAssembly)' == 'true'"/>
1755 <_ResolvedProjectReferencePaths Remove="@(_ResolvedProjectReferencePaths)" Condition="'%(_ResolvedProjectReferencePaths.ResolveableAssembly)' == 'false'" />
1757 Copy OriginalItemSpec to OriginalProjectReferenceItemSpec, so that when ResolveAssemblyReferences
1758 takes these items and resolves them to ReferencePath, we can still recover the _real_ OriginalItemSpec
1759 for the unresolved reference items.
1761 <_ResolvedProjectReferencePaths>
1762 <OriginalProjectReferenceItemSpec>%(_ResolvedProjectReferencePaths.OriginalItemSpec)</OriginalProjectReferenceItemSpec>
1763 </_ResolvedProjectReferencePaths>
1766 <!-- Issue a warning for each non-existent project. -->
1768 Text="The referenced project '%(_MSBuildProjectReferenceNonexistent.Identity)' does not exist."
1769 Condition="'@(ProjectReferenceWithConfiguration)' != '' and '@(_MSBuildProjectReferenceNonexistent)' != ''"/>
1774 Name="ResolveProjectReferencesDesignTime"
1775 Returns="@(_ProjectReferencesFromRAR);@(_ResolvedNativeProjectReferencePaths)"
1776 DependsOnTargets="ResolveProjectReferences;ResolveAssemblyReferences">
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
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.
1781 <_ProjectReferencesFromRAR Include="@(ReferencePath->WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))">
1782 <OriginalItemSpec>%(ReferencePath.ProjectReferenceOriginalItemSpec)</OriginalItemSpec>
1783 </_ProjectReferencesFromRAR>
1788 Name="ExpandSDKReferencesDesignTime"
1789 Returns="@(ReferencesFromSDK)"
1790 DependsOnTargets="ExpandSDKReferences"/>
1793 ============================================================
1796 This target returns an item containing the build product (i.e. EXE, DLL)
1797 that would be produced if we built this project, with some relevant
1799 ============================================================
1802 <GetTargetPathDependsOn>$(GetTargetPathDependsOn)</GetTargetPathDependsOn>
1806 Name="GetTargetPath"
1807 DependsOnTargets="$(GetTargetPathDependsOn)"
1808 Returns="@(TargetPathWithTargetPlatformMoniker)" />
1811 ============================================================
1812 GetTargetPathWithTargetPlatformMoniker
1814 This stand-alone target returns the name and version of the target platform for this project.
1816 NOTE: The ProjectReference protocol uses only GetTargetPath. Computing the item
1817 in this target allows projects to override GetTargetPath without having to reimplement
1818 the details of the metadata computation.
1819 ============================================================
1822 <GetTargetPathWithTargetPlatformMonikerDependsOn>$(GetTargetPathDependsOn)</GetTargetPathWithTargetPlatformMonikerDependsOn>
1825 <!--NOTE: since an overridden GetTargetPath might not include a DependsOn
1826 for this target, it's safer to establish the dependency here with a
1829 Name="GetTargetPathWithTargetPlatformMoniker"
1830 BeforeTargets="GetTargetPath"
1831 DependsOnTargets="$(GetTargetPathWithTargetPlatformMonikerDependsOn)"
1832 Returns="@(TargetPathWithTargetPlatformMoniker)">
1834 <TargetPathWithTargetPlatformMoniker Include="$(TargetPath)">
1835 <TargetPlatformMoniker>$(TargetPlatformMoniker)</TargetPlatformMoniker>
1836 <TargetPlatformIdentifier>$(TargetPlatformIdentifier)</TargetPlatformIdentifier>
1837 <TargetFrameworkIdentifier>$(TargetFrameworkIdentifier)</TargetFrameworkIdentifier>
1838 <TargetFrameworkVersion>$(TargetFrameworkVersion)</TargetFrameworkVersion>
1839 <TargetFrameworkVersion Condition="$(TargetFrameworkVersion.StartsWith('v'))">$(TargetFrameworkVersion.Substring(1))</TargetFrameworkVersion>
1840 <ReferenceAssembly Condition="'$(ProduceReferenceAssembly)' == 'true'">$(TargetRefPath)</ReferenceAssembly>
1841 <CopyUpToDateMarker>@(CopyUpToDateMarker)</CopyUpToDateMarker>
1842 </TargetPathWithTargetPlatformMoniker>
1847 ============================================================
1850 Compute the manifest item for this project.
1853 $(_DeploymentApplicationManifestIdentity) - the manifest identity
1854 @(ApplicationManifest) - the original application manifest item
1857 @(ComputedApplicationManifest) - application manifest item with full hint path, if generated
1858 ============================================================
1861 Name="GetNativeManifest"
1862 Returns="@(ComputedApplicationManifest)">
1865 <ComputedApplicationManifest Include="$(_DeploymentApplicationManifestIdentity)" Condition="'$(OutputType)'!='winexe' and '$(OutputType)'!='exe' and '$(OutputType)'!='appcontainerexe' and Exists('%(_ApplicationManifestFinal.FullPath)')">
1866 <HintPath>%(_ApplicationManifestFinal.FullPath)</HintPath>
1867 </ComputedApplicationManifest>
1873 ============================================================
1874 ResolveNativeReferences
1876 Resolve native references
1879 @(NativeReference) - The manifest reference (or list of manifest references)
1882 @(NativeReferenceFile) - List of manifest files referenced.
1883 @(_DeploymentNativePrerequisite) - List of native assembly prerequisites contained in the manifest.
1884 @(ComClassReference) - List of COM components contained in the manifest.
1885 @(COMReferenceFromNative) List of type libraries contained in the manifest.
1886 @(COMFileReference) - List of loose files contained in the manifest.
1887 @(_DeploymentLooseManifestFile) - List of extra files that should be published.
1888 ============================================================
1891 Name="ResolveNativeReferences"
1892 Condition="'@(NativeReference)'!=''"
1893 DependsOnTargets="ResolveProjectReferences">
1895 <ResolveNativeReference
1896 NativeReferences="@(NativeReference)"
1897 AdditionalSearchPaths="$(ReferencePath);$(OutDir)"
1899 <Output TaskParameter="ContainingReferenceFiles" ItemName="NativeReferenceFile"/>
1900 <Output TaskParameter="ContainedPrerequisiteAssemblies" ItemName="_DeploymentNativePrerequisite"/>
1901 <Output TaskParameter="ContainedComComponents" ItemName="ComClassReference"/>
1902 <Output TaskParameter="ContainedTypeLibraries" ItemName="COMReferenceFromNative"/>
1903 <Output TaskParameter="ContainedLooseTlbFiles" ItemName="COMFileReference"/>
1904 <Output TaskParameter="ContainedLooseEtcFiles" ItemName="_DeploymentLooseManifestFile"/>
1905 </ResolveNativeReference>
1910 ============================================================
1912 ResolveAssemblyReferences
1914 Given the list of assemblies, find the closure of all assemblies that they depend on. These are
1915 what we need to copy to the output directory.
1918 @(Reference) - List of assembly references as fusion names.
1919 @(_ResolvedProjectReferencePaths) - List of project references produced by projects that this project depends on.
1921 The 'Private' attribute on the reference corresponds to the Copy Local flag in IDE.
1922 The 'Private' flag can have three possible values:
1923 - 'True' means the reference should be Copied Local
1924 - 'False' means the reference should not be Copied Local
1925 - [Missing] means this task will decide whether to treat this reference as CopyLocal or not.
1928 @(ReferencePath) - Paths to resolved primary files.
1929 @(ReferenceDependencyPaths) - Paths to resolved dependency files.
1930 @(_ReferenceRelatedPaths) - Paths to .xmls and .pdbs.
1931 @(ReferenceSatellitePaths) - Paths to satellites.
1932 @(_ReferenceSerializationAssemblyPaths) - Paths to XML serialization assemblies created by sgen.
1933 @(_ReferenceScatterPaths) - Paths to scatter files.
1934 @(ReferenceCopyLocalPaths) - Paths to files that should be copied to the local directory.
1935 ============================================================
1938 <ResolveAssemblyReferencesDependsOn>
1940 GetReferenceAssemblyPaths;
1942 ResolveSDKReferences;
1943 ExpandSDKReferences;
1944 </ResolveAssemblyReferencesDependsOn>
1947 Name="ResolveAssemblyReferences"
1948 Returns="@(ReferencePath)"
1949 DependsOnTargets="$(ResolveAssemblyReferencesDependsOn)">
1952 <_ReferenceInstalledAssemblyDirectory Include="$(TargetFrameworkDirectory)" />
1953 <_ReferenceInstalledAssemblySubsets Include="$(TargetFrameworkSubset)" />
1957 Only read and write cache file at build time, skip it for load time because its more
1958 expensive to write the newly created cache file.
1961 <ResolveAssemblyReferencesStateFile Condition="'$(BuildingProject)'=='true'">$(IntermediateOutputPath)$(MSBuildProjectFile)ResolveAssemblyReference.cache</ResolveAssemblyReferencesStateFile>
1964 <!-- Make an App.Config item that exists when AutoUnify is false. -->
1966 <_ResolveAssemblyReferencesApplicationConfigFileForExes Include="@(AppConfigWithTargetPath)" Condition="'$(AutoGenerateBindingRedirects)'=='true' or '$(AutoUnifyAssemblyReferences)'=='false'"/>
1970 <!-- Default in task is true -->
1971 <_FindDependencies Condition="'$(BuildingProject)' != 'true' and '$(_ResolveReferenceDependencies)' != 'true'">false</_FindDependencies>
1972 <ResolveAssemblyReferencesSilent Condition="'$(ResolveAssemblyReferencesSilent)' == '' and '$(TraceDesignTime)' != 'true' and '$(BuildingProject)' == 'false'">true</ResolveAssemblyReferencesSilent>
1973 <ResolveAssemblyReferencesSilent Condition="'$(ResolveAssemblyReferencesSilent)' == ''">false</ResolveAssemblyReferencesSilent>
1974 <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch Condition="'$(ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch)' == ''">Warning</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
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
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
1980 ide will show one of the references as not resolved, this will not break the build but is a display issue -->
1981 <Reference Remove="$(AdditionalExplicitAssemblyReferences)"/>
1982 <Reference Include="$(AdditionalExplicitAssemblyReferences)">
1983 <Implicit>true</Implicit>
1987 <ResolveAssemblyReference
1988 Assemblies="@(Reference)"
1989 AssemblyFiles="@(_ResolvedProjectReferencePaths);@(_ExplicitReference)"
1990 TargetFrameworkDirectories="@(_ReferenceInstalledAssemblyDirectory)"
1991 InstalledAssemblyTables="@(InstalledAssemblyTables);@(RedistList)"
1992 IgnoreDefaultInstalledAssemblyTables="$(IgnoreDefaultInstalledAssemblyTables)"
1993 IgnoreDefaultInstalledAssemblySubsetTables="$(IgnoreInstalledAssemblySubsetTables)"
1994 CandidateAssemblyFiles="@(Content);@(None)"
1995 SearchPaths="$(AssemblySearchPaths)"
1996 AllowedAssemblyExtensions="$(AllowedReferenceAssemblyFileExtensions)"
1997 AllowedRelatedFileExtensions="$(AllowedReferenceRelatedFileExtensions)"
1998 TargetProcessorArchitecture="$(ProcessorArchitecture)"
1999 AppConfigFile="@(_ResolveAssemblyReferencesApplicationConfigFileForExes)"
2000 AutoUnify="$(AutoUnifyAssemblyReferences)"
2001 SupportsBindingRedirectGeneration="$(GenerateBindingRedirectsOutputType)"
2002 IgnoreVersionForFrameworkReferences="$(IgnoreVersionForFrameworkReferences)"
2003 FindDependencies="$(_FindDependencies)"
2004 FindSatellites="$(BuildingProject)"
2005 FindSerializationAssemblies="$(BuildingProject)"
2006 FindRelatedFiles="$(BuildingProject)"
2007 Silent="$(ResolveAssemblyReferencesSilent)"
2008 TargetFrameworkVersion="$(TargetFrameworkVersion)"
2009 TargetFrameworkMoniker="$(TargetFrameworkMoniker)"
2010 TargetFrameworkMonikerDisplayName="$(TargetFrameworkMonikerDisplayName)"
2011 TargetedRuntimeVersion="$(TargetedRuntimeVersion)"
2012 StateFile="$(ResolveAssemblyReferencesStateFile)"
2013 InstalledAssemblySubsetTables="@(InstalledAssemblySubsetTables)"
2014 TargetFrameworkSubsets="@(_ReferenceInstalledAssemblySubsets)"
2015 FullTargetFrameworkSubsetNames="$(FullReferenceAssemblyNames)"
2016 FullFrameworkFolders="$(_FullFrameworkReferenceAssemblyPaths)"
2017 FullFrameworkAssemblyTables="@(FullFrameworkAssemblyTables)"
2018 ProfileName="$(TargetFrameworkProfile)"
2019 LatestTargetFrameworkDirectories="@(LatestTargetFrameworkDirectories)"
2020 CopyLocalDependenciesWhenParentReferenceInGac="$(CopyLocalDependenciesWhenParentReferenceInGac)"
2021 DoNotCopyLocalIfInGac="$(DoNotCopyLocalIfInGac)"
2022 ResolvedSDKReferences="@(ResolvedSDKReference)"
2023 WarnOrErrorOnTargetArchitectureMismatch="$(ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch)"
2024 IgnoreTargetFrameworkAttributeVersionMismatch ="$(ResolveAssemblyReferenceIgnoreTargetFrameworkAttributeVersionMismatch)"
2025 ContinueOnError="$(ContinueOnError)"
2026 Condition="'@(Reference)'!='' or '@(_ResolvedProjectReferencePaths)'!='' or '@(_ExplicitReference)' != ''"
2029 <Output TaskParameter="ResolvedFiles" ItemName="ReferencePath"/>
2030 <Output TaskParameter="ResolvedFiles" ItemName="_ResolveAssemblyReferenceResolvedFiles"/>
2031 <Output TaskParameter="ResolvedDependencyFiles" ItemName="ReferenceDependencyPaths"/>
2032 <Output TaskParameter="RelatedFiles" ItemName="_ReferenceRelatedPaths"/>
2033 <Output TaskParameter="SatelliteFiles" ItemName="ReferenceSatellitePaths"/>
2034 <Output TaskParameter="SerializationAssemblyFiles" ItemName="_ReferenceSerializationAssemblyPaths"/>
2035 <Output TaskParameter="ScatterFiles" ItemName="_ReferenceScatterPaths"/>
2036 <Output TaskParameter="CopyLocalFiles" ItemName="ReferenceCopyLocalPaths"/>
2037 <Output TaskParameter="SuggestedRedirects" ItemName="SuggestedBindingRedirects"/>
2038 <Output TaskParameter="FilesWritten" ItemName="FileWrites"/>
2039 <Output TaskParameter="DependsOnSystemRuntime" PropertyName="DependsOnSystemRuntime"/>
2040 </ResolveAssemblyReference>
2044 ============================================================
2046 FindReferenceAssembliesForReferences
2048 Given the list of references, create a list of assemblies to pass to the compiler that
2049 includes reference assemblies rather than implementation assemblies where possible.
2052 @(ReferencePath) - List of assembly references as resolved paths with ReferenceAssembly metadata
2055 @(ReferencePathWithRefAssemblies) - Paths to resolved reference (or implementation) assemblies.
2056 ============================================================
2058 <Target Name="FindReferenceAssembliesForReferences"
2059 DependsOnTargets="ResolveReferences">
2061 <!-- Reference assemblies are not produced in all cases, but it's easier to consume them
2062 if this metadatum is always populated. Ensure that it points to the implementation
2063 assembly unless already specified. -->
2064 <ReferencePath Condition="'%(ReferencePath.ReferenceAssembly)' == ''">
2065 <ReferenceAssembly>%(FullPath)</ReferenceAssembly>
2068 <ReferencePathWithRefAssemblies Include="@(ReferencePath->'%(ReferenceAssembly)')"
2069 Condition="'$(CompileUsingReferenceAssemblies)' != 'false'">
2070 <OriginalPath Condition="'%(ReferencePath.Identity)' != '@(ReferencePath->'%(ReferenceAssembly)')'">%(ReferencePath.Identity)</OriginalPath>
2071 </ReferencePathWithRefAssemblies>
2072 <ReferencePathWithRefAssemblies Include="@(ReferencePath)"
2073 Condition="'$(CompileUsingReferenceAssemblies)' == 'false'" />
2078 ====================================================================================================
2080 GenerateBindingRedirects
2081 Inject the binding redirects into the app config file based on suggested redirects as output from
2082 ResolveAssemblyReferences.
2085 @(AppConfigWithTargetPath) - Path to the source app config file. This can be null if the project
2086 doesn't contain an app config file.
2087 $(TargetFileName) - The file name of the build target.
2090 @(OutputAppConfigFile) - Path to the output app config file in the intermediate directory.
2092 ====================================================================================================
2094 <Target Name="GenerateBindingRedirects"
2095 Inputs="$(MSBuildAllProjects);@(AppConfigFile);$(ResolveAssemblyReferencesStateFile);$(IntermediateOutputPath);@(SuggestedBindingRedirects)"
2096 Outputs="$(_GenerateBindingRedirectsIntermediateAppConfig)"
2097 Condition="'$(AutoGenerateBindingRedirects)' == 'true' and '$(GenerateBindingRedirectsOutputType)' == 'true'">
2099 <GenerateBindingRedirects
2100 AppConfigFile="@(AppConfigWithTargetPath)"
2101 TargetName="$(TargetFileName).config"
2102 OutputAppConfigFile="$(_GenerateBindingRedirectsIntermediateAppConfig)"
2103 SuggestedRedirects="@(SuggestedBindingRedirects)"
2106 <Output TaskParameter="OutputAppConfigFile" ItemName="FileWrites" />
2108 </GenerateBindingRedirects>
2113 ====================================================================================================
2115 GenerateBindingRedirectsUpdateAppConfig
2116 Updates the project to use the generated app.config content. This needs to run regardless of
2117 inputs/outputs so it is seperate from GenerateBindingRedirects.
2118 ====================================================================================================
2120 <Target Name="GenerateBindingRedirectsUpdateAppConfig"
2121 AfterTargets="GenerateBindingRedirects"
2122 Condition="'$(AutoGenerateBindingRedirects)' == 'true' and '$(GenerateBindingRedirectsOutputType)' == 'true' and Exists('$(_GenerateBindingRedirectsIntermediateAppConfig)')">
2125 <AppConfig>$(_GenerateBindingRedirectsIntermediateAppConfig)</AppConfig>
2128 <AppConfigWithTargetPath Remove="@(AppConfigWithTargetPath)" />
2129 <AppConfigWithTargetPath Include="$(AppConfig)">
2130 <TargetPath>$(TargetFileName).config</TargetPath>
2131 </AppConfigWithTargetPath>
2137 ===========================================================================================
2140 Gets the list of SDKs installed in the SDKDirectoryRoot and SDKRegistryRoot locations
2142 These paths are used by the ResolveSDKReference task and the ResolveAssemblyReference task.
2143 ===========================================================================================
2146 <SDKReferenceRegistryRoot Condition="'$(SDKReferenceRegistryRoot)' == ''">Software\Microsoft\Microsoft SDKs</SDKReferenceRegistryRoot>
2147 <SDKReferenceDirectoryRoot Condition="'$(SDKReferenceDirectoryRoot)' == ''">$(LocalAppData)\Microsoft SDKs;$(MSBuildProgramFiles32)\Microsoft SDKs</SDKReferenceDirectoryRoot>
2148 <!-- Manifest driven extension SDK locations -->
2149 <SDKExtensionDirectoryRoot Condition="'$(SDKExtensionDirectoryRoot)' == '' and '$(SDKIdentifier)' != ''">$(MSBuildProgramFiles32)\Microsoft SDKs\Windows Kits\10;$(MSBuildProgramFiles32)\Windows Kits\10</SDKExtensionDirectoryRoot>
2151 <!-- UAP projects by default should support Windows 8.1 SDKs -->
2152 <SupportWindows81SDKs Condition="'$(SupportWindows81SDKs)' == '' and '$(Support81SDKs)' != 'false' and '$(TargetPlatformIdentifier)' == 'UAP'">true</SupportWindows81SDKs>
2153 <TargetPlatformIdentifierWindows81 Condition="'$(TargetPlatformIdentifierWindows81)' == '' and '$(SupportWindows81SDKs)' == 'true'">Windows</TargetPlatformIdentifierWindows81>
2154 <TargetPlatformVersionWindows81 Condition="'$(TargetPlatformVersionWindows81)' == '' and '$(SupportWindows81SDKs)' == 'true'">8.1</TargetPlatformVersionWindows81>
2156 <!-- Desktop and phone SDKs often have the exact same identifiers, don't enable phone by default -->
2157 <SupportWindowsPhone81SDKs Condition="'$(SupportWindowsPhone81SDKs)' == '' and '$(Support81SDKs)' != 'false' and '$(TargetPlatformIdentifier)' == 'UAP'">false</SupportWindowsPhone81SDKs>
2158 <TargetPlatformIdentifierWindowsPhone81 Condition="'$(TargetPlatformIdentifierWindowsPhone81)' == '' and '$(SupportWindowsPhone81SDKs)' == 'true'">WindowsPhoneApp</TargetPlatformIdentifierWindowsPhone81>
2159 <TargetPlatformVersionWindowsPhone81 Condition="'$(TargetPlatformVersionWindowsPhone81)' == '' and '$(SupportWindowsPhone81SDKs)' == 'true'">8.1</TargetPlatformVersionWindowsPhone81>
2163 Name="GetInstalledSDKLocations"
2164 DependsOnTargets="$(GetInstalledSDKLocationsDependsOn)"
2165 Returns="@(InstalledSDKLocations)"
2168 <GetInstalledSDKLocations
2169 SDKDirectoryRoots="$(SDKReferenceDirectoryRoot)"
2170 SDKExtensionDirectoryRoots="$(SDKExtensionDirectoryRoot)"
2171 SDKRegistryRoot="$(SDKReferenceRegistryRoot)"
2172 TargetPlatformVersion="$(TargetPlatformVersion)"
2173 TargetPlatformIdentifier="$(TargetPlatformIdentifier)"
2174 Condition="'@(SDKReference)' != ''"
2176 <Output TaskParameter="InstalledSDKs" ItemName="InstalledSDKLocations"/>
2177 </GetInstalledSDKLocations>
2179 <!-- Also lookup 8.1 SDKs if requested -->
2180 <GetInstalledSDKLocations
2181 SDKDirectoryRoots="$(SDKReferenceDirectoryRoot)"
2182 SDKExtensionDirectoryRoots=""
2183 SDKRegistryRoot="$(SDKReferenceRegistryRoot)"
2184 TargetPlatformVersion="$(TargetPlatformVersionWindows81)"
2185 TargetPlatformIdentifier="$(TargetPlatformIdentifierWindows81)"
2186 Condition="'@(SDKReference)' != '' and '$(SupportWindows81SDKs)' == 'true' and '$(TargetPlatformIdentifierWindows81)' != '' and '$(TargetPlatformVersionWindows81)' != ''"
2187 WarnWhenNoSDKsFound="false"
2189 <Output TaskParameter="InstalledSDKs" ItemName="InstalledSDKLocations"/>
2190 </GetInstalledSDKLocations>
2192 <GetInstalledSDKLocations
2193 SDKDirectoryRoots="$(SDKReferenceDirectoryRoot)"
2194 SDKExtensionDirectoryRoots=""
2195 SDKRegistryRoot="$(SDKReferenceRegistryRoot)"
2196 TargetPlatformVersion="$(TargetPlatformVersionWindowsPhone81)"
2197 TargetPlatformIdentifier="$(TargetPlatformIdentifierWindowsPhone81)"
2198 Condition="'@(SDKReference)' != '' and '$(SupportWindowsPhone81SDKs)' == 'true' and '$(TargetPlatformIdentifierWindowsPhone81)' != '' and '$(TargetPlatformVersionWindowsPhone81)' != ''"
2199 WarnWhenNoSDKsFound="false"
2201 <Output TaskParameter="InstalledSDKs" ItemName="InstalledSDKLocations"/>
2202 </GetInstalledSDKLocations>
2207 ============================================================
2209 ResolveSDKReferences
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
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
2213 and the sdk identity as a piece of metadata.
2216 @(SDKReference) - List of sdk references (the identity in the sdk manifest file).
2217 @(ReferencePath) -List of resolved assemblies, we are interested in the ones which have IsWinMDFile set to true.
2220 @(ResolvedSDKReference) - Full path to the root of the SDK
2221 ============================================================
2224 <ResolveSDKReferencesDependsOn>
2225 GetInstalledSDKLocations
2226 </ResolveSDKReferencesDependsOn>
2230 <TargetedSDKConfiguration Condition="'$(TargetedSDKConfiguration)' == '' and '_$(Configuration)' == '_Debug'">Debug</TargetedSDKConfiguration>
2231 <TargetedSDKConfiguration Condition="'$(TargetedSDKConfiguration)' == '' and '_$(Configuration)' == '_Release'">Retail</TargetedSDKConfiguration>
2232 <TargetedSDKConfiguration Condition="'$(TargetedSDKConfiguration)' == ''">Retail</TargetedSDKConfiguration>
2233 <TargetedSDKArchitecture Condition="'$(TargetedSDKArchitecture)' == ''">$(ProcessorArchitecture)</TargetedSDKArchitecture>
2234 <TargetedSDKArchitecture Condition="'$(TargetedSDKArchitecture)' == ''">Neutral</TargetedSDKArchitecture>
2238 <ShouldMarkCertainSDKReferencesAsRuntimeOnly Condition="'$(ShouldMarkCertainSDKReferencesAsRuntimeOnly)' == ''">true</ShouldMarkCertainSDKReferencesAsRuntimeOnly>
2241 <ItemGroup Condition="'$(ShouldMarkCertainSDKReferencesAsRuntimeOnly)' == 'true'">
2242 <!-- Dependencies that are specified as runtime-only dependencies. Therefore the associated files are not used to build Appx package. -->
2243 <!-- TODO: Do we need to do anything like this for the new SDK? -->
2244 <RuntimeReferenceOnlySDKDependencies Condition = "'$(TargetPlatformVersion)' == '8.1'" Include="Microsoft.VCLibs, Version=11.0"/>
2248 Name="ResolveSDKReferences"
2249 Returns="@(ResolvedSDKReference)"
2250 DependsOnTargets="$(ResolveSDKReferencesDependsOn)">
2252 <ResolveSDKReference
2253 SDKReferences="@(SDKReference)"
2254 RuntimeReferenceOnlySDKDependencies="@(RuntimeReferenceOnlySDKDependencies)"
2255 References="@(Reference)"
2256 TargetPlatformVersion="$(TargetPlatformVersion)"
2257 TargetPlatformIdentifier="$(TargetPlatformIdentifier)"
2258 WarnOnMissingPlatformVersion="$(SDKReferenceWarnOnMissingMaxPlatformVersion)"
2259 ProjectName="$(MSBuildProjectName)"
2260 TargetedSDKConfiguration="$(TargetedSDKConfiguration)"
2261 TargetedSDKArchitecture="$(TargetedSDKArchitecture)"
2262 InstalledSDKs ="@(InstalledSDKLocations)"
2263 LogResolutionErrorsAsWarnings ="$(LogSDKReferenceResolutionErrorsAsWarnings)"
2264 Prefer32Bit ="$(Prefer32Bit)"
2265 ContinueOnError="$(ContinueOnError)"
2266 Condition="'@(SDKReference)'!=''">
2267 <Output TaskParameter="ResolvedSDKReferences" ItemName="ResolvedSDKReference"/>
2268 </ResolveSDKReference>
2272 Name="ResolveSDKReferencesDesignTime"
2273 Returns="@(ResolvedSDKReference)"
2274 DependsOnTargets="ResolveSDKReferences" />
2277 ============================================================
2279 FindInvalidProjectReferences
2281 Find project to project references with target platform version higher than the one used by the current project and
2282 creates a list of invalid references to be unresolved. It issues a warning for each invalid reference.
2285 $(TargetPlatformVersion) - Project's target platform version
2286 @(_ProjectReferenceTargetPlatformMonikers) - List of monikers of all referenced projects gathered by the helper
2287 target GetTargetPlatformMonikers.
2290 @(InvalidProjectReferences) - List of invalid project references
2292 ============================================================
2296 <FindInvalidProjectReferencesDependsOn>
2297 GetReferenceTargetPlatformMonikers
2298 </FindInvalidProjectReferencesDependsOn>
2302 Name="FindInvalidProjectReferences"
2303 Condition ="'$(FindInvalidProjectReferences)' == 'true'"
2304 DependsOnTargets="$(FindInvalidProjectReferencesDependsOn)">
2306 <FindInvalidProjectReferences
2307 TargetPlatformVersion="$(TargetPlatformVersion)"
2308 TargetPlatformIdentifier="$(TargetPlatformIdentifier)"
2309 ProjectReferences="@(TargetPathWithTargetPlatformMoniker)">
2310 <Output TaskParameter="InvalidReferences" ItemName="InvalidProjectReferences" />
2311 </FindInvalidProjectReferences>
2314 <_ResolvedProjectReferencePaths Remove="@(InvalidProjectReferences)" />
2318 <Target Name="GetReferenceTargetPlatformMonikers" DependsOnTargets="PrepareProjectReferences">
2320 Projects="@(_MSBuildProjectReferenceExistent)"
2321 Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform); %(_MSBuildProjectReferenceExistent.SetTargetFramework)"
2322 Targets="GetTargetPathWithTargetPlatformMoniker"
2323 BuildInParallel="$(BuildInParallel)"
2324 ContinueOnError="!$(BuildingProject)"
2325 RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
2327 <Output TaskParameter="TargetOutputs" ItemName="TargetPathWithTargetPlatformMoniker" />
2332 ============================================================
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)
2337 as part of the assemblies passed to the compiler.
2339 Project systems or project which do not want to reference all dlls or winmd files should override this target to do nothing.
2340 ============================================================
2343 <ExpandSDKReferencesDependsOn>
2344 ResolveSDKReferences
2345 </ExpandSDKReferencesDependsOn>
2347 <ExpandSDKAllowedReferenceExtensions Condition="'$(ExpandSDKAllowedReferenceExtensions)' == ''">
2350 </ExpandSDKAllowedReferenceExtensions>
2353 <Target Name="ExpandSDKReferences"
2354 Returns="@(ReferencesFromSDK)"
2355 DependsOnTargets="$(ExpandSDKReferencesDependsOn)"
2357 <GetSDKReferenceFiles
2358 ResolvedSDKReferences="@(ResolvedSDKReference)"
2359 ReferenceExtensions="$(ExpandSDKAllowedReferenceExtensions)"
2360 TargetSDKIdentifier="$(SDKIdentifier)"
2361 TargetSDKVersion="$(SDKVersion)"
2362 TargetPlatformIdentifier="$(TargetPlatformIdentifier)"
2363 TargetPlatformVersion="$(TargetPlatformVersion)"
2364 LogRedistFilesList="$(GetSDKReferenceFilesLogRedistFilesList)"
2365 LogRedistConflictWithinSDKAsWarning ="$(GetSDKReferenceFilesLogRedistConflictsWithinSDKAsWarning)"
2366 LogRedistConflictBetweenSDKsAsWarning ="$(GetSDKReferenceFilesLogRedistConflictsBetweenSDKsAsWarning)"
2367 LogReferencesList="$(GetSDKReferenceFilesLogReferencesList)"
2368 LogReferenceConflictWithinSDKAsWarning ="$(GetSDKReferenceFilesLogReferenceConflictsWithinSDKAsWarning)"
2369 LogReferenceConflictBetweenSDKsAsWarning ="$(GetSDKReferenceFilesLogReferenceConflictsBetweenSDKsAsWarning)"
2370 CacheFileFolderPath ="$(GetSDKReferenceFilesCacheFolder)"
2371 LogCacheFileExceptions="$(GetSDKReferenceFilesLogCacheFileExceptions)"
2372 Condition="'@(ResolvedSDKReference)'!=''">
2374 <Output TaskParameter="References" ItemName="ReferencePath"/>
2375 <Output TaskParameter="References" ItemName="ReferencesFromSDK"/>
2376 <Output TaskParameter="References" ItemName="_ResolveAssemblyReferenceResolvedFiles"/>
2377 <Output TaskParameter="CopyLocalFiles" ItemName="ReferenceCopyLocalPaths"/>
2378 <Output TaskParameter="RedistFiles" ItemName="ResolvedRedistFiles"/>
2379 </GetSDKReferenceFiles>
2383 ============================================================
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
2388 through the winmdexp tool in order to generate the resulting WinMD file.
2390 ===========================================================
2393 <Target Name="ExportWindowsMDFile"
2394 DependsOnTargets="Compile"
2395 Condition="'$(ExportWinMDFile)' == 'true'"
2396 Inputs="@(IntermediateAssembly);@(DocFileItem);@(_DebugSymbolsIntermediatePath);@(ReferencePath);$(MSBuildAllProjects)"
2397 Outputs="$(_IntermediateWindowsMetadataPath);$(WinMDExpOutputPdb);$(WinMDOutputDocumentationFile)"
2401 <!-- Will be copied by the "copy WinMD artifacts" step instead -->
2402 <CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
2403 <CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
2405 <WinMdExpToolPath Condition="'$(WinMdExpToolPath)' == ''">$(TargetFrameworkSDKToolsDirectory)</WinMdExpToolPath>
2406 <WinMdExpUTF8Ouput Condition="'$(WinMdExpUTF8Ouput)' == ''">true</WinMdExpUTF8Ouput>
2409 <WinMDExp WinMDModule="@(IntermediateAssembly)"
2410 References="@(ReferencePath)"
2411 DisabledWarnings="$(WinMdExpNoWarn)"
2412 InputDocumentationFile="@(DocFileItem)"
2413 OutputDocumentationFile="$(WinMDOutputDocumentationFile)"
2414 TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
2415 InputPDBFile="@(_DebugSymbolsIntermediatePath)"
2416 OutputPDBFile="$(WinMDExpOutputPdb)"
2417 OutputWindowsMetadataFile="$(_IntermediateWindowsMetadataPath)"
2418 EnvironmentVariables="$(WinMDExpEnvironment)"
2419 UTF8Output="$(WinMdExpUTF8Ouput)"
2420 SdkToolsPath="$(WinMdExpToolPath)"
2421 AssemblyUnificationPolicy="$(WinMDExpAssemblyUnificationPolicy)">
2422 <Output TaskParameter="OutputWindowsMetadataFile" ItemName="FileWrites"/>
2426 <WinMDExpArtifacts Include="$(_IntermediateWindowsMetadataPath)"/>
2427 <WinMDExpArtifacts Include="$(WinMDOutputDocumentationFile)"/>
2428 <WinMDExpArtifacts Include="$(WinMDExpOutputPdb)"/>
2429 <FileWrites Include="$(WinMDOutputDocumentationFile);$(WinMDExpOutputPdb)"/>
2434 Name="ResolveAssemblyReferencesDesignTime"
2435 Returns="@(_ReferencesFromRAR)"
2436 DependsOnTargets="ResolveProjectReferences;ResolveAssemblyReferences">
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. -->
2440 <_ReferencesFromRAR Include="@(ReferencePath->WithMetadataValue('ReferenceSourceTarget', 'ResolveAssemblyReference'))"/>
2445 <ProjectDesignTimeAssemblyResolutionSearchPaths Condition=" '$(ProjectDesignTimeAssemblyResolutionSearchPaths)' == '' ">
2446 {CandidateAssemblyFiles};
2449 {TargetFrameworkDirectory};
2450 {Registry:$(FrameworkRegistryBase),$(TargetFrameworkVersion),$(AssemblyFoldersSuffix)$(AssemblyFoldersExConditions)};
2453 </ProjectDesignTimeAssemblyResolutionSearchPaths>
2457 ==============================================================
2459 DesignTimeResolveAssemblyReferences
2461 Given the list of assemblies, resolve their reference paths.
2462 This target is called by Visual Studio at run time in order to filter references
2463 according to the targeted framework.
2466 @(DesignTimeReference) - List of assembly references as simple/fusion names.
2470 @(ReferencePath) - Paths to resolved primary files.
2472 ==============================================================
2475 <DesignTimeResolveAssemblyReferencesDependsOn>
2477 GetReferenceAssemblyPaths;
2479 </DesignTimeResolveAssemblyReferencesDependsOn>
2483 Name="DesignTimeResolveAssemblyReferences"
2484 Condition="'$(DesignTimeReference)'!=''"
2485 DependsOnTargets="$(DesignTimeResolveAssemblyReferencesDependsOn)">
2488 <_DesignTimeReferenceInstalledAssemblyDirectory Include="$(TargetFrameworkDirectory)" />
2492 <DesignTimeResolveAssemblyReferencesStateFile Condition="'$(BuildingProject)'=='true'">$(IntermediateOutputPath)$(MSBuildProjectFile)DesignTimeResolveAssemblyReferences.cache</DesignTimeResolveAssemblyReferencesStateFile>
2496 <DesignTimeAssemblySearchPaths Condition=" '$(DesignTimeAssemblySearchPaths)' == '' ">
2497 {CandidateAssemblyFiles};
2500 {TargetFrameworkDirectory};
2501 {Registry:$(FrameworkRegistryBase),$(TargetFrameworkVersion),$(AssemblyFoldersSuffix)$(AssemblyFoldersExConditions)};
2504 </DesignTimeAssemblySearchPaths>
2508 <DesignTimeFindDependencies Condition=" '$(DesignTimeFindDependencies)' == '' ">false</DesignTimeFindDependencies>
2509 <DesignTimeIgnoreVersionForFrameworkReferences Condition=" '$(DesignTimeIgnoreVersionForFrameworkReferences)' == '' ">false</DesignTimeIgnoreVersionForFrameworkReferences>
2510 <DesignTimeFindSatellites Condition=" '$(DesignTimeFindSatellites)' == '' ">false</DesignTimeFindSatellites>
2511 <DesignTimeFindSerializationAssemblies Condition=" '$(DesignTimeFindSerializationAssemblies)' == '' ">false</DesignTimeFindSerializationAssemblies>
2512 <DesignTimeFindRelatedFiles Condition=" '$(DesignTimeFindRelatedFiles)' == '' ">false</DesignTimeFindRelatedFiles>
2513 <DesignTimeSilentResolution Condition=" '$(DesignTimeSilentResolution)' == '' and '$(TraceDesignTime)' != 'true'">true</DesignTimeSilentResolution>
2514 <DesignTimeAutoUnify Condition="'$(DesignTimeAutoUnify)' == ''">false</DesignTimeAutoUnify>
2518 <_DesignTimeReferenceAssemblies Include ="$(DesignTimeReference)" />
2522 <_RARResolvedReferencePath Include="@(ReferencePath)" />
2523 <ReferencePath Remove="@(ReferencePath)" />
2526 <ResolveAssemblyReference
2527 Assemblies="@(_DesignTimeReferenceAssemblies)"
2528 TargetFrameworkDirectories="@(_DesignTimeReferenceInstalledAssemblyDirectory)"
2529 SearchPaths="$(DesignTimeAssemblySearchPaths)"
2530 AllowedAssemblyExtensions="$(AllowedReferenceAssemblyFileExtensions)"
2531 TargetProcessorArchitecture="$(ProcessorArchitecture)"
2532 CandidateAssemblyFiles="@(Content);@(None);@(_RARResolvedReferencePath)"
2533 FindDependencies="$(DesignTimeFindDependencies)"
2534 AutoUnify="$(DesignTimeAutoUnify)"
2535 IgnoreVersionForFrameworkReferences="$(DesignTimeIgnoreVersionForFrameworkReferences)"
2536 FindSatellites="$(DesignTimeFindSatellites)"
2537 FindSerializationAssemblies="$(DesignTimeFindSerializationAssemblies)"
2538 FindRelatedFiles="$(DesignTimeFindRelatedFiles)"
2539 Silent="$(DesignTimeSilentResolution)"
2540 TargetFrameworkVersion="$(TargetFrameworkVersion)"
2541 TargetFrameworkMoniker="$(TargetFrameworkMoniker)"
2542 TargetFrameworkMonikerDisplayName="$(TargetFrameworkMonikerDisplayName)"
2543 TargetedRuntimeVersion="$(TargetedRuntimeVersion)"
2544 StateFile="$(DesignTimeResolveAssemblyReferencesStateFile)"
2545 InstalledAssemblySubsetTables="@(InstalledAssemblySubsetTables)"
2546 IgnoreDefaultInstalledAssemblySubsetTables="$(IgnoreInstalledAssemblySubsetTables)"
2547 TargetFrameworkSubsets="@(_ReferenceInstalledAssemblySubsets)"
2548 FullTargetFrameworkSubsetNames="$(FullReferenceAssemblyNames)"
2549 FullFrameworkFolders="$(_FullFrameworkReferenceAssemblyPaths)"
2550 FullFrameworkAssemblyTables="@(FullFrameworkAssemblyTables)"
2551 ProfileName="$(TargetFrameworkProfile)"
2552 ResolvedSDKReferences="@(ResolvedSDKReference)"
2553 IgnoreTargetFrameworkAttributeVersionMismatch ="$(DesignTimeIgnoreTargetFrameworkAttributeVersionMismatch)"
2556 <Output TaskParameter="ResolvedFiles" ItemName="DesignTimeReferencePath"/>
2557 <Output TaskParameter="FilesWritten" ItemName="FileWrites"/>
2558 </ResolveAssemblyReference>
2562 ============================================================
2563 ResolveComReferences
2565 Resolve COM references
2568 @(COMReference) - The list of COM references
2569 $(BaseIntermediateOutputPath) - The output directory in which to generate wrapper assemblies
2572 @(ReferencePath) - Paths to referenced wrappers.
2574 If ResolveComReferences is invoked from the IDE, PrepareForBuild may need to run to create directories.
2575 ============================================================
2578 <ComReferenceExecuteAsTool Condition="'$(ComReferenceExecuteAsTool)'==''">false</ComReferenceExecuteAsTool>
2582 Name="ResolveComReferences"
2583 Condition="'@(COMReference)'!='' or '@(COMFileReference)'!=''"
2584 Returns="@(ReferencePath)"
2585 DependsOnTargets="PrepareForBuild;ResolveKeySource;ResolveAssemblyReferences"
2588 <PropertyGroup Condition=" '$(InteropOutputPath)' == '' ">
2589 <InteropOutputPath>$(IntermediateOutputPath)</InteropOutputPath>
2592 <MakeDir Directories="$(InteropOutputPath)"/>
2595 Note: This task should not be batched, since it relies on having all the COM references fed into it at once.
2598 <ResolveComReferenceMSBuildArchitecture Condition="'$(ResolveComReferenceMSBuildArchitecture)' == ''">$(PlatformTargetAsMSBuildArchitecture)</ResolveComReferenceMSBuildArchitecture>
2600 <ResolveComReferenceToolPath Condition="'$(ResolveComReferenceToolPath)' == ''">$(TargetFrameworkSDKToolsDirectory)</ResolveComReferenceToolPath>
2601 <ResolveComReferenceSilent Condition="'$(ResolveComReferenceSilent)' == ''">false</ResolveComReferenceSilent>
2604 <ResolveComReference
2605 TypeLibNames="@(COMReference)"
2606 TypeLibFiles="@(COMFileReference)"
2607 ResolvedAssemblyReferences="@(ReferencePath)"
2608 WrapperOutputDirectory="$(InteropOutputPath)"
2609 IncludeVersionInInteropName="$(IncludeVersionInInteropName)"
2610 KeyContainer="$(KeyContainerName)"
2611 KeyFile="$(KeyOriginatorFile)"
2612 DelaySign="$(DelaySign)"
2613 StateFile="@(_ResolveComReferenceCache)"
2614 TargetFrameworkVersion="$(TargetFrameworkVersion)"
2615 TargetProcessorArchitecture="$(ProcessorArchitecture)"
2616 NoClassMembers="$(ComReferenceNoClassMembers)"
2617 Silent="$(ResolveComReferenceSilent)"
2618 EnvironmentVariables="$(ResolveComReferenceEnvironment)"
2619 SdkToolsPath="$(ResolveComReferenceToolPath)"
2620 ExecuteAsTool="$(ComReferenceExecuteAsTool)"
2621 MSBuildArchitecture="$(ResolveComReferenceMSBuildArchitecture)"
2622 ContinueOnError="$(ContinueOnError)">
2624 <Output TaskParameter="ResolvedFiles" ItemName="ReferencePath"/>
2625 <Output TaskParameter="ResolvedFiles" ItemName="ComReferenceWrappers"/>
2626 <Output TaskParameter="ResolvedFiles" ItemName="FileWrites"/>
2627 <!-- This output list only includes items with Isolated attribute set to True. It's done by the task itself. -->
2628 <Output TaskParameter="ResolvedModules" ItemName="ResolvedIsolatedComModules"/>
2630 </ResolveComReference>
2633 <FileWrites Include="@(_ResolveComReferenceCache)"/>
2634 <ReferenceComWrappersToCopyLocal Include="@(ComReferenceWrappers)" Condition="'%(ComReferenceWrappers.CopyLocal)'!='false'"/>
2640 Name="ResolveComReferencesDesignTime"
2641 Returns="@(ComReferenceWrappers)"
2642 DependsOnTargets="ResolveComReferences" />
2645 ***********************************************************************************************
2646 ***********************************************************************************************
2647 PrepareResources Section
2648 ***********************************************************************************************
2649 ***********************************************************************************************
2653 ============================================================
2656 Prepare resources for the Compile step.
2657 ============================================================
2660 <PrepareResourcesDependsOn>
2661 PrepareResourceNames;
2664 </PrepareResourcesDependsOn>
2667 Name="PrepareResources"
2668 DependsOnTargets="$(PrepareResourcesDependsOn)"/>
2671 ============================================================
2672 PrepareResourceNames
2674 Prepare the names of resource files.
2675 ============================================================
2678 <PrepareResourceNamesDependsOn>
2680 SplitResourcesByCulture;
2681 CreateManifestResourceNames;
2682 CreateCustomManifestResourceNames
2683 </PrepareResourceNamesDependsOn>
2686 Name="PrepareResourceNames"
2687 DependsOnTargets="$(PrepareResourceNamesDependsOn)"/>
2690 ============================================================
2693 This target creates <TargetPath> tags for items. <TargetPath> is a relative folder plus filename
2694 for the destination of this item.
2695 ============================================================
2698 <AssignTargetPathsDependsOn></AssignTargetPathsDependsOn>
2701 Name="AssignTargetPaths"
2702 DependsOnTargets="$(AssignTargetPathsDependsOn)">
2705 <_Temporary Remove="@(_Temporary)" />
2708 <!-- AssignTargetPath generates TargetPath metadata that is consumed by CreateManifestResourceNames target for manifest name generation -->
2709 <AssignTargetPath Files="@(EmbeddedResource)" RootFolder="$(MSBuildProjectDirectory)">
2710 <Output TaskParameter="AssignedFiles" ItemName="_Temporary" />
2715 <!-- Replace items in EmbeddedResource with the items emitted by the AssignTargetPath task that have the TargetPath metadata -->
2716 <EmbeddedResource Remove="@(_Temporary)" />
2717 <EmbeddedResource Include="@(_Temporary)" />
2718 <_Temporary Remove="@(_Temporary)" />
2721 <AssignTargetPath Files="@(Content)" RootFolder="$(MSBuildProjectDirectory)">
2722 <Output TaskParameter="AssignedFiles" ItemName="ContentWithTargetPath" />
2725 <AssignTargetPath Files="@(None)" RootFolder="$(MSBuildProjectDirectory)">
2726 <Output TaskParameter="AssignedFiles" ItemName="_NoneWithTargetPath" />
2729 <AssignTargetPath Files="@(BaseApplicationManifest)" RootFolder="$(MSBuildProjectDirectory)">
2730 <Output TaskParameter="AssignedFiles" ItemName="_DeploymentBaseManifestWithTargetPath"/>
2733 <AssignTargetPath Files="@(None)" RootFolder="$(MSBuildProjectDirectory)" Condition="'@(_DeploymentBaseManifestWithTargetPath)'=='' and '%(None.Extension)'=='.manifest'">
2734 <Output TaskParameter="AssignedFiles" ItemName="_DeploymentBaseManifestWithTargetPath" />
2740 ============================================================
2743 This target returns all items that have TargetPath metadata assigned by the AssignTargetPaths target.
2744 ============================================================
2747 Name="GetItemTargetPaths"
2748 DependsOnTargets="AssignTargetPaths"
2750 @(EmbeddedResource);
2751 @(ContentWithTargetPath);
2752 @(_NoneWithTargetPath);
2753 @(_DeploymentBaseManifestWithTargetPath);
2757 ============================================================
2758 SplitResourcesByCulture
2760 Split EmbeddedResource items into five lists based on whether
2761 they are resx files, licx files or other resources and whether they should be localized. Also adds Type and Culture
2762 metadata. Type indicates whether the resource is "Resx" or "Non-Resx".
2765 @(EmbeddedResource) - The raw list of resources.
2768 @(_LicxFile) - The EmbeddedResource items with extension equal to '.licx'.
2769 ============================================================
2772 Name="SplitResourcesByCulture"
2773 DependsOnTargets="AssignTargetPaths">
2775 <Warning Condition="'@(ResxWithNoCulture)'!=''" Code="MSB9000" Text="ResxWithNoCulture item type is deprecated. Use EmbeddedResource items instead."/>
2776 <Warning Condition="'@(ResxWithCulture)'!=''" Code="MSB9001" Text="ResxWithCulture item type is deprecated. Use EmbeddedResource items instead."/>
2777 <Warning Condition="'@(NonResxWithCulture)'!=''" Code="MSB9002" Text="NonResxWithCulture item type is deprecated. Use EmbeddedResource items instead."/>
2778 <Warning Condition="'@(NonResxWithNoCulture)'!=''" Code="MSB9003" Text="NonResxWithNoCulture item type is deprecated. Use EmbeddedResource items instead."/>
2781 <_LicxFile Include="@(EmbeddedResource)" Condition="'%(Extension)'=='.licx'"/>
2783 <!-- CONSUMED FOR COMPATIBILITY REASONS ONLY. EMIT EMBEDDEDRESOURCE INSTEAD -->
2784 <EmbeddedResource Include="@(ResxWithNoCulture);@(ResxWithCulture)">
2787 <EmbeddedResource Include="@(NonResxWithCulture);@(NonResxWithNoCulture)">
2788 <Type>Non-Resx</Type>
2792 <AssignCulture Files="@(EmbeddedResource)" Condition="'%(Extension)'!='.licx'">
2793 <!-- Create the list of culture resx and embedded resource files -->
2794 <Output TaskParameter="AssignedFilesWithCulture" ItemName="_MixedResourceWithCulture"/>
2795 <!-- Create the list of non-culture resx and embedded resource files -->
2796 <Output TaskParameter="AssignedFilesWithNoCulture" ItemName="_MixedResourceWithNoCulture"/>
2801 <!-- Remove EmbeddedResource items that we have processed already
2802 i.e. either Licx, or resources that don't have culture info -->
2803 <EmbeddedResource Remove="@(_MixedResourceWithCulture)" />
2804 <EmbeddedResource Remove="@(_MixedResourceWithNoCulture)" />
2805 <EmbeddedResource Remove="@(_LicxFile)" />
2807 <!-- Add back everything except Licx, so that we have culture info -->
2808 <EmbeddedResource Include="@(_MixedResourceWithNoCulture);@(_MixedResourceWithCulture)" Condition="'%(Extension)'=='.resx' or '%(Extension)'=='.restext'">
2809 <Type Condition="'%(_MixedResourceWithNoCulture.Type)'=='' and '%(_MixedResourceWithCulture.Type)'==''">Resx</Type>
2811 <EmbeddedResource Include="@(_MixedResourceWithNoCulture);@(_MixedResourceWithCulture)" Condition="'%(Extension)'!='.resx' and '%(Extension)'!='.restext'">
2812 <Type Condition="'%(_MixedResourceWithNoCulture.Type)'=='' and '%(_MixedResourceWithCulture.Type)'==''">Non-Resx</Type>
2815 <!-- EMITTED FOR COMPATIBILITY REASONS ONLY. CONSUME EMBEDDEDRESOURCE INSTEAD -->
2816 <ResxWithNoCulture Remove="@(ResxWithNoCulture)"/>
2817 <NonResxWithNoCulture Remove="@(NonResxWithNoCulture)"/>
2818 <ResxWithCulture Remove="@(ResxWithCulture)"/>
2819 <NonResxWithCulture Remove="@(NonResxWithCulture)"/>
2820 <ResxWithNoCulture Include="@(_MixedResourceWithNoCulture)" Condition="'%(WithCulture)'=='false' and ('%(Extension)'=='.resx' or '%(Extension)'=='.restext')"/>
2821 <NonResxWithNoCulture Include="@(_MixedResourceWithNoCulture)" Condition="'%(WithCulture)'=='false' and ('%(Extension)'!='.resx' and '%(Extension)'!='.restext')"/>
2822 <ResxWithCulture Include="@(_MixedResourceWithCulture)" Condition="'%(WithCulture)'=='true' and ('%(Extension)'=='.resx' or '%(Extension)'=='.restext')"/>
2823 <NonResxWithCulture Include="@(_MixedResourceWithCulture)" Condition="'%(WithCulture)'=='true' and ('%(Extension)'!='.resx' and '%(Extension)'!='.restext')"/>
2825 <!-- Clean up temporary lists -->
2826 <_MixedResourceWithNoCulture Remove="@(_MixedResourceWithNoCulture)" />
2827 <_MixedResourceWithCulture Remove="@(_MixedResourceWithCulture)" />
2834 =======================================================================
2835 CreateCustomManifestResourceNames
2837 Allows custom manifest resource name generation tasks to plug
2838 into the build process
2839 =======================================================================
2842 <CreateCustomManifestResourceNamesDependsOn></CreateCustomManifestResourceNamesDependsOn>
2845 Name="CreateCustomManifestResourceNames"
2846 DependsOnTargets="$(CreateCustomManifestResourceNamesDependsOn)"/>
2849 ============================================================
2852 Run GenerateResource on the given resx files.
2854 ============================================================
2857 <ResGenDependsOn>ResolveAssemblyReferences;SplitResourcesByCulture;BeforeResGen;CoreResGen;AfterResGen</ResGenDependsOn>
2858 <CoreResGenDependsOn>FindReferenceAssembliesForReferences</CoreResGenDependsOn>
2859 <UseSourcePath Condition="'$(UseSourcePath)'==''">true</UseSourcePath>
2860 <ResGenExecuteAsTool Condition="'$(ResGenExecuteAsTool)'==''">false</ResGenExecuteAsTool>
2864 DependsOnTargets="$(ResGenDependsOn)"/>
2867 ============================================================
2870 Redefine this target in your project in order to run tasks just before Resgen.
2871 ============================================================
2873 <Target Name="BeforeResGen"/>
2876 ============================================================
2879 Redefine this target in your project in order to run tasks just after Resgen.
2880 ============================================================
2882 <Target Name="AfterResGen"/>
2885 ============================================================
2887 ============================================================
2891 DependsOnTargets="$(CoreResGenDependsOn)">
2894 <_Temporary Remove="@(_Temporary)" />
2898 <GenerateResourceMSBuildArchitecture Condition="'$(GenerateResourceMSBuildArchitecture)' == ''">$(PlatformTargetAsMSBuildArchitecture)</GenerateResourceMSBuildArchitecture>
2900 <ResgenToolPath Condition="'$(ResgenToolPath)' == ''">$(TargetFrameworkSDKToolsDirectory)</ResgenToolPath>
2903 <PropertyGroup Condition="'$(TargetFrameworkAsMSBuildRuntime)' != '' and '$(GenerateResourceMSBuildArchitecture)' != ''">
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
2905 user know there's something wrong than just silently generate something that's probably not quite right. However, in a few
2906 circumstances, there are tasks that are already aware of runtime / bitness concerns, in which case even if we go ahead and run
2907 the more recent version of the task, it should be able to generate something correct. GenerateResource is one such task, so
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
2909 back to the current task since it's still mostly correct.
2911 In particular, we need to do this because otherwise people with Dev10 on a machine that they upgrade to Win8 will be broken:
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
2913 the 8.0A SDK, which they won't have installed, and thus without this fallback mechanism, their projects targeting v3.5 will
2914 suddenly start failing to build.-->
2915 <GenerateResourceMSBuildRuntime
2916 Condition="'$(GenerateResourceMSBuildRuntime)' == '' and
2917 $([MSBuild]::DoesTaskHostExist(`$(TargetFrameworkAsMSBuildRuntime)`, `$(GenerateResourceMSBuildArchitecture)`))">$(TargetFrameworkAsMSBuildRuntime)</GenerateResourceMSBuildRuntime>
2919 <!-- If the targeted runtime doesn't exist, fall back to current -->
2920 <GenerateResourceMSBuildRuntime Condition="'$(GenerateResourceMSBuildRuntime)' == ''">CurrentRuntime</GenerateResourceMSBuildRuntime>
2923 <!-- 4.0 task has some new parameters that we want to make use of if we're targeting 4.0 -->
2925 Sources="@(EmbeddedResource)"
2926 UseSourcePath="$(UseSourcePath)"
2927 References="@(ReferencePathWithRefAssemblies)"
2928 AdditionalInputs="$(MSBuildAllProjects)"
2929 NeverLockTypeAssemblies="$(GenerateResourceNeverLockTypeAssemblies)"
2930 StateFile="$(IntermediateOutputPath)$(MSBuildProjectFile).GenerateResource.Cache"
2931 StronglyTypedClassName="%(EmbeddedResource.StronglyTypedClassName)"
2932 StronglyTypedFileName="%(EmbeddedResource.StronglyTypedFileName)"
2933 StronglyTypedLanguage="%(EmbeddedResource.StronglyTypedLanguage)"
2934 StronglyTypedNamespace="%(EmbeddedResource.StronglyTypedNamespace)"
2935 StronglyTypedManifestPrefix="%(EmbeddedResource.StronglyTypedManifestPrefix)"
2936 PublicClass="%(EmbeddedResource.PublicClass)"
2937 OutputResources="@(EmbeddedResource->'$(IntermediateOutputPath)%(ManifestResourceName).resources')"
2938 Condition="'%(EmbeddedResource.Type)' == 'Resx' and '%(EmbeddedResource.GenerateResource)' != 'false' and '$(GenerateResourceMSBuildRuntime)' != 'CLR2'"
2939 SdkToolsPath="$(ResgenToolPath)"
2940 ExecuteAsTool="$(ResGenExecuteAsTool)"
2941 EnvironmentVariables="$(ResGenEnvironment)"
2942 MSBuildRuntime="$(GenerateResourceMSBuildRuntime)"
2943 MSBuildArchitecture="$(GenerateResourceMSBuildArchitecture)">
2945 <Output TaskParameter="FilesWritten" ItemName="FileWrites"/>
2946 <Output TaskParameter="StronglyTypedFileName" ItemName="Compile"/>
2948 <!-- Gather Sources as an output since it will contain OutputResource metadata indicating the final output resource that it was compiled into -->
2949 <Output TaskParameter="Sources" ItemName="_Temporary" />
2953 <!-- But we can't use those parameters if we're targeting 3.5, since we're using the 3.5 task -->
2955 Sources="@(EmbeddedResource)"
2956 UseSourcePath="$(UseSourcePath)"
2957 References="@(ReferencePath)"
2958 AdditionalInputs="$(MSBuildAllProjects)"
2959 NeverLockTypeAssemblies="$(GenerateResourceNeverLockTypeAssemblies)"
2960 StateFile="$(IntermediateOutputPath)$(MSBuildProjectFile).GenerateResource.Cache"
2961 StronglyTypedClassName="%(EmbeddedResource.StronglyTypedClassName)"
2962 StronglyTypedFileName="%(EmbeddedResource.StronglyTypedFileName)"
2963 StronglyTypedLanguage="%(EmbeddedResource.StronglyTypedLanguage)"
2964 StronglyTypedNamespace="%(EmbeddedResource.StronglyTypedNamespace)"
2965 StronglyTypedManifestPrefix="%(EmbeddedResource.StronglyTypedManifestPrefix)"
2966 PublicClass="%(EmbeddedResource.PublicClass)"
2967 OutputResources="@(EmbeddedResource->'$(IntermediateOutputPath)%(ManifestResourceName).resources')"
2968 MSBuildRuntime="$(GenerateResourceMSBuildRuntime)"
2969 MSBuildArchitecture="$(GenerateResourceMSBuildArchitecture)"
2970 Condition="'%(EmbeddedResource.Type)' == 'Resx' and '%(EmbeddedResource.GenerateResource)' != 'false' and '$(GenerateResourceMSBuildRuntime)' == 'CLR2'">
2972 <Output TaskParameter="FilesWritten" ItemName="FileWrites"/>
2973 <Output TaskParameter="StronglyTypedFileName" ItemName="Compile"/>
2975 <!-- Gather Sources as an output since it will contain OutputResource metadata indicating the final output resource that it was compiled into -->
2976 <Output TaskParameter="Sources" ItemName="_Temporary" />
2981 <EmbeddedResource Remove="@(_Temporary)" />
2983 <!-- Add back the Sources list (with OutputResource metadata) that we output from GenerateResource into EmbeddedResource -->
2984 <EmbeddedResource Include="@(_Temporary)" />
2985 <_Temporary Remove="@(_Temporary)" />
2987 <!-- EMITTED FOR COMPATIBILITY REASONS ONLY. CONSUME EMBEDDEDRESOURCE INSTEAD -->
2988 <ManifestResourceWithNoCulture Include="@(EmbeddedResource->'%(OutputResource)')" Condition="'%(EmbeddedResource.WithCulture)'=='false' and '%(EmbeddedResource.Type)' == 'Resx'">
2989 <EmittedForCompatibilityOnly>true</EmittedForCompatibilityOnly>
2990 </ManifestResourceWithNoCulture>
2991 <ManifestNonResxWithNoCultureOnDisk Include="@(EmbeddedResource)" Condition="'%(EmbeddedResource.WithCulture)'=='false' and '%(EmbeddedResource.Type)' == 'Non-Resx'">
2992 <EmittedForCompatibilityOnly>true</EmittedForCompatibilityOnly>
2993 </ManifestNonResxWithNoCultureOnDisk>
2995 <!-- EMITTED FOR COMPATIBILITY REASONS ONLY. CONSUME EMBEDDEDRESOURCE INSTEAD -->
2996 <ManifestResourceWithCulture Include="@(EmbeddedResource->'%(OutputResource)')" Condition="'%(EmbeddedResource.WithCulture)'=='true' and '%(EmbeddedResource.Type)' == 'Resx'">
2997 <EmittedForCompatibilityOnly>true</EmittedForCompatibilityOnly>
2998 </ManifestResourceWithCulture>
2999 <ManifestNonResxWithCultureOnDisk Include="@(EmbeddedResource)" Condition="'%(EmbeddedResource.WithCulture)'=='true' and '%(EmbeddedResource.Type)' == 'Non-Resx'">
3000 <EmittedForCompatibilityOnly>true</EmittedForCompatibilityOnly>
3001 </ManifestNonResxWithCultureOnDisk>
3008 ============================================================
3011 Compile .licx files (containing information about licensed controls used by the application) into .licenses files.
3014 @(_LicxFile) - The list of .licx files in the project (usually there will be just one)
3017 @(CompiledLicenseFile) - The list of compiled .licenses files (there will be just one)
3018 ============================================================
3021 <CompileLicxFilesDependsOn></CompileLicxFilesDependsOn>
3024 Name="CompileLicxFiles"
3025 Condition="'@(_LicxFile)'!=''"
3026 DependsOnTargets="$(CompileLicxFilesDependsOn)"
3027 Inputs="$(MSBuildAllProjects);@(_LicxFile);@(ReferencePath);@(ReferenceDependencyPaths)"
3028 Outputs="$(IntermediateOutputPath)$(TargetFileName).licenses">
3031 <LCMSBuildArchitecture Condition="'$(LCMSBuildArchitecture)' == ''">$(PlatformTargetAsMSBuildArchitecture)</LCMSBuildArchitecture>
3035 Sources="@(_LicxFile)"
3036 LicenseTarget="$(TargetFileName)"
3037 OutputDirectory="$(IntermediateOutputPath)"
3038 OutputLicense="$(IntermediateOutputPath)$(TargetFileName).licenses"
3039 ReferencedAssemblies="@(ReferencePath);@(ReferenceDependencyPaths)"
3041 ToolPath="$(LCToolPath)"
3042 SdkToolsPath="$(TargetFrameworkSDKToolsDirectory)"
3043 EnvironmentVariables="$(LCEnvironment)"
3044 MSBuildArchitecture="$(LCMSBuildArchitecture)"
3045 TargetFrameworkVersion="$(TargetFrameworkVersion)"
3048 <Output TaskParameter="OutputLicense" ItemName="CompiledLicenseFile"/>
3049 <Output TaskParameter="OutputLicense" ItemName="FileWrites"/>
3059 ***********************************************************************************************
3060 ***********************************************************************************************
3061 ResolveKeySource Section
3062 ***********************************************************************************************
3063 ***********************************************************************************************
3067 ============================================================
3070 Resolve the strong name key used to sign the assembly as well as the certificate used to
3071 sign the ClickOnce manifests.
3074 $(AssemblyOriginatorKeyFile) - The file used to sign the assembly (.snk or .pfx)
3075 $(ManifestCertificateThumbprint) - The thumbprint used to locate the certificate in the
3076 user's certificate store.
3077 $(ManifestKeyFile) - The key file that contains the certificate in case the
3078 certificate is not in the user's store.
3081 $(ResolvedAssemblyKeyFile) - Key used to sign the assembly
3082 $(_DeploymentResolvedManifestCertificateThumbprint) - Certificate used to sign the manifests
3083 ============================================================
3086 Name="ResolveKeySource"
3087 Condition="$(SignManifests) == 'true' or $(SignAssembly) == 'true'">
3090 KeyFile="$(AssemblyOriginatorKeyFile)"
3091 CertificateThumbprint="$(ManifestCertificateThumbprint)"
3092 CertificateFile="$(ManifestKeyFile)"
3093 SuppressAutoClosePasswordPrompt="$(BuildingInsideVisualStudio)"
3094 ShowImportDialogDespitePreviousFailures="$(BuildingProject)"
3095 ContinueOnError="!$(BuildingProject)"
3098 <Output TaskParameter="ResolvedKeyFile" PropertyName="KeyOriginatorFile" Condition=" '$(SignAssembly)' == 'true' "/>
3099 <Output TaskParameter="ResolvedKeyContainer" PropertyName="KeyContainerName" Condition=" '$(SignAssembly)' == 'true' "/>
3100 <Output TaskParameter="ResolvedThumbprint" PropertyName="_DeploymentResolvedManifestCertificateThumbprint" Condition=" '$(SignManifests)' == 'true' "/>
3107 ***********************************************************************************************
3108 ***********************************************************************************************
3110 ***********************************************************************************************
3111 ***********************************************************************************************
3115 ============================================================
3117 ============================================================
3123 SetWin32ManifestProperties;
3124 FindReferenceAssembliesForReferences;
3125 _GenerateCompileInputs;
3127 _TimeStampBeforeCompile;
3128 _GenerateCompileDependencyCache;
3130 _TimeStampAfterCompile;
3136 DependsOnTargets="$(CompileDependsOn)"/>
3139 ============================================================
3140 _GenerateCompileInputs
3142 Create the _CoreCompileResourceInputs list of inputs to the CoreCompile target.
3143 ============================================================
3145 <Target Name="_GenerateCompileInputs">
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."/>
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."/>
3152 <!-- _CoreCompileResourceInputs is the list of TLDA inputs that should trigger CoreCompile, and are listed as inputs to that target -->
3153 <_CoreCompileResourceInputs Include="@(EmbeddedResource->'%(OutputResource)')" Condition="'%(EmbeddedResource.WithCulture)' == 'false' and '%(EmbeddedResource.Type)' == 'Resx'" />
3154 <_CoreCompileResourceInputs Include="@(EmbeddedResource)" Condition="'%(EmbeddedResource.WithCulture)' == 'false' and '%(EmbeddedResource.Type)' == 'Non-Resx' " />
3156 <!-- CONSUMED FOR COMPATIBILITY REASONS ONLY. EMIT EMBEDDEDRESOURCE INSTEAD -->
3157 <_CoreCompileResourceInputs Include="@(ManifestResourceWithNoCulture)" Condition="'%(ManifestResourceWithNoCulture.EmittedForCompatibilityOnly)'==''">
3159 <WithCulture>false</WithCulture>
3160 </_CoreCompileResourceInputs>
3161 <_CoreCompileResourceInputs Include="@(ManifestNonResxWithNoCultureOnDisk)" Condition="'%(ManifestNonResxWithNoCultureOnDisk.EmittedForCompatibilityOnly)'==''">
3162 <Type>Non-Resx</Type>
3163 <WithCulture>false</WithCulture>
3164 </_CoreCompileResourceInputs>
3171 ============================================================
3172 GenerateTargetFrameworkMonikerAttribute
3174 Emit the target framework moniker attribute as a code fragment into a temporary source file for the compiler.
3175 ============================================================
3177 <PropertyGroup Condition="'$(TargetFrameworkMoniker)' != ''">
3178 <!-- Do not clean if we are going to default the path to the temp directory -->
3179 <TargetFrameworkMonikerAssemblyAttributesFileClean Condition="'$(TargetFrameworkMonikerAssemblyAttributesFileClean)' == '' and '$(TargetFrameworkMonikerAssemblyAttributesPath)' != ''">true</TargetFrameworkMonikerAssemblyAttributesFileClean>
3180 <TargetFrameworkMonikerAssemblyAttributesPath Condition="'$(TargetFrameworkMonikerAssemblyAttributesPath)' == ''">$([System.IO.Path]::Combine('$([System.IO.Path]::GetTempPath())','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath>
3184 <GenerateTargetFrameworkAttribute Condition="'$(GenerateTargetFrameworkAttribute)' == '' and '$(TargetFrameworkMoniker)' != '' and '$(TargetingClr2Framework)' != 'true'">true</GenerateTargetFrameworkAttribute>
3187 <ItemGroup Condition="'$(TargetFrameworkMonikerAssemblyAttributesFileClean)' == 'true'">
3188 <Clean Include="$(TargetFrameworkMonikerAssemblyAttributesPath)"/>
3191 <Target Name="GenerateTargetFrameworkMonikerAttribute"
3192 BeforeTargets="BeforeCompile"
3193 DependsOnTargets="PrepareForBuild;GetReferenceAssemblyPaths"
3194 Inputs="$(MSBuildToolsPath)\Microsoft.Common.targets"
3195 Outputs="$(TargetFrameworkMonikerAssemblyAttributesPath)"
3196 Condition="'$(GenerateTargetFrameworkAttribute)' == 'true'">
3198 <!-- This is a file shared between projects so we have to take care to handle simultaneous writes (by ContinueOnError)
3199 and a race between clean from one project and build from another (by not adding to FilesWritten so it doesn't clean) -->
3201 File="$(TargetFrameworkMonikerAssemblyAttributesPath)"
3202 Lines="$(TargetFrameworkMonikerAssemblyAttributeText)"
3204 ContinueOnError="true"
3205 Condition="'@(Compile)' != '' and '$(TargetFrameworkMonikerAssemblyAttributeText)' != ''"
3208 <ItemGroup Condition="'@(Compile)' != '' and '$(TargetFrameworkMonikerAssemblyAttributeText)' != ''">
3209 <Compile Include="$(TargetFrameworkMonikerAssemblyAttributesPath)"/>
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 -->
3216 ============================================================
3217 GenerateAdditionalSources
3219 Emit any specified code fragments into a temporary source file for the compiler.
3220 ============================================================
3223 <PropertyGroup Condition="'$(AssemblyAttributesPath)' != ''">
3224 <GenerateAdditionalSources Condition="'$(GenerateAdditionalSources)' == ''">true</GenerateAdditionalSources>
3227 <ItemGroup Condition="'$(AssemblyAttributesPath)' != ''">
3228 <Clean Include="$(AssemblyAttributesPath)" Condition="'$(AssemblyAttributesFileClean)' != 'false'" />
3231 <Target Name="GenerateAdditionalSources"
3232 BeforeTargets="BeforeCompile"
3233 DependsOnTargets="PrepareForBuild;GetReferenceAssemblyPaths"
3234 Inputs="$(MSBuildAllProjects)"
3235 Outputs="$(AssemblyAttributesPath)"
3236 Condition="'@(AssemblyAttributes)' != '' and '$(GenerateAdditionalSources)' == 'true'">
3238 AssemblyAttributes="@(AssemblyAttributes)"
3239 OutputFile="$(AssemblyAttributesPath)"
3240 Language="$(Language)">
3242 <Output TaskParameter="OutputFile" ItemName="Compile"/>
3243 <Output TaskParameter="OutputFile" ItemName="FileWrites"/>
3244 </WriteCodeFragment>
3248 ============================================================
3251 Redefine this target in your project in order to run tasks just before Compile.
3252 ============================================================
3254 <Target Name="BeforeCompile"/>
3257 ============================================================
3260 Redefine this target in your project in order to run tasks just after Compile.
3261 ============================================================
3263 <Target Name="AfterCompile"/>
3266 ============================================================
3267 _TimeStampBeforeCompile
3269 If post-build events are set to fire "OnOutputUpdated", then take before
3270 and after timestamps so that we can compare them.
3271 ============================================================
3274 Name="_TimeStampBeforeCompile"
3275 Condition="'$(RunPostBuildEvent)'=='OnOutputUpdated' or ('$(RegisterForComInterop)'=='true' and '$(OutputType)'=='library')">
3278 <_AssemblyTimestampBeforeCompile>%(IntermediateAssembly.ModifiedTime)</_AssemblyTimestampBeforeCompile>
3284 ============================================================
3285 _GenerateCompileDependencyCache
3287 Generate a file used to track compiler dependencies between incremental build
3288 executions. This handles cases where items are added or removed from a glob (e.g.
3289 <Compile Include="**\*.cs" />) and can't otherwise be detected with timestamp
3290 comparisons. The file contains a hash of compiler inputs that are known to
3291 contribute to incremental build inconsistencies.
3292 ============================================================
3294 <Target Name="_GenerateCompileDependencyCache" DependsOnTargets="ResolveAssemblyReferences">
3296 <CustomAdditionalCompileInputs Include="$(IntermediateOutputPath)$(MSBuildProjectFile).CoreCompileInputs.cache" />
3297 <CoreCompileCache Include="@(Compile->'%(FullPath)')" />
3298 <CoreCompileCache Include="@(ReferencePath->'%(FullPath)')" />
3301 <Hash ItemsToHash="@(CoreCompileCache)">
3302 <Output TaskParameter="HashResult" PropertyName="CoreCompileDependencyHash" />
3305 <WriteLinesToFile Lines="$(CoreCompileDependencyHash)" File="$(IntermediateOutputPath)$(MSBuildProjectFile).CoreCompileInputs.cache" Overwrite="True" WriteOnlyWhenDifferent="True" />
3308 <FileWrites Include="$(IntermediateOutputPath)$(MSBuildProjectFile).CoreCompileInputs.cache" />
3313 ============================================================
3314 _TimeStampAfterCompile
3316 If post-build events are set to fire "OnOutputUpdated", then take before
3317 and after timestamps so that we can compare them.
3318 ============================================================
3321 Name="_TimeStampAfterCompile"
3322 Condition="'$(RunPostBuildEvent)'=='OnOutputUpdated' or ('$(RegisterForComInterop)'=='true' and '$(OutputType)'=='library')">
3325 <_AssemblyTimestampAfterCompile>%(IntermediateAssembly.ModifiedTime)</_AssemblyTimestampAfterCompile>
3331 ================================================================
3332 _ComputeNonExistentFileProperty
3334 There are certain situations in which we want to always run the CoreCompile target (and
3335 thus the Csc task), even if the timestamps of the outputs appear to be up-to-date on disk.
3336 If we're inside the IDE during design-time, then the Csc/Vbc/Vjc task is simply being used to
3337 initialize the host compiler, so we always want to run it. Also, if we're inside the IDE, and
3338 the host compiler is responsible for doing the compilation during an actual build, we want to let
3339 the host compiler determine whether the output is up-to-date, because there may be source files
3340 in the IDE's in-memory buffers that we don't know about.
3342 So, we always run the CoreCompile target if we're in the IDE, and either we're in design-time or
3343 we're delegating to the host compiler for the actual build.
3345 We compare against BuildOutOfProcess != true because we cannot assume that the build process will
3346 have set BuildOutOfProcess to true or false. Therefore the default behavior should be to do the
3347 legacy behavior seen before BuildingOutOfProcess was introduced if the property is not set.
3348 ================================================================
3351 Name="_ComputeNonExistentFileProperty"
3352 Condition="('$(BuildingInsideVisualStudio)' == 'true') and ('$(BuildingOutOfProcess)' != 'true') and (('$(BuildingProject)' == 'false') or ('$(UseHostCompilerIfAvailable)' == 'true'))">
3355 <NonExistentFile>__NonExistentSubDir__\__NonExistentFile__</NonExistentFile>
3364 ***********************************************************************************************
3365 ***********************************************************************************************
3366 GenerateSerializationAssemblies Section
3367 ***********************************************************************************************
3368 ***********************************************************************************************
3372 <_SGenDllName>$(TargetName).XmlSerializers.dll</_SGenDllName>
3373 <_SGenDllCreated>false</_SGenDllCreated>
3374 <_SGenGenerateSerializationAssembliesConfig>$(GenerateSerializationAssemblies)</_SGenGenerateSerializationAssembliesConfig>
3375 <_SGenGenerateSerializationAssembliesConfig Condition="'$(GenerateSerializationAssemblies)' == ''">Auto</_SGenGenerateSerializationAssembliesConfig>
3376 <_SGenGenerateSerializationAssembliesConfig Condition="'$(ConfigurationName)'=='Debug' and '$(_SGenGenerateSerializationAssembliesConfig)' == 'Auto'">Off</_SGenGenerateSerializationAssembliesConfig>
3377 <SGenUseProxyTypes Condition="'$(SGenUseProxyTypes)' == ''">true</SGenUseProxyTypes>
3378 <SGenUseKeep Condition="'$(SGenUseKeep)'==''">false</SGenUseKeep>
3379 <SGenShouldGenerateSerializer Condition="'$(SGenShouldGenerateSerializer)' == ''">true</SGenShouldGenerateSerializer>
3383 ============================================================
3384 GenerateSerializationAssemblies
3386 Run GenerateSerializationAssemblies on the assembly produced by this build.
3389 @(BuildAssemblyName) - The assembly generated by this build.
3390 @(BuildAssemblyPath) - The path where the assembly resides.
3391 @(ReferencePath) - The list of references used by this assembly.
3394 @(SerializationAssembly) - The path to the serialization assembly. Maybe we'll just append to an existing list.
3395 ============================================================
3398 Name="GenerateSerializationAssemblies"
3399 Condition="'$(_SGenGenerateSerializationAssembliesConfig)' == 'On' or ('@(WebReferenceUrl)'!='' and '$(_SGenGenerateSerializationAssembliesConfig)' == 'Auto')"
3400 DependsOnTargets="AssignTargetPaths;Compile;ResolveKeySource"
3401 Inputs="$(MSBuildAllProjects);@(IntermediateAssembly)"
3402 Outputs="$(IntermediateOutputPath)$(_SGenDllName)">
3405 <SGenMSBuildArchitecture Condition="'$(SGenMSBuildArchitecture)' == ''">$(PlatformTargetAsMSBuildArchitecture)</SGenMSBuildArchitecture>
3409 BuildAssemblyName="$(TargetFileName)"
3410 BuildAssemblyPath="$(IntermediateOutputPath)"
3411 References="@(ReferencePath)"
3412 ShouldGenerateSerializer="$(SGenShouldGenerateSerializer)"
3413 UseProxyTypes="$(SGenUseProxyTypes)"
3414 UseKeep="$(SGenUseKeep)"
3415 KeyContainer="$(KeyContainerName)"
3416 KeyFile="$(KeyOriginatorFile)"
3417 DelaySign="$(DelaySign)"
3418 ToolPath="$(SGenToolPath)"
3419 SdkToolsPath="$(TargetFrameworkSDKToolsDirectory)"
3420 EnvironmentVariables="$(SGenEnvironment)"
3421 MSBuildArchitecture="$(SGenMSBuildArchitecture)"
3422 SerializationAssembly="$(IntermediateOutputPath)$(_SGenDllName)"
3423 Platform="$(SGenPlatformTarget)"
3424 Types="$(SGenSerializationTypes)">
3426 <Output TaskParameter="SerializationAssembly" ItemName="SerializationAssembly"/>
3433 ***********************************************************************************************
3434 ***********************************************************************************************
3435 CreateSatelliteAssemblies Section
3436 ***********************************************************************************************
3437 ***********************************************************************************************
3441 ============================================================
3442 CreateSatelliteAssemblies
3444 Create one satellite assembly for every unique culture in the resources.
3445 ============================================================
3448 <CreateSatelliteAssembliesDependsOn>
3449 _GenerateSatelliteAssemblyInputs;
3450 ComputeIntermediateSatelliteAssemblies;
3451 GenerateSatelliteAssemblies
3452 </CreateSatelliteAssembliesDependsOn>
3455 Name="CreateSatelliteAssemblies"
3456 DependsOnTargets="$(CreateSatelliteAssembliesDependsOn)" />
3459 ============================================================
3460 _GenerateSatelliteAssemblyInputs
3462 Create the _SatelliteAssemblyResourceInputs list of inputs to the CreateSatelliteAssemblies target.
3463 ============================================================
3465 <Target Name="_GenerateSatelliteAssemblyInputs">
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."/>
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."/>
3471 <!-- _SatelliteAssemblyResourceInputs is the list of TLDA inputs that should trigger CreateSatelliteAssemblies, so listed as inputs to that target -->
3472 <_SatelliteAssemblyResourceInputs Include="@(EmbeddedResource->'%(OutputResource)')" Condition="'%(EmbeddedResource.WithCulture)' == 'true' and '%(EmbeddedResource.Type)' == 'Resx'" />
3473 <_SatelliteAssemblyResourceInputs Include="@(EmbeddedResource)" Condition="'%(EmbeddedResource.WithCulture)' == 'true' and '%(EmbeddedResource.Type)' == 'Non-Resx'" />
3475 <!-- CONSUMED FOR COMPATIBILITY REASONS ONLY. EMIT EMBEDDEDRESOURCE INSTEAD -->
3476 <_SatelliteAssemblyResourceInputs Include="@(ManifestResourceWithCulture)" Condition="'%(ManifestResourceWithCulture.EmittedForCompatibilityOnly)'==''">
3478 <WithCulture>true</WithCulture>
3479 </_SatelliteAssemblyResourceInputs>
3480 <_SatelliteAssemblyResourceInputs Include="@(ManifestNonResxWithCultureOnDisk)" Condition="'%(ManifestNonResxWithCultureOnDisk.EmittedForCompatibilityOnly)'==''">
3481 <Type>Non-Resx</Type>
3482 <WithCulture>true</WithCulture>
3483 </_SatelliteAssemblyResourceInputs>
3489 ============================================================
3490 GenerateSatelliteAssemblies
3492 Actually run al.exe to create the satellite assemblies.
3493 ============================================================
3495 <Target Name="GenerateSatelliteAssemblies"
3496 Inputs="$(MSBuildAllProjects);@(_SatelliteAssemblyResourceInputs);$(IntermediateOutputPath)$(TargetName)$(TargetExt)"
3497 Outputs="$(IntermediateOutputPath)%(Culture)\$(TargetName).resources.dll"
3498 Condition="'@(_SatelliteAssemblyResourceInputs)' != '' and '$(MSBuildRuntimeType)' != 'Core'">
3501 Directories="@(EmbeddedResource->'$(IntermediateOutputPath)%(Culture)')" />
3503 <AL AlgorithmId="$(Satellite_AlgorithmId)"
3504 BaseAddress="$(Satellite_BaseAddress)"
3505 CompanyName="$(Satellite_CompanyName)"
3506 Configuration="$(Satellite_Configuration)"
3507 Copyright="$(Satellite_Copyright)"
3508 Culture="%(Culture)"
3509 DelaySign="$(DelaySign)"
3510 Description="$(Satellite_Description)"
3511 EmbedResources="@(_SatelliteAssemblyResourceInputs)"
3512 EnvironmentVariables="$(AlEnvironment)"
3513 EvidenceFile="$(Satellite_EvidenceFile)"
3514 FileVersion="$(Satellite_FileVersion)"
3515 Flags="$(Satellite_Flags)"
3516 GenerateFullPaths="$(Satellite_GenerateFullPaths)"
3517 KeyContainer="$(KeyContainerName)"
3518 KeyFile="$(KeyOriginatorFile)"
3519 LinkResources="@(Satellite_LinkResource)"
3520 MainEntryPoint="$(Satellite_MainEntryPoint)"
3521 OutputAssembly="$(IntermediateOutputPath)%(Culture)\$(TargetName).resources.dll"
3522 Platform="$(PlatformTarget)"
3523 ProductName="$(Satellite_ProductName)"
3524 ProductVersion="$(Satellite_ProductVersion)"
3525 ResponseFiles="@(AlResponseFile)"
3526 SourceModules="@(Satellite_SourceModule)"
3527 TargetType="$(Satellite_TargetType)"
3528 TemplateFile="$(IntermediateOutputPath)$(TargetName)$(TargetExt)"
3529 Title="$(Satellite_Title)"
3530 ToolPath="$(AlToolPath)"
3531 ToolExe ="$(AlToolExe)"
3532 SdkToolsPath="$(TargetFrameworkSDKToolsDirectory)"
3533 Trademark="$(Satellite_Trademark)"
3534 Version="$(Satellite_Version)"
3535 Win32Icon="$(Satellite_Win32Icon)"
3536 Win32Resource="$(Satellite_Win32Resource)">
3538 <Output TaskParameter="OutputAssembly" ItemName="FileWrites"/>
3544 ============================================================
3545 ComputeIntermediateSatelliteAssemblies
3547 Compute the paths to the intermediate satellite assemblies,
3548 with culture attributes so we can copy them to the right place.
3549 ============================================================
3552 <ComputeIntermediateSatelliteAssembliesDependsOn>
3553 CreateManifestResourceNames
3554 </ComputeIntermediateSatelliteAssembliesDependsOn>
3557 Name="ComputeIntermediateSatelliteAssemblies"
3558 Condition="@(EmbeddedResource->'%(WithCulture)') != ''"
3559 DependsOnTargets="$(ComputeIntermediateSatelliteAssembliesDependsOn)">
3562 <IntermediateSatelliteAssembliesWithTargetPath Include="$(IntermediateOutputPath)%(EmbeddedResource.Culture)\$(TargetName).resources.dll"
3563 Condition="'%(EmbeddedResource.Culture)' != ''">
3564 <Culture>%(EmbeddedResource.Culture)</Culture>
3565 <TargetPath>%(EmbeddedResource.Culture)\$(TargetName).resources.dll</TargetPath>
3566 </IntermediateSatelliteAssembliesWithTargetPath>
3571 ***********************************************************************************************
3572 ***********************************************************************************************
3573 SetWin32ManifestProperties Section
3574 ***********************************************************************************************
3575 ***********************************************************************************************
3579 <EmbeddedWin32Manifest>$(Win32Manifest)</EmbeddedWin32Manifest>
3583 ============================================================
3584 SetWin32ManifestProperties
3586 Set Win32Manifest and EmbeddedManifest properties to be used later in the build.
3587 ============================================================
3590 Name="SetWin32ManifestProperties"
3591 Condition="'$(Win32Manifest)'==''"
3592 DependsOnTargets="ResolveComReferences;ResolveNativeReferences;_SetExternalWin32ManifestProperties;_SetEmbeddedWin32ManifestProperties" />
3595 Name="_SetExternalWin32ManifestProperties"
3596 Condition="'$(GenerateClickOnceManifests)'=='true' or '@(NativeReference)'!='' or '@(ResolvedIsolatedComModules)'!=''" >
3599 <!-- set _DeploymentBaseManifest property to the value of $(ApplicationManifest) if the property is set,
3600 but use _DeploymentBaseManifestWithTargetPath item-group if the property is not set to support backwards
3601 compat with earlier MSBuild versions when manifest files were determined by the item-group. If the newer
3602 property is set though, prefer that one be used to specify the manifest. -->
3603 <_DeploymentBaseManifest>$(ApplicationManifest)</_DeploymentBaseManifest>
3604 <_DeploymentBaseManifest Condition="'$(_DeploymentBaseManifest)'==''">@(_DeploymentBaseManifestWithTargetPath)</_DeploymentBaseManifest>
3606 <!-- when using external manifests, always set the NoWin32Manifest property to
3607 true if there is no value set in the incoming project file so the
3608 compilers that support manifest embedding know not to add
3609 a manifest to their built assemblies -->
3610 <NoWin32Manifest Condition="'$(NoWin32Manifest)'==''">true</NoWin32Manifest>
3616 Name="_SetEmbeddedWin32ManifestProperties"
3617 Condition="'$(GenerateClickOnceManifests)'!='true' and '@(NativeReference)'=='' and '@(ResolvedIsolatedComModules)'==''" >
3620 <EmbeddedWin32Manifest>$(ApplicationManifest)</EmbeddedWin32Manifest>
3621 <Win32Manifest>$(ApplicationManifest)</Win32Manifest>
3624 <GetFrameworkPath Condition="'$(ApplicationManifest)'=='' and '$(NoWin32Manifest)'!='true'">
3625 <Output TaskParameter="FrameworkVersion40Path" PropertyName="_FrameworkVersion40Path" />
3629 <EmbeddedWin32Manifest Condition="'$(ApplicationManifest)'=='' and '$(NoWin32Manifest)'!='true' and Exists('$(_FrameworkVersion40Path)\default.win32manifest')">$(_FrameworkVersion40Path)\default.win32manifest</EmbeddedWin32Manifest>
3638 ***********************************************************************************************
3639 ***********************************************************************************************
3640 GenerateManifests Section
3641 ***********************************************************************************************
3642 ***********************************************************************************************
3646 ============================================================
3649 Generates ClickOnce application and deployment manifests or a native manifest.
3650 ============================================================
3653 <GenerateManifestsDependsOn>
3654 SetWin32ManifestProperties;
3655 GenerateApplicationManifest;
3656 GenerateDeploymentManifest
3657 </GenerateManifestsDependsOn>
3661 ============================================================
3662 _GenerateResolvedDeploymentManifestEntryPoint
3664 Use the ResolveManifestFiles to generate the GenerateResolvedDeploymentManifestEntryPoint
3666 ============================================================
3669 Name="_GenerateResolvedDeploymentManifestEntryPoint">
3671 <_DeploymentPublishFileOfTypeManifestEntryPoint Include="@(PublishFile)" Condition="'%(FileType)'=='ManifestEntryPoint'"/>
3674 <ResolveManifestFiles
3675 TargetFrameworkVersion="$(TargetFrameworkVersion)"
3676 SigningManifests="$(SignManifests)"
3677 DeploymentManifestEntryPoint="@(ApplicationManifest)"
3678 PublishFiles="@(_DeploymentPublishFileOfTypeManifestEntryPoint)">
3680 <Output TaskParameter="OutputDeploymentManifestEntryPoint" ItemName="_DeploymentResolvedDeploymentManifestEntryPoint"/>
3682 </ResolveManifestFiles>
3686 Name="GenerateManifests"
3687 Condition="'$(GenerateClickOnceManifests)'=='true' or '@(NativeReference)'!='' or '@(ResolvedIsolatedComModules)'!='' or '$(GenerateAppxManifest)' == 'true'"
3688 DependsOnTargets="$(GenerateManifestsDependsOn)"/>
3691 ============================================================
3692 GenerateApplicationManifest
3694 Generates a ClickOnce or native application manifest.
3695 An application manifest specifies declarative application identity, dependency and security information.
3698 $(_DeploymentBaseManifest) - The base app.manifest from project.
3699 @(ResolvedIsolatedComModules) - The list of COM references to be isolated as reg-free COM dependencies for native assembly loader.
3700 @(_DeploymentManifestFiles) - The list of loose files (content, pdb, xml, etc.) for ClickOnce.
3701 @(_DeploymentManifestDependencies) - The list of application dependencies (typically this is the set of assembly dependencies in bin\) for ClickOnce.
3702 @(AppConfigWithTargetPath) - App config file, if present.
3703 $(_DeploymentManifestType) - Type of manifest to be generated, either "Native" or "ClickOnce".
3706 @(ApplicationManifest) - Generated native or ClickOnce application manifest, i.e. WindowsApplication1.exe.manifest
3707 ============================================================
3710 Name="GenerateApplicationManifest"
3712 _DeploymentComputeNativeManifestInfo;
3713 _DeploymentComputeClickOnceManifestInfo;
3714 ResolveComReferences;
3715 ResolveNativeReferences;
3716 _GenerateResolvedDeploymentManifestEntryPoint"
3718 $(MSBuildAllProjects);
3719 @(AppConfigWithTargetPath);
3720 $(_DeploymentBaseManifest);
3721 @(ResolvedIsolatedComModules);
3722 @(_DeploymentManifestDependencies);
3723 @(_DeploymentResolvedManifestEntryPoint);
3724 @(_DeploymentManifestFiles)"
3725 Outputs="@(ApplicationManifest)">
3727 <RequiresFramework35SP1Assembly
3728 ReferencedAssemblies="@(Reference)"
3729 ErrorReportUrl="$(_DeploymentFormattedErrorReportUrl)"
3730 TargetFrameworkVersion="$(TargetFrameworkVersion)"
3731 CreateDesktopShortcut="$(CreateDesktopShortcut)"
3732 SigningManifests="$(SignManifests)"
3733 Assemblies="@(_DeploymentManifestDependencies)"
3734 DeploymentManifestEntryPoint="@(_DeploymentResolvedDeploymentManifestEntryPoint)"
3735 EntryPoint="@(_DeploymentResolvedManifestEntryPoint)"
3736 Files="@(_DeploymentManifestFiles)"
3737 SuiteName="$(SuiteName)" >
3739 <Output TaskParameter="RequiresMinimumFramework35SP1" PropertyName="_DeploymentRequiresMinimumFramework35SP1" />
3740 </RequiresFramework35SP1Assembly>
3742 <GenerateApplicationManifest
3743 AssemblyName="$(_DeploymentApplicationManifestIdentity)"
3744 AssemblyVersion="$(_DeploymentManifestVersion)"
3745 ConfigFile="@(AppConfigWithTargetPath)"
3746 ClrVersion="$(ClrVersion)"
3747 Dependencies="@(_DeploymentManifestDependencies)"
3748 Description="$(Description)"
3749 EntryPoint="@(_DeploymentResolvedManifestEntryPoint)"
3750 ErrorReportUrl="$(_DeploymentFormattedErrorReportUrl)"
3751 FileAssociations="@(FileAssociation)"
3752 Files="@(_DeploymentManifestFiles)"
3753 HostInBrowser="$(HostInBrowser)"
3754 IconFile="@(_DeploymentManifestIconFile)"
3755 InputManifest="$(_DeploymentBaseManifest)"
3756 IsolatedComReferences="@(ResolvedIsolatedComModules)"
3757 ManifestType="$(_DeploymentManifestType)"
3758 MaxTargetPath="$(MaxTargetPath)"
3759 OutputManifest="@(ApplicationManifest)"
3760 OSVersion="$(OSVersion)"
3761 Platform="$(PlatformTarget)"
3762 Product="$(ProductName)"
3763 Publisher="$(PublisherName)"
3764 RequiresMinimumFramework35SP1="$(_DeploymentRequiresMinimumFramework35SP1)"
3765 SuiteName="$(SuiteName)"
3766 SupportUrl="$(_DeploymentFormattedSupportUrl)"
3767 TargetCulture="$(TargetCulture)"
3768 TargetFrameworkSubset="$(TargetFrameworkSubset)"
3769 TargetFrameworkProfile="$(TargetFrameworkProfile)"
3770 TargetFrameworkVersion="$(TargetFrameworkVersion)"
3771 TrustInfoFile="@(_DeploymentIntermediateTrustInfoFile)"
3772 UseApplicationTrust="$(UseApplicationTrust)">
3774 <Output TaskParameter="OutputManifest" ItemName="FileWrites"/>
3776 </GenerateApplicationManifest>
3779 <_DeploymentCopyApplicationManifest>true</_DeploymentCopyApplicationManifest>
3785 ============================================================
3786 _DeploymentComputeNativeManifestInfo
3788 Compute info for native manifest generation
3789 ============================================================
3792 Name="_DeploymentComputeNativeManifestInfo"
3793 Condition="'$(GenerateClickOnceManifests)'!='true'">
3795 <!-- Create list of items for manifest generation -->
3796 <ResolveManifestFiles NativeAssemblies="@(NativeReferenceFile);@(_DeploymentNativePrerequisite)">
3797 <Output TaskParameter="OutputAssemblies" ItemName="_DeploymentManifestDependencies"/>
3798 </ResolveManifestFiles>
3801 <_DeploymentManifestType>Native</_DeploymentManifestType>
3804 <!-- Obtain manifest version from the built assembly -->
3805 <GetAssemblyIdentity AssemblyFiles="@(IntermediateAssembly)">
3806 <Output TaskParameter="Assemblies" ItemName="_IntermediateAssemblyIdentity"/>
3807 </GetAssemblyIdentity>
3810 <_DeploymentManifestVersion>@(_IntermediateAssemblyIdentity->'%(Version)')</_DeploymentManifestVersion>
3816 ============================================================
3817 _DeploymentComputeClickOnceManifestInfo
3819 Compute info for ClickOnce manifest generation
3820 ============================================================
3823 Name="_DeploymentComputeClickOnceManifestInfo"
3824 Condition="'$(GenerateClickOnceManifests)'=='true'"
3827 _DeploymentGenerateTrustInfo">
3829 <!-- Grab just the serialization assemblies for a referenced assembly. There may also be a symbols file in ReferenceRelatedPaths -->
3831 <_SGenDllsRelatedToCurrentDll Include="@(_ReferenceSerializationAssemblyPaths->'%(FullPath)')" Condition="'%(Extension)' == '.dll'"/>
3832 <_SGenDllsRelatedToCurrentDll Include="@(SerializationAssembly->'%(FullPath)')" Condition="'%(Extension)' == '.dll'"/>
3835 <!-- Flag primary dependencies-certain warnings emitted during application manifest generation apply only to them. -->
3837 <_DeploymentReferencePaths Include="@(ReferencePath)">
3838 <IsPrimary>true</IsPrimary>
3839 </_DeploymentReferencePaths>
3842 <!-- Copy the application executable from Obj folder to app.publish folder.
3843 This is being done to avoid Windows Forms designer memory issues that can arise while operating directly on files located in Obj directory. -->
3845 SourceFiles="@(_DeploymentManifestEntryPoint)"
3846 DestinationFolder="$(PublishDir)">
3848 <Output TaskParameter="DestinationFiles" ItemName="_DeploymentClickOnceApplicationExecutable" />
3851 <!-- Sign the application executable located in app.publish folder. Signing this file is done to comply with SmartScreen. -->
3853 CertificateThumbprint="$(_DeploymentResolvedManifestCertificateThumbprint)"
3854 TimestampUrl="$(ManifestTimestampUrl)"
3855 SigningTarget="@(_DeploymentClickOnceApplicationExecutable)"
3856 Condition="'$(_DeploymentResolvedManifestCertificateThumbprint)'!='' and '$(_DeploymentSignClickOnceManifests)'=='true' and '$(TargetExt)' == '.exe'"
3859 <!-- Create list of items for manifest generation -->
3860 <ResolveManifestFiles
3861 TargetFrameworkVersion="$(TargetFrameworkVersion)"
3862 SigningManifests="$(SignManifests)"
3863 EntryPoint="@(_DeploymentClickOnceApplicationExecutable)"
3864 ExtraFiles="@(_DebugSymbolsIntermediatePath);$(IntermediateOutputPath)$(TargetName).xml;@(_ReferenceRelatedPaths)"
3865 Files="@(ContentWithTargetPath);@(_DeploymentManifestIconFile);@(AppConfigWithTargetPath)"
3866 ManagedAssemblies="@(_DeploymentReferencePaths);@(ReferenceDependencyPaths);@(_SGenDllsRelatedToCurrentDll);@(SerializationAssembly)"
3867 NativeAssemblies="@(NativeReferenceFile);@(_DeploymentNativePrerequisite)"
3868 PublishFiles="@(PublishFile)"
3869 SatelliteAssemblies="@(IntermediateSatelliteAssembliesWithTargetPath);@(ReferenceSatellitePaths)"
3870 TargetCulture="$(TargetCulture)">
3872 <Output TaskParameter="OutputAssemblies" ItemName="_DeploymentManifestDependencies"/>
3873 <Output TaskParameter="OutputFiles" ItemName="_DeploymentManifestFiles"/>
3874 <Output TaskParameter="OutputEntryPoint" ItemName="_DeploymentResolvedManifestEntryPoint"/>
3876 </ResolveManifestFiles>
3879 <_DeploymentManifestType>ClickOnce</_DeploymentManifestType>
3882 <!-- Obtain manifest version from ApplicationVersion and ApplicationRevision properties -->
3883 <FormatVersion Version="$(ApplicationVersion)" Revision="$(ApplicationRevision)">
3884 <Output TaskParameter="OutputVersion" PropertyName="_DeploymentManifestVersion"/>
3887 <FormatUrl InputUrl="$(_DeploymentUrl)">
3888 <Output TaskParameter="OutputUrl" PropertyName="_DeploymentFormattedDeploymentUrl"/>
3891 <FormatUrl InputUrl="$(SupportUrl)">
3892 <Output TaskParameter="OutputUrl" PropertyName="_DeploymentFormattedSupportUrl"/>
3895 <FormatUrl InputUrl="$(ErrorReportUrl)">
3896 <Output TaskParameter="OutputUrl" PropertyName="_DeploymentFormattedErrorReportUrl"/>
3902 ============================================================
3903 _DeploymentGenerateTrustInfo
3905 Generates the application permission set for inclusion in the generated ClickOnce application manifest.
3906 ============================================================
3909 Name="_DeploymentGenerateTrustInfo"
3910 Condition="'$(TargetZone)'!=''"
3912 $(MSBuildAllProjects);
3913 $(_DeploymentBaseManifest);
3915 Outputs="@(_DeploymentIntermediateTrustInfoFile)">
3918 BaseManifest="$(_DeploymentBaseManifest)"
3919 ApplicationDependencies="@(ReferencePath);@(ReferenceDependencyPaths)"
3920 ExcludedPermissions="$(ExcludedPermissions)"
3921 TargetFrameworkMoniker="$(TargetFrameworkMoniker)"
3922 TargetZone="$(TargetZone)"
3923 TrustInfoFile="@(_DeploymentIntermediateTrustInfoFile)">
3925 <Output TaskParameter="TrustInfoFile" ItemName="FileWrites"/>
3927 </GenerateTrustInfo>
3932 ============================================================
3933 GenerateDeploymentManifest
3935 Generates a ClickOnce deployment manifest.
3936 An deployment manifest specifies declarative application identity and application update information.
3937 ============================================================
3940 Name="GenerateDeploymentManifest"
3941 DependsOnTargets="GenerateApplicationManifest"
3943 $(MSBuildAllProjects);
3944 @(ApplicationManifest)
3946 Outputs="@(DeployManifest)">
3948 <GenerateDeploymentManifest
3949 AssemblyName="$(_DeploymentDeployManifestIdentity)"
3950 AssemblyVersion="$(_DeploymentManifestVersion)"
3951 CreateDesktopShortcut="$(CreateDesktopShortcut)"
3952 DeploymentUrl="$(_DeploymentFormattedDeploymentUrl)"
3953 Description="$(Description)"
3954 DisallowUrlActivation="$(DisallowUrlActivation)"
3955 EntryPoint="@(_DeploymentResolvedDeploymentManifestEntryPoint)"
3956 ErrorReportUrl="$(_DeploymentFormattedErrorReportUrl)"
3957 Install="$(Install)"
3958 MapFileExtensions="$(MapFileExtensions)"
3959 MaxTargetPath="$(MaxTargetPath)"
3960 MinimumRequiredVersion="$(_DeploymentBuiltMinimumRequiredVersion)"
3961 OutputManifest="@(DeployManifest)"
3962 Platform="$(PlatformTarget)"
3963 Product="$(ProductName)"
3964 Publisher="$(PublisherName)"
3965 SuiteName="$(SuiteName)"
3966 SupportUrl="$(_DeploymentFormattedSupportUrl)"
3967 TargetCulture="$(TargetCulture)"
3968 TargetFrameworkVersion="$(TargetFrameworkVersion)"
3969 TargetFrameworkMoniker="$(TargetFrameworkMoniker)"
3970 TrustUrlParameters="$(TrustUrlParameters)"
3971 UpdateEnabled="$(UpdateEnabled)"
3972 UpdateInterval="$(_DeploymentBuiltUpdateInterval)"
3973 UpdateMode="$(UpdateMode)"
3974 UpdateUnit="$(_DeploymentBuiltUpdateIntervalUnits)"
3975 Condition="'$(GenerateClickOnceManifests)'=='true'">
3977 <Output TaskParameter="OutputManifest" ItemName="FileWrites"/>
3979 </GenerateDeploymentManifest>
3987 ***********************************************************************************************
3988 ***********************************************************************************************
3989 PrepareForRun Section
3990 ***********************************************************************************************
3991 ***********************************************************************************************
3995 <SkipCopyUnchangedFiles Condition="'$(SkipCopyUnchangedFiles)' == ''">true</SkipCopyUnchangedFiles>
3996 <UseCommonOutputDirectory Condition="'$(UseCommonOutputDirectory)' == ''">false</UseCommonOutputDirectory>
4000 ============================================================
4003 Copy the build outputs to the final directory if they have changed.
4004 ============================================================
4007 <PrepareForRunDependsOn>
4008 CopyFilesToOutputDirectory
4009 </PrepareForRunDependsOn>
4012 Name="PrepareForRun"
4013 DependsOnTargets="$(PrepareForRunDependsOn)"/>
4016 ============================================================
4017 CopyFilesToOutputDirectory
4019 Copy all build outputs, satellites and other necessary files to the final directory.
4020 ============================================================
4023 <!-- By default we're not using Hard or Symbolic Links to copy to the output directory, and never when building in VS -->
4024 <CreateHardLinksForCopyAdditionalFilesIfPossible Condition="'$(BuildingInsideVisualStudio)' == 'true' or '$(CreateHardLinksForCopyAdditionalFilesIfPossible)' == ''">false</CreateHardLinksForCopyAdditionalFilesIfPossible>
4025 <CreateSymbolicLinksForCopyAdditionalFilesIfPossible Condition="'$(BuildingInsideVisualStudio)' == 'true' or '$(CreateSymbolicLinksForCopyAdditionalFilesIfPossible)' == ''">false</CreateSymbolicLinksForCopyAdditionalFilesIfPossible>
4029 Name="CopyFilesToOutputDirectory"
4031 ComputeIntermediateSatelliteAssemblies;
4032 _CopyFilesMarkedCopyLocal;
4033 _CopySourceItemsToOutputDirectory;
4036 _CheckForCompileOutputs;
4037 _SGenCheckForOutputs">
4040 <!-- By default we're not using Hard Links to copy to the output directory, and never when building in VS -->
4041 <CreateHardLinksForCopyFilesToOutputDirectoryIfPossible Condition="'$(BuildingInsideVisualStudio)' == 'true' or '$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)' == ''">false</CreateHardLinksForCopyFilesToOutputDirectoryIfPossible>
4042 <CreateSymbolicLinksForCopyFilesToOutputDirectoryIfPossible Condition="'$(BuildingInsideVisualStudio)' == 'true' or '$(CreateSymbolicLinksForCopyFilesToOutputDirectoryIfPossible)' == ''">false</CreateSymbolicLinksForCopyFilesToOutputDirectoryIfPossible>
4046 <CopyBuildOutputToOutputDirectory Condition="'$(CopyBuildOutputToOutputDirectory)'==''">true</CopyBuildOutputToOutputDirectory>
4047 <CopyOutputSymbolsToOutputDirectory Condition="'$(CopyOutputSymbolsToOutputDirectory)'==''">true</CopyOutputSymbolsToOutputDirectory>
4050 <!-- Copy the build product (.dll or .exe). -->
4052 SourceFiles="@(IntermediateAssembly)"
4053 DestinationFolder="$(OutDir)"
4054 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
4055 OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
4056 Retries="$(CopyRetryCount)"
4057 RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
4058 UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)"
4059 UseSymboliclinksIfPossible="$(CreateSymbolicLinksForCopyFilesToOutputDirectoryIfPossible)"
4060 Condition="'$(CopyBuildOutputToOutputDirectory)' == 'true' and '$(SkipCopyBuildProduct)' != 'true'"
4063 <Output TaskParameter="DestinationFiles" ItemName="MainAssembly"/>
4064 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
4068 <!-- Copy the reference assembly build product (.dll or .exe). -->
4070 SourcePath="@(IntermediateRefAssembly)"
4071 DestinationPath="$(TargetRefPath)"
4072 Condition="'$(ProduceReferenceAssembly)' == 'true' and '$(CopyBuildOutputToOutputDirectory)' == 'true' and '$(SkipCopyBuildProduct)' != 'true'"
4075 <Output TaskParameter="DestinationPath" ItemName="ReferenceAssembly"/>
4076 <Output TaskParameter="DestinationPath" ItemName="FileWrites"/>
4080 <Message Importance="High" Text="$(MSBuildProjectName) -> @(MainAssembly->'%(FullPath)')" Condition="'$(CopyBuildOutputToOutputDirectory)' == 'true' and '$(SkipCopyBuildProduct)'!='true'" />
4082 <!-- Copy the additional modules. -->
4084 SourceFiles="@(AddModules)"
4085 DestinationFolder="$(OutDir)"
4086 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
4087 OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
4088 Retries="$(CopyRetryCount)"
4089 RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
4090 UseHardlinksIfPossible="$(CreateHardLinksForCopyAdditionalFilesIfPossible)"
4091 UseSymboliclinksIfPossible="$(CreateSymbolicLinksForCopyAdditionalFilesIfPossible)"
4092 Condition="'@(AddModules)' != ''"
4095 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
4099 <!-- Copy the serialization assembly if it exists. -->
4101 SourceFiles="$(IntermediateOutputPath)$(_SGenDllName)"
4102 DestinationFiles="$(OutDir)$(_SGenDllName)"
4103 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
4104 OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
4105 Retries="$(CopyRetryCount)"
4106 RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
4107 UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)"
4108 UseSymboliclinksIfPossible="$(CreateSymbolicLinksForCopyFilesToOutputDirectoryIfPossible)"
4109 Condition="'$(_SGenDllCreated)'=='true'">
4111 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
4115 <!-- Copy the debug information file (.pdb), if any -->
4117 SourceFiles="@(_DebugSymbolsIntermediatePath)"
4118 DestinationFiles="@(_DebugSymbolsOutputPath)"
4119 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
4120 OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
4121 Retries="$(CopyRetryCount)"
4122 RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
4123 UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)"
4124 UseSymboliclinksIfPossible="$(CreateSymbolicLinksForCopyFilesToOutputDirectoryIfPossible)"
4125 Condition="'$(_DebugSymbolsProduced)'=='true' and '$(SkipCopyingSymbolsToOutputDirectory)' != 'true' and '$(CopyOutputSymbolsToOutputDirectory)'=='true'">
4127 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
4131 <!-- Copy the resulting XML documentation file, if any. -->
4133 SourceFiles="@(DocFileItem)"
4134 DestinationFiles="@(FinalDocFile)"
4135 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
4136 OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
4137 Retries="$(CopyRetryCount)"
4138 RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
4139 UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)"
4140 UseSymboliclinksIfPossible="$(CreateSymbolicLinksForCopyFilesToOutputDirectoryIfPossible)"
4141 Condition="'$(_DocumentationFileProduced)'=='true'">
4143 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
4147 <!-- Copy satellite assemblies. -->
4149 SourceFiles="@(IntermediateSatelliteAssembliesWithTargetPath)"
4150 DestinationFiles="@(IntermediateSatelliteAssembliesWithTargetPath->'$(OutDir)%(Culture)\$(TargetName).resources.dll')"
4151 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
4152 OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
4153 Retries="$(CopyRetryCount)"
4154 RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
4155 UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)"
4156 UseSymboliclinksIfPossible="$(CreateSymbolicLinksForCopyFilesToOutputDirectoryIfPossible)"
4157 Condition="'@(IntermediateSatelliteAssembliesWithTargetPath)' != ''"
4160 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
4165 Copy COM reference wrappers, isolated COM references, COM references included by
4166 native (manifest) references, native (manifest) reference files themselves.
4169 SourceFiles="@(ReferenceComWrappersToCopyLocal); @(ResolvedIsolatedComModules); @(_DeploymentLooseManifestFile); @(NativeReferenceFile)"
4170 DestinationFolder="$(OutDir)"
4171 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
4172 OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
4173 Retries="$(CopyRetryCount)"
4174 RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
4175 UseHardlinksIfPossible="$(CreateHardLinksForCopyAdditionalFilesIfPossible)"
4176 UseSymboliclinksIfPossible="$(CreateSymbolicLinksForCopyAdditionalFilesIfPossible)"
4177 Condition="'@(ReferenceComWrappersToCopyLocal)' != '' or '@(ResolvedIsolatedComModules)' != '' or '@(_DeploymentLooseManifestFile)' != '' or '@(NativeReferenceFile)' != '' "
4180 <Output TaskParameter="DestinationFiles" ItemName="FileWritesShareable"/>
4184 <!-- Copy the build product of WinMDExp. -->
4186 SourceFiles="@(WinMDExpArtifacts)"
4187 DestinationFolder="$(OutDir)"
4188 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
4189 OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
4190 Retries="$(CopyRetryCount)"
4191 RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
4192 UseHardlinksIfPossible="$(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)"
4193 UseSymboliclinksIfPossible="$(CreateSymbolicLinksForCopyFilesToOutputDirectoryIfPossible)"
4194 Condition="'$(SkipCopyWinMDArtifact)' != 'true' and '@(WinMDExpArtifacts)' != ''"
4196 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
4197 <Output TaskParameter="DestinationFiles" ItemName="FinalWinmdExpArtifacts" />
4200 <Message Importance="High" Text="$(MSBuildProjectName) -> $([System.IO.Path]::GetFullPath('$(_WindowsMetadataOutputPath)'))" Condition="'$(SkipCopyWinMDArtifact)' != 'true' and '$(_WindowsMetadataOutputPath)' != ''" />
4205 ============================================================
4206 _CopyFilesMarkedCopyLocal
4208 Copy references that are marked as "CopyLocal" and their dependencies, including .pdbs, .xmls and satellites.
4209 ============================================================
4212 Name="_CopyFilesMarkedCopyLocal"
4213 Condition="'@(ReferenceCopyLocalPaths)' != ''"
4217 <!-- By default we're not using Hard Links to copy to the output directory, and never when building in VS -->
4218 <CreateHardLinksForCopyLocalIfPossible Condition="'$(BuildingInsideVisualStudio)' == 'true' or '$(CreateHardLinksForCopyLocalIfPossible)' == ''">false</CreateHardLinksForCopyLocalIfPossible>
4219 <CreateSymbolicLinksForCopyLocalIfPossible Condition="'$(BuildingInsideVisualStudio)' == 'true' or '$(CreateSymbolicLinksForCopyLocalIfPossible)' == ''">false</CreateSymbolicLinksForCopyLocalIfPossible>
4223 SourceFiles="@(ReferenceCopyLocalPaths)"
4224 DestinationFiles="@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')"
4225 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
4226 OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
4227 Retries="$(CopyRetryCount)"
4228 RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
4229 UseHardlinksIfPossible="$(CreateHardLinksForCopyLocalIfPossible)"
4230 UseSymboliclinksIfPossible="$(CreateSymbolicLinksForCopyLocalIfPossible)"
4231 Condition="'$(UseCommonOutputDirectory)' != 'true'"
4234 <Output TaskParameter="DestinationFiles" ItemName="FileWritesShareable"/>
4235 <Output TaskParameter="CopiedFiles" ItemName="ReferencesCopiedInThisBuild"/>
4239 <!-- If this project produces reference assemblies *and* copied (possibly transitive)
4240 references on this build, subsequent builds of projects that depend on it must
4241 not be considered up to date, so touch this marker file that is considered an
4242 input to projects that reference this one. -->
4243 <Touch Files="@(CopyUpToDateMarker)"
4245 Condition="'@(ReferencesCopiedInThisBuild)' != ''" />
4250 ============================================================
4251 _CopySourceItemsToOutputDirectory
4252 ============================================================
4255 Name="_CopySourceItemsToOutputDirectory"
4257 GetCopyToOutputDirectoryItems;
4258 _CopyOutOfDateSourceItemsToOutputDirectory;
4259 _CopyOutOfDateSourceItemsToOutputDirectoryAlways"/>
4263 ============================================================
4264 GetCopyToOutputDirectoryItems
4266 Get all project items that may need to be transferred to the output directory.
4267 This includes baggage items from transitively referenced projects. It would appear
4268 that this target computes full transitive closure of content items for all referenced
4269 projects; however that is not the case. It only collects the content items from its
4270 immediate children and not children of children. The reason this happens is that
4271 the ProjectReferenceWithConfiguration list that is consumed by _SplitProjectReferencesByFileExistence
4272 is only populated in the current project and is empty in the children. The empty list
4273 causes _MSBuildProjectReferenceExistent to be empty and terminates the recursion.
4274 ============================================================
4277 <GetCopyToOutputDirectoryItemsDependsOn>
4279 _SplitProjectReferencesByFileExistence;
4280 _GetProjectReferenceTargetFrameworkProperties
4281 </GetCopyToOutputDirectoryItemsDependsOn>
4284 Name="GetCopyToOutputDirectoryItems"
4285 Returns="@(AllItemsFullPathWithTargetPath)"
4286 KeepDuplicateOutputs=" '$(MSBuildDisableGetCopyToOutputDirectoryItemsOptimization)' == '' "
4287 DependsOnTargets="$(GetCopyToOutputDirectoryItemsDependsOn)">
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
4291 cases, we can immediately discard the unwanted metadata, reducing memory usage, particularly in very large and interconnected systems of projects.
4292 However, if some client does require the original functionality, it is sufficient to set MSBuildDisableGetCopyToOutputDirectoryItemsOptimization to
4293 a non-empty value and the original behavior will be restored. -->
4294 <PropertyGroup Condition=" '$(MSBuildDisableGetCopyToOutputDirectoryItemsOptimization)' == '' ">
4295 <_GCTODIKeepDuplicates>false</_GCTODIKeepDuplicates>
4296 <_GCTODIKeepMetadata>CopyToOutputDirectory;TargetPath</_GCTODIKeepMetadata>
4299 <!-- Get items from child projects first. -->
4301 Projects="@(_MSBuildProjectReferenceExistent)"
4302 Targets="GetCopyToOutputDirectoryItems"
4303 BuildInParallel="$(BuildInParallel)"
4304 Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform); %(_MSBuildProjectReferenceExistent.SetTargetFramework)"
4305 Condition="'@(_MSBuildProjectReferenceExistent)' != '' and '$(_GetChildProjectCopyToOutputDirectoryItems)' == 'true' and '%(_MSBuildProjectReferenceExistent.Private)' != 'false' and '$(UseCommonOutputDirectory)' != 'true'"
4306 ContinueOnError="$(ContinueOnError)"
4307 RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)">
4309 <Output TaskParameter="TargetOutputs" ItemName="_AllChildProjectItemsWithTargetPath"/>
4313 <!-- Target outputs must be full paths because they will be consumed by a different project. -->
4315 <_SourceItemsToCopyToOutputDirectoryAlways KeepDuplicates=" '$(_GCTODIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_AllChildProjectItemsWithTargetPath->'%(FullPath)')" Condition="'%(_AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='Always'"/>
4316 <_SourceItemsToCopyToOutputDirectory KeepDuplicates=" '$(_GCTODIKeepDuplicates)' != 'false' " KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_AllChildProjectItemsWithTargetPath->'%(FullPath)')" Condition="'%(_AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/>
4319 <!-- Remove items which we will never again use - they just sit around taking up memory otherwise -->
4321 <_AllChildProjectItemsWithTargetPath Remove="@(_AllChildProjectItemsWithTargetPath)"/>
4324 <!-- Get items from this project last so that they will be copied last. -->
4326 <_SourceItemsToCopyToOutputDirectoryAlways KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(ContentWithTargetPath->'%(FullPath)')" Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)'=='Always'"/>
4327 <_SourceItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(ContentWithTargetPath->'%(FullPath)')" Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/>
4331 <_SourceItemsToCopyToOutputDirectoryAlways KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(EmbeddedResource->'%(FullPath)')" Condition="'%(EmbeddedResource.CopyToOutputDirectory)'=='Always'"/>
4332 <_SourceItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(EmbeddedResource->'%(FullPath)')" Condition="'%(EmbeddedResource.CopyToOutputDirectory)'=='PreserveNewest'"/>
4336 <_CompileItemsToCopy Include="@(Compile->'%(FullPath)')" Condition="'%(Compile.CopyToOutputDirectory)'=='Always' or '%(Compile.CopyToOutputDirectory)'=='PreserveNewest'"/>
4339 <AssignTargetPath Files="@(_CompileItemsToCopy)" RootFolder="$(MSBuildProjectDirectory)">
4340 <Output TaskParameter="AssignedFiles" ItemName="_CompileItemsToCopyWithTargetPath" />
4344 <_SourceItemsToCopyToOutputDirectoryAlways KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_CompileItemsToCopyWithTargetPath)" Condition="'%(_CompileItemsToCopyWithTargetPath.CopyToOutputDirectory)'=='Always'"/>
4345 <_SourceItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_CompileItemsToCopyWithTargetPath)" Condition="'%(_CompileItemsToCopyWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/>
4349 <_SourceItemsToCopyToOutputDirectoryAlways KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_NoneWithTargetPath->'%(FullPath)')" Condition="'%(_NoneWithTargetPath.CopyToOutputDirectory)'=='Always'"/>
4350 <_SourceItemsToCopyToOutputDirectory KeepMetadata="$(_GCTODIKeepMetadata)" Include="@(_NoneWithTargetPath->'%(FullPath)')" Condition="'%(_NoneWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/>
4354 <AllItemsFullPathWithTargetPath Include="@(_SourceItemsToCopyToOutputDirectoryAlways->'%(FullPath)');@(_SourceItemsToCopyToOutputDirectory->'%(FullPath)')"/>
4360 ============================================================
4361 GetCopyToPublishDirectoryItems
4363 Default implementation of GetCopyToPublishDirectoryItems for projects that do not
4364 use Microsoft.NET.Sdk. It simply returns whatever GetCopyToOutputDirectoryItems
4365 does with CopyToPublishDirectory implied by CopyToOutputDirectory, which is the
4366 same as Microsoft.NET.Sdk default when its CopyToPublishDirectory is not used.
4368 Microsoft.NET.Sdk projects will override this to allow the publish output to be
4369 customized independently from the build output.
4371 Having a default implementation here allows the Microsoft.NET.Sdk Publish target
4372 to work when a Microsoft.NET.Sdk-based project references a non-Microsoft.NET.Sdk-based
4374 ============================================================
4377 Name="GetCopyToPublishDirectoryItems"
4378 DependsOnTargets="GetCopyToOutputDirectoryItems"
4379 Returns="@(AllPublishItemsFullPathWithTargetPath)">
4382 <AllPublishItemsFullPathWithTargetPath Include="@(AllItemsFullPathWithTargetPath)">
4383 <CopyToPublishDirectory>%(CopyToOutputDirectory)</CopyToPublishDirectory>
4384 </AllPublishItemsFullPathWithTargetPath>
4389 ============================================================
4390 _CopyOutOfDateSourceItemsToOutputDirectory
4392 Copy files that have the CopyToOutputDirectory attribute set to 'PreserveNewest'.
4393 ============================================================
4396 Name="_CopyOutOfDateSourceItemsToOutputDirectory"
4397 Condition=" '@(_SourceItemsToCopyToOutputDirectory)' != '' "
4398 Inputs="@(_SourceItemsToCopyToOutputDirectory)"
4399 Outputs="@(_SourceItemsToCopyToOutputDirectory->'$(OutDir)%(TargetPath)')">
4402 Not using SkipUnchangedFiles="true" because the application may want to change
4403 one of these files and not have an incremental build replace it.
4406 SourceFiles = "@(_SourceItemsToCopyToOutputDirectory)"
4407 DestinationFiles = "@(_SourceItemsToCopyToOutputDirectory->'$(OutDir)%(TargetPath)')"
4408 OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
4409 Retries="$(CopyRetryCount)"
4410 RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
4411 UseHardlinksIfPossible="$(CreateHardLinksForAdditionalFilesIfPossible)"
4412 UseSymboliclinksIfPossible="$(CreateSymbolicLinksForAdditionalFilesIfPossible)"
4415 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
4422 ============================================================
4423 _CopyOutOfDateSourceItemsToOutputDirectoryAlways
4425 Copy files that have the CopyToOutputDirectory attribute set to 'Always'.
4426 ============================================================
4429 Name="_CopyOutOfDateSourceItemsToOutputDirectoryAlways"
4430 Condition=" '@(_SourceItemsToCopyToOutputDirectoryAlways)' != '' ">
4433 Not using SkipUnchangedFiles="true" because the application may want to change
4434 one of these files and not have an incremental build replace it.
4437 SourceFiles = "@(_SourceItemsToCopyToOutputDirectoryAlways)"
4438 DestinationFiles = "@(_SourceItemsToCopyToOutputDirectoryAlways->'$(OutDir)%(TargetPath)')"
4439 OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
4440 Retries="$(CopyRetryCount)"
4441 RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
4442 UseHardlinksIfPossible="$(CreateHardLinksForAdditionalFilesIfPossible)"
4443 UseSymboliclinksIfPossible="$(CreateSymbolicLinksForAdditionalFilesIfPossible)"
4446 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
4453 ============================================================
4456 Copy the application config file.
4457 ============================================================
4460 Name="_CopyAppConfigFile"
4461 Condition=" '@(AppConfigWithTargetPath)' != '' "
4462 Inputs="@(AppConfigWithTargetPath)"
4463 Outputs="@(AppConfigWithTargetPath->'$(OutDir)%(TargetPath)')">
4466 Copy the application's .config file, if any.
4467 Not using SkipUnchangedFiles="true" because the application may want to change
4468 the app.config and not have an incremental build replace it.
4471 SourceFiles="@(AppConfigWithTargetPath)"
4472 DestinationFiles="@(AppConfigWithTargetPath->'$(OutDir)%(TargetPath)')"
4473 OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
4474 Retries="$(CopyRetryCount)"
4475 RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
4476 UseHardlinksIfPossible="$(CreateHardLinksForAdditionalFilesIfPossible)"
4477 UseSymboliclinksIfPossible="$(CreateSymbolicLinksForAdditionalFilesIfPossible)"
4480 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
4487 ================================================================
4489 ================================================================
4491 Copy the built manifests (.exe.manifest, .application/.xbap) to the final directory.
4494 Name="_CopyManifestFiles"
4495 Condition=" '$(_DeploymentCopyApplicationManifest)'=='true' or '$(GenerateClickOnceManifests)'=='true' "
4496 DependsOnTargets="PrepareForBuild">
4499 SourceFiles="@(ApplicationManifest)"
4500 DestinationFolder="$(OutDir)"
4501 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
4502 OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
4503 Retries="$(CopyRetryCount)"
4504 RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
4505 UseHardlinksIfPossible="$(CreateHardLinksForAdditionalFilesIfPossible)"
4506 UseSymboliclinksIfPossible="$(CreateSymbolicLinksForAdditionalFilesIfPossible)"
4507 Condition="'$(GenerateClickOnceManifests)'=='true' or '$(_DeploymentCopyApplicationManifest)'=='true'">
4509 <Output TaskParameter="DestinationFiles" ItemName="_DeploymentMainApplicationManifest"/>
4510 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
4514 <Message Importance="Normal" Condition="'$(_DeploymentCopyApplicationManifest)'=='true'" Text="$(MSBuildProjectName) -> @(_DeploymentMainApplicationManifest->'%(FullPath)')" />
4517 SourceFiles="@(DeployManifest)"
4518 DestinationFolder="$(OutDir)"
4519 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
4520 OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
4521 Retries="$(CopyRetryCount)"
4522 RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
4523 UseHardlinksIfPossible="$(CreateHardLinksForAdditionalFilesIfPossible)"
4524 UseSymboliclinksIfPossible="$(CreateSymbolicLinksForAdditionalFilesIfPossible)"
4525 Condition="'$(GenerateClickOnceManifests)'=='true'">
4527 <Output TaskParameter="DestinationFiles" ItemName="_DeploymentMainDeployManifest"/>
4528 <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
4532 <Message Importance="Normal" Condition="'$(GenerateClickOnceManifests)'=='true'" Text="$(MSBuildProjectName) -> @(_DeploymentMainDeployManifest->'%(FullPath)')" />
4537 ================================================================
4538 _CheckForCompileOutputs
4540 Checks each file output from the main "Compile" target to make sure they really exist.
4541 If they do, then record them in the clean cache.
4542 ============================================================
4545 Name="_CheckForCompileOutputs">
4547 <!--Record the main compile outputs.-->
4549 <FileWrites Include="@(IntermediateAssembly)" Condition="Exists('@(IntermediateAssembly)')"/>
4550 <FileWrites Include="@(IntermediateRefAssembly)" Condition="'$(ProduceReferenceAssembly)' == 'true' and Exists('@(IntermediateRefAssembly)')"/>
4553 <!-- Record the .xml if one was produced. -->
4555 <_DocumentationFileProduced Condition="!Exists('@(DocFileItem)')">false</_DocumentationFileProduced>
4559 <FileWrites Include="@(DocFileItem)" Condition="'$(_DocumentationFileProduced)'=='true'"/>
4562 <!-- Record the .pdb if one was produced. -->
4564 <_DebugSymbolsProduced Condition="!Exists('@(_DebugSymbolsIntermediatePath)')">false</_DebugSymbolsProduced>
4568 <FileWrites Include="@(_DebugSymbolsIntermediatePath)" Condition="'$(_DebugSymbolsProduced)'=='true'"/>
4573 ============================================================
4574 _SGenCheckForOutputs
4576 Checks each file output from the "GenerateSerializationAssemblies" target to make sure they really exist.
4577 If they do, then record them in the clean cache.
4578 ============================================================
4581 Name="_SGenCheckForOutputs"
4582 Condition="'$(_SGenGenerateSerializationAssembliesConfig)' == 'On' or ('@(WebReferenceUrl)'!='' and '$(_SGenGenerateSerializationAssembliesConfig)' == 'Auto')"
4585 <!-- Record the serializer .dll if one was produced.-->
4587 <_SGenDllCreated Condition="Exists('$(IntermediateOutputPath)$(_SGenDllName)')">true</_SGenDllCreated>
4591 <FileWrites Include="$(IntermediateOutputPath)$(_SGenDllName)" Condition="Exists('$(IntermediateOutputPath)$(_SGenDllName)')"/>
4600 ***********************************************************************************************
4601 ***********************************************************************************************
4602 UnmanagedRegistration Section
4603 ***********************************************************************************************
4604 ***********************************************************************************************
4608 ============================================================
4609 UnmanagedRegistration
4611 Registers the main assembly for COM interop.
4612 ============================================================
4615 <UnmanagedRegistrationDependsOn></UnmanagedRegistrationDependsOn>
4618 Name="UnmanagedRegistration"
4619 Condition="'$(RegisterForComInterop)'=='true' and '$(OutputType)'=='library'"
4620 DependsOnTargets="$(UnmanagedRegistrationDependsOn)"
4624 <RegisterAssemblyMSBuildArchitecture Condition="'$(RegisterAssemblyMSBuildArchitecture)' == ''">$(PlatformTargetAsMSBuildArchitecture)</RegisterAssemblyMSBuildArchitecture>
4627 <PropertyGroup Condition="'$(TargetFrameworkAsMSBuildRuntime)' != '' and '$(RegisterAssemblyMSBuildArchitecture)' != ''">
4628 <!-- Falling back to the current runtime if we are targeting CLR2 and the task host doesn't exist will lead to
4629 incorrect behavior in some cases, but it's the same incorrect behavior as Visual Studio 2010, and thus better
4630 than causing build breaks on upgrade to Win8 the way not doing so would. For more details, see the
4631 corresponding comment in GenerateResource. -->
4632 <RegisterAssemblyMSBuildRuntime
4633 Condition="'$(RegisterAssemblyMSBuildRuntime)' == '' and
4634 $([MSBuild]::DoesTaskHostExist(`$(TargetFrameworkAsMSBuildRuntime)`, `$(RegisterAssemblyMSBuildArchitecture)`))">$(TargetFrameworkAsMSBuildRuntime)</RegisterAssemblyMSBuildRuntime>
4636 <!-- If the targeted runtime doesn't exist, fall back to current -->
4637 <RegisterAssemblyMSBuildRuntime Condition="'$(RegisterAssemblyMSBuildRuntime)' == ''">CurrentRuntime</RegisterAssemblyMSBuildRuntime>
4641 Assemblies="@(_OutputPathItem->'%(FullPath)$(TargetFileName)')"
4642 TypeLibFiles="@(_OutputPathItem->'%(FullPath)$(TargetName).tlb')"
4643 AssemblyListFile="@(_UnmanagedRegistrationCache)"
4644 CreateCodeBase="true"
4645 MSBuildRuntime="$(RegisterAssemblyMSBuildRuntime)"
4646 MSBuildArchitecture="$(RegisterAssemblyMSBuildArchitecture)"
4647 Condition="!Exists('@(_UnmanagedRegistrationCache)')"/>
4650 <FileWrites Include="@(_OutputPathItem->'%(FullPath)$(TargetName).tlb')"/>
4659 ***********************************************************************************************
4660 ***********************************************************************************************
4661 IncrementalClean Section
4662 ***********************************************************************************************
4663 ***********************************************************************************************
4667 ============================================================
4670 Remove files that were produced in a prior build but weren't produced in the current build.
4671 The reason is that if, for example, the name of the .exe has changed we want to delete the
4674 Leave the Clean cache file containing only the files produced in the current build.
4675 ============================================================
4678 Name="IncrementalClean"
4679 DependsOnTargets="_CleanGetCurrentAndPriorFileWrites">
4681 <!-- Subtract list of files produced in prior builds from list of files produced in this build. -->
4683 <_CleanOrphanFileWrites Include="@(_CleanPriorFileWrites)" Exclude="@(_CleanCurrentFileWrites)"/>
4686 <!-- Find all files in the final output directory. -->
4687 <FindUnderPath Path="$(OutDir)" Files="@(_CleanOrphanFileWrites)">
4688 <Output TaskParameter="InPath" ItemName="_CleanOrphanFileWritesInOutput"/>
4691 <!-- Find all files in the intermediate output directory. -->
4692 <FindUnderPath Path="$(IntermediateOutputPath)" Files="@(_CleanOrphanFileWrites)">
4693 <Output TaskParameter="InPath" ItemName="_CleanOrphanFileWritesInIntermediate"/>
4696 <!-- Delete the orphaned files. -->
4698 Files="@(_CleanOrphanFileWritesInIntermediate);@(_CleanOrphanFileWritesInOutput)"
4699 TreatErrorsAsWarnings="true">
4701 <Output TaskParameter="DeletedFiles" ItemName="_CleanOrphanFilesDeleted"/>
4705 <!-- Create a list of everything that wasn't deleted or was outside
4706 the current final output and intermediate output directories. -->
4708 <_CleanRemainingFileWritesAfterIncrementalClean Include="@(_CleanPriorFileWrites);@(_CleanCurrentFileWrites)" Exclude="@(_CleanOrphanFilesDeleted)"/>
4711 <!-- Remove duplicates. -->
4712 <RemoveDuplicates Inputs="@(_CleanRemainingFileWritesAfterIncrementalClean)">
4713 <Output TaskParameter="Filtered" ItemName="_CleanUniqueRemainingFileWritesAfterIncrementalClean"/>
4716 <!-- Write new list of current files back to disk, replacing the existing list.-->
4718 File="$(IntermediateOutputPath)$(CleanFile)"
4719 Lines="@(_CleanUniqueRemainingFileWritesAfterIncrementalClean)"
4720 Condition="'@(_CleanUnfilteredPriorFileWrites)'!='@(_CleanUniqueRemainingFileWritesAfterIncrementalClean)'"
4726 ============================================================
4727 _CleanGetCurrentAndPriorFileWrites
4729 Get the list of files built in the current build and in prior builds.
4730 ============================================================
4733 Name="_CleanGetCurrentAndPriorFileWrites"
4734 DependsOnTargets="_CheckForCompileOutputs;_SGenCheckForOutputs">
4736 <!-- Read the list of files produced by a prior builds from disk. -->
4737 <ReadLinesFromFile File="$(IntermediateOutputPath)$(CleanFile)">
4738 <Output TaskParameter="Lines" ItemName="_CleanUnfilteredPriorFileWrites"/>
4739 </ReadLinesFromFile>
4742 Convert the list of references to the absolute paths so we can make valid comparisons
4745 <ConvertToAbsolutePath Paths="@(_ResolveAssemblyReferenceResolvedFiles)">
4746 <Output TaskParameter="AbsolutePaths" ItemName="_ResolveAssemblyReferenceResolvedFilesAbsolute"/>
4747 </ConvertToAbsolutePath>
4750 Subtract any resolved assembly files from *prior* file writes because deleting
4751 these would break subsequent builds because the assemblies would be unresolvable.
4754 <_CleanPriorFileWrites Include="@(_CleanUnfilteredPriorFileWrites)" Exclude="@(_ResolveAssemblyReferenceResolvedFilesAbsolute)"/>
4758 Of shareable files, keep only those that are in the project's directory.
4759 We never clean shareable files outside of the project directory because
4760 the build may be to a common output directory and other projects may need
4763 Only subtract the outputs from ResolveAssemblyReferences target because that's the
4764 only "Resolve" target that tries to resolve assemblies directly from the output
4767 <FindUnderPath Path="$(MSBuildProjectDirectory)" Files="@(FileWritesShareable)" UpdateToAbsolutePaths="true">
4768 <Output TaskParameter="InPath" ItemName="FileWrites"/>
4771 <!-- Find all files in the final output directory. -->
4772 <FindUnderPath Path="$(OutDir)" Files="@(FileWrites)" UpdateToAbsolutePaths="true">
4773 <Output TaskParameter="InPath" ItemName="_CleanCurrentFileWritesInOutput"/>
4776 <!-- Find all files in the intermediate output directory. -->
4777 <FindUnderPath Path="$(IntermediateOutputPath)" Files="@(FileWrites)" UpdateToAbsolutePaths="true">
4778 <Output TaskParameter="InPath" ItemName="_CleanCurrentFileWritesInIntermediate"/>
4782 Subtract any resolved assembly files from *current* file writes because deleting
4783 these would break subsequent builds because the assemblies would be unresolvable.
4785 Only subtract the outputs from ResolveAssemblyReferences target because that's the
4786 only "Resolve" target that tries to resolve assemblies directly from the output
4790 <_CleanCurrentFileWritesWithNoReferences Include="@(_CleanCurrentFileWritesInOutput);@(_CleanCurrentFileWritesInIntermediate)" Exclude="@(_ResolveAssemblyReferenceResolvedFilesAbsolute)"/>
4793 <!-- Remove duplicates from files produced in this build. -->
4794 <RemoveDuplicates Inputs="@(_CleanCurrentFileWritesWithNoReferences)" >
4795 <Output TaskParameter="Filtered" ItemName="_CleanCurrentFileWrites"/>
4801 ***********************************************************************************************
4802 ***********************************************************************************************
4804 ***********************************************************************************************
4805 ***********************************************************************************************
4809 ============================================================
4812 Delete all intermediate and final build outputs.
4813 ============================================================
4818 UnmanagedUnregistration;
4820 CleanReferencedProjects;
4827 Condition=" '$(_InvalidConfigurationWarning)' != 'true' "
4828 DependsOnTargets="$(CleanDependsOn)" />
4831 ============================================================
4834 Redefine this target in your project in order to run tasks just before Clean.
4835 ============================================================
4837 <Target Name="BeforeClean"/>
4840 ============================================================
4843 Redefine this target in your project in order to run tasks just after Clean.
4844 ============================================================
4846 <Target Name="AfterClean"/>
4849 ============================================================
4850 CleanReferencedProjects
4852 Call Clean target on all Referenced Projects.
4853 ============================================================
4856 Name="CleanReferencedProjects"
4857 DependsOnTargets="PrepareProjectReferences">
4860 When building the project directly from the command-line, clean those referenced projects
4861 that exist on disk. For IDE builds and command-line .SLN builds, the solution build manager
4865 Projects="@(_MSBuildProjectReferenceExistent)"
4867 Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform); %(_MSBuildProjectReferenceExistent.SetTargetFramework)"
4868 BuildInParallel="$(BuildInParallel)"
4869 Condition="'$(BuildingInsideVisualStudio)' != 'true' and '$(BuildProjectReferences)' == 'true' and '@(_MSBuildProjectReferenceExistent)' != ''"
4870 ContinueOnError="$(ContinueOnError)"
4871 RemoveProperties="%(_MSBuildProjectReferenceExistent.GlobalPropertiesToRemove)"/>
4876 ============================================================
4878 ============================================================
4881 <CoreCleanDependsOn></CoreCleanDependsOn>
4885 DependsOnTargets="$(CoreCleanDependsOn)">
4887 <!-- First clean any explicitly specified cleanable files.
4888 Declare items of this type if you want Clean to delete them. -->
4891 TreatErrorsAsWarnings="true"/>
4893 <!-- Read in list of files that were written to disk in past builds. -->
4894 <ReadLinesFromFile File="$(IntermediateOutputPath)$(CleanFile)">
4895 <Output TaskParameter="Lines" ItemName="_CleanPriorFileWrites"/>
4896 </ReadLinesFromFile>
4898 <!-- Find all files in the final output directory. -->
4899 <FindUnderPath Path="$(OutDir)" Files="@(_CleanPriorFileWrites)">
4900 <Output TaskParameter="InPath" ItemName="_CleanPriorFileWritesInOutput"/>
4903 <!-- Find all files in the intermediate output directory. -->
4904 <FindUnderPath Path="$(IntermediateOutputPath)" Files="@(_CleanPriorFileWrites)">
4905 <Output TaskParameter="InPath" ItemName="_CleanPriorFileWritesInIntermediate"/>
4908 <!-- Delete those files. -->
4910 Files="@(_CleanPriorFileWritesInOutput);@(_CleanPriorFileWritesInIntermediate)"
4911 TreatErrorsAsWarnings="true">
4913 <Output TaskParameter="DeletedFiles" ItemName="_CleanPriorFileWritesDeleted"/>
4917 <!-- Create a list of everything that wasn't deleted. -->
4919 <_CleanRemainingFileWritesAfterClean Include="@(_CleanPriorFileWrites)" Exclude="@(_CleanPriorFileWritesDeleted)"/>
4922 <!-- Remove duplicates. -->
4923 <RemoveDuplicates Inputs="@(_CleanRemainingFileWritesAfterClean)">
4924 <Output TaskParameter="Filtered" ItemName="_CleanUniqueRemainingFileWrites"/>
4927 <!-- Make sure the directory exists. -->
4928 <MakeDir Directories="$(IntermediateOutputPath)"/>
4930 <!-- Write new list of current files back to disk. -->
4931 <WriteLinesToFile File="$(IntermediateOutputPath)$(CleanFile)" Lines="@(_CleanUniqueRemainingFileWrites)" Overwrite="true" />
4936 ============================================================
4937 _CleanRecordFileWrites
4939 Save the list of all files written to disk so that it can be used for "Clean" later.
4941 Files written in prior builds are not removed from Clean cache.
4942 ============================================================
4945 Name="_CleanRecordFileWrites"
4946 DependsOnTargets="_CleanGetCurrentAndPriorFileWrites">
4949 Merge list of files from prior builds with the current build and then
4952 <RemoveDuplicates Inputs="@(_CleanPriorFileWrites);@(_CleanCurrentFileWrites)">
4953 <Output TaskParameter="Filtered" ItemName="_CleanUniqueFileWrites"/>
4956 <!-- Make sure the directory exists. -->
4957 <MakeDir Directories="$(IntermediateOutputPath)"/>
4959 <!-- Write merged file list back to disk, replacing existing contents. -->
4961 File="$(IntermediateOutputPath)$(CleanFile)"
4962 Lines="@(_CleanUniqueFileWrites)"
4968 ============================================================
4970 ============================================================
4973 Name="CleanPublishFolder">
4976 Directories="$(PublishDir)"
4977 Condition="'$(PublishDir)'=='$(OutputPath)app.publish\' and Exists('$(PublishDir)')"/>
4985 ***********************************************************************************************
4986 ***********************************************************************************************
4987 PostBuildEvent Section
4988 ***********************************************************************************************
4989 ***********************************************************************************************
4993 ============================================================
4996 Run the post-build event. This step is driven by two parameters:
4998 (1) The $(RunPostBuildEvent) property is set by the user through the IDE and can be one of four values.
5000 - OnBuildSuccess: In this case, every step of the build must succeed for the post-build step to run.
5001 - <Blank>: This is the same as OnBuildSuccess.
5002 - OnOutputUpdated: In this case, the post-build step will run only if the main output assembly was
5004 - Always: The post-build step is always run.
5006 (2) The $(_AssemblyTimestampBeforeCompile) and $(_AssemblyTimestampAfterCompile) values are
5007 set by the _TimeStampBeforeCompile and _TimeStampAfterCompile targets. If the assembly was actually
5008 rebuilt during this build, then the two values will be different.
5009 ============================================================
5012 <PostBuildEventDependsOn></PostBuildEventDependsOn>
5015 Name="PostBuildEvent"
5016 Condition="'$(PostBuildEvent)' != '' and ('$(RunPostBuildEvent)' != 'OnOutputUpdated' or '$(_AssemblyTimestampBeforeCompile)' != '$(_AssemblyTimestampAfterCompile)')"
5017 DependsOnTargets="$(PostBuildEventDependsOn)">
5019 <Exec WorkingDirectory="$(OutDir)" Command="$(PostBuildEvent)" />
5027 ***********************************************************************************************
5028 ***********************************************************************************************
5030 ***********************************************************************************************
5031 ***********************************************************************************************
5035 ============================================================
5038 This target is only called when doing ClickOnce publishing outside the IDE, which implicitly builds before publishing.
5039 ============================================================
5042 <PublishDependsOn Condition="'$(PublishableProject)'=='true'">
5043 SetGenerateManifests;
5047 <PublishDependsOn Condition="'$(PublishableProject)'!='true'">
5048 _DeploymentUnpublishable
5053 DependsOnTargets="$(PublishDependsOn)"/>
5056 ============================================================
5057 _DeploymentUnpublishable
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.
5060 ============================================================
5063 Name="_DeploymentUnpublishable">
5065 <Message Text="Skipping unpublishable project."/>
5070 ============================================================
5071 SetGenerateManifests
5073 This target simply assures the GenerateClickOnceManifests property is set whenever the publish target is invoked.
5074 ============================================================
5077 Name="SetGenerateManifests">
5079 <Error Condition="'$(OutputType)'!='winexe' and '$(OutputType)'!='exe' and '$(OutputType)'!='appcontainerexe'" Text="Publish is only valid for 'Windows Application' or 'Console Application' project types."/>
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."/>
5083 <GenerateClickOnceManifests>true</GenerateClickOnceManifests>
5089 ============================================================
5092 The "PublishOnly" target is intended for ClickOnce publishing inside the IDE, where the build has already been done
5093 by the BuildManager.
5094 ============================================================
5097 <PublishOnlyDependsOn>
5098 SetGenerateManifests;
5102 CopyFilesToOutputDirectory;
5103 _CopyFilesToPublishFolder;
5104 _DeploymentGenerateBootstrapper;
5106 _DeploymentSignClickOnceDeployment;
5108 </PublishOnlyDependsOn>
5112 DependsOnTargets="$(PublishOnlyDependsOn)"/>
5115 ============================================================
5118 Redefine this target in your project in order to run tasks just before Publish.
5119 ============================================================
5121 <Target Name="BeforePublish"/>
5124 ============================================================
5127 Redefine this target in your project in order to run tasks just after Publish.
5128 ============================================================
5130 <Target Name="AfterPublish"/>
5133 ============================================================
5136 Defines the set of targets that publishing is directly dependent on.
5137 ============================================================
5140 <PublishBuildDependsOn>
5146 GenerateSerializationAssemblies;
5147 CreateSatelliteAssemblies;
5148 </PublishBuildDependsOn>
5152 DependsOnTargets="$(PublishBuildDependsOn)"/>
5155 ============================================================
5156 _CopyFilesToPublishFolder
5157 ============================================================
5160 Name="_CopyFilesToPublishFolder">
5162 <!-- Compute name of application folder, which includes the assembly name plus formatted application version.
5163 The application version is formatted to use "_" in place of "." chars (i.e. "1_0_0_0" instead of "1.0.0.0").
5164 This is done because some servers misinterpret "." as a file extension. -->
5165 <FormatVersion Version="$(ApplicationVersion)" Revision="$(ApplicationRevision)" FormatType="Path">
5166 <Output TaskParameter="OutputVersion" PropertyName="_DeploymentApplicationVersionFragment"/>
5170 <_DeploymentApplicationFolderName>Application Files\$(AssemblyName)_$(_DeploymentApplicationVersionFragment)</_DeploymentApplicationFolderName>
5171 <_DeploymentApplicationDir>$(PublishDir)$(_DeploymentApplicationFolderName)\</_DeploymentApplicationDir>
5175 <!-- By default we're not using Hard or Symbolic Links to copy to the publish directory, and never when building in VS -->
5176 <CreateHardLinksForPublishFilesIfPossible Condition="'$(BuildingInsideVisualStudio)' == 'true' or '$(CreateHardLinksForPublishFilesIfPossible)' == ''">false</CreateHardLinksForPublishFilesIfPossible>
5177 <CreateSymbolicLinksForPublishFilesIfPossible Condition="'$(BuildingInsideVisualStudio)' == 'true' or '$(CreateSymbolicLinksForPublishFilesIfPossible)' == ''">false</CreateSymbolicLinksForPublishFilesIfPossible>
5180 <!-- Copy files to publish folder -->
5183 "@(_ApplicationManifestFinal);
5184 @(_DeploymentResolvedManifestEntryPoint);
5185 @(_DeploymentManifestFiles);
5186 @(ReferenceComWrappersToCopyLocal);
5187 @(ResolvedIsolatedComModules);
5188 @(_DeploymentLooseManifestFile)"
5190 "@(_ApplicationManifestFinal->'$(_DeploymentApplicationDir)%(TargetPath)');
5191 @(_DeploymentManifestEntryPoint->'$(_DeploymentApplicationDir)%(TargetPath)$(_DeploymentFileMappingExtension)');
5192 @(_DeploymentManifestFiles->'$(_DeploymentApplicationDir)%(TargetPath)$(_DeploymentFileMappingExtension)');
5193 @(ReferenceComWrappersToCopyLocal->'$(_DeploymentApplicationDir)%(FileName)%(Extension)$(_DeploymentFileMappingExtension)');
5194 @(ResolvedIsolatedComModules->'$(_DeploymentApplicationDir)%(FileName)%(Extension)$(_DeploymentFileMappingExtension)');
5195 @(_DeploymentLooseManifestFile->'$(_DeploymentApplicationDir)%(FileName)%(Extension)$(_DeploymentFileMappingExtension)')"
5196 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
5197 OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
5198 Retries="$(CopyRetryCount)"
5199 UseHardlinksIfPossible="$(CreateHardLinksForPublishFilesIfPossible)"
5200 UseSymboliclinksIfPossible="$(CreateSymbolicLinksForPublishFilesIfPossible)"
5201 RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"/>
5204 SourceFiles="@(_DeploymentManifestDependencies)"
5205 DestinationFiles="@(_DeploymentManifestDependencies->'$(_DeploymentApplicationDir)%(TargetPath)$(_DeploymentFileMappingExtension)')"
5206 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
5207 OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
5208 Retries="$(CopyRetryCount)"
5209 RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
5210 UseHardlinksIfPossible="$(CreateHardLinksForPublishFilesIfPossible)"
5211 UseSymboliclinksIfPossible="$(CreateSymbolicLinksForPublishFilesIfPossible)"
5212 Condition="'%(_DeploymentManifestDependencies.DependencyType)'=='Install'"/>
5215 SourceFiles="@(_ReferenceScatterPaths)"
5216 DestinationFiles="@(_ReferenceScatterPaths->'$(_DeploymentApplicationDir)%(Filename)%(Extension)$(_DeploymentFileMappingExtension)')"
5217 SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"
5218 OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
5219 Retries="$(CopyRetryCount)"
5220 RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
5221 UseHardlinksIfPossible="$(CreateHardLinksForPublishFilesIfPossible)"
5222 UseSymboliclinksIfPossible="$(CreateSymbolicLinksForPublishFilesIfPossible)"
5225 <FormatUrl InputUrl="$(_DeploymentApplicationUrl)">
5226 <Output TaskParameter="OutputUrl" PropertyName="_DeploymentFormattedApplicationUrl"/>
5229 <FormatUrl InputUrl="$(_DeploymentComponentsUrl)">
5230 <Output TaskParameter="OutputUrl" PropertyName="_DeploymentFormattedComponentsUrl"/>
5236 ============================================================
5237 _DeploymentGenerateBootstrapper
5238 ============================================================
5241 Name="_DeploymentGenerateBootstrapper">
5243 <!-- Build setup.exe bootstrapper and copy referenced packages -->
5244 <GenerateBootstrapper
5245 ApplicationFile="$(TargetDeployManifestFileName)"
5246 ApplicationName="$(AssemblyName)"
5247 ApplicationUrl="$(_DeploymentFormattedApplicationUrl)"
5248 BootstrapperItems="@(BootstrapperPackage)"
5249 ComponentsLocation="$(BootstrapperComponentsLocation)"
5250 ComponentsUrl="$(_DeploymentFormattedComponentsUrl)"
5251 Culture="$(TargetCulture)"
5252 FallbackCulture="$(FallbackCulture)"
5253 OutputPath="$(PublishDir)"
5254 SupportUrl="$(_DeploymentFormattedSupportUrl)"
5255 Path="$(GenerateBootstrapperSdkPath)"
5256 VisualStudioVersion="$(VisualStudioVersion)"
5257 Condition="'$(BootstrapperEnabled)'=='true'"/>
5262 ============================================================
5263 _DeploymentSignClickOnceDeployment
5264 ============================================================
5267 Name="_DeploymentSignClickOnceDeployment">
5269 <!-- Sign manifests and the bootstrapper -->
5271 CertificateThumbprint="$(_DeploymentResolvedManifestCertificateThumbprint)"
5272 TimestampUrl="$(ManifestTimestampUrl)"
5273 SigningTarget="$(_DeploymentApplicationDir)$(_DeploymentTargetApplicationManifestFileName)"
5274 TargetFrameworkVersion="$(TargetFrameworkVersion)"
5275 Condition="'$(_DeploymentSignClickOnceManifests)'=='true'" />
5277 <!-- Update entry point path in deploy manifest -->
5279 ApplicationPath="$(_DeploymentApplicationFolderName)\$(_DeploymentTargetApplicationManifestFileName)"
5280 TargetFrameworkVersion="$(TargetFrameworkVersion)"
5281 ApplicationManifest="$(_DeploymentApplicationDir)$(_DeploymentTargetApplicationManifestFileName)"
5282 InputManifest="$(OutDir)$(TargetDeployManifestFileName)"
5283 OutputManifest="$(PublishDir)$(TargetDeployManifestFileName)">
5285 <Output TaskParameter="OutputManifest" ItemName="PublishedDeployManifest"/>
5290 CertificateThumbprint="$(_DeploymentResolvedManifestCertificateThumbprint)"
5291 TimestampUrl="$(ManifestTimestampUrl)"
5292 SigningTarget="$(PublishDir)$(TargetDeployManifestFileName)"
5293 TargetFrameworkVersion="$(TargetFrameworkVersion)"
5294 Condition="'$(_DeploymentSignClickOnceManifests)'=='true'" />
5297 CertificateThumbprint="$(_DeploymentResolvedManifestCertificateThumbprint)"
5298 TimestampUrl="$(ManifestTimestampUrl)"
5299 SigningTarget="$(PublishDir)\setup.exe"
5300 Condition="'$(BootstrapperEnabled)'=='true' and '$(_DeploymentSignClickOnceManifests)'=='true'" />
5309 ***********************************************************************************************
5310 ***********************************************************************************************
5311 AllProjectOutputGroups Section
5312 ***********************************************************************************************
5313 ***********************************************************************************************
5317 ============================================================
5318 AllProjectOutputGroups
5320 The targets below drive output groups, which provide generic information about a
5321 project's inputs (e.g., content files, compilation sources, etc.) and built outputs
5322 (e.g., built EXE/DLL, PDB, XML documentation files, etc.)
5324 Each target may produce two kinds of items: outputs and dependencies. Outputs are
5325 items from the current project; dependencies are items that are brought into the
5326 current project as a result of referencing other projects or components.
5328 For both outputs and dependencies, the Include attribute
5329 specifies the location of the output/dependency; it must be a full path. Any number
5330 of additional attributes may be placed on an output/dependency item.
5331 ============================================================
5334 Name="AllProjectOutputGroups"
5336 BuiltProjectOutputGroup;
5337 DebugSymbolsProjectOutputGroup;
5338 DocumentationProjectOutputGroup;
5339 SatelliteDllsProjectOutputGroup;
5340 SourceFilesProjectOutputGroup;
5341 ContentFilesProjectOutputGroup;
5342 SGenFilesOutputGroup"/>
5345 This is the key output for the BuiltProjectOutputGroup and is meant to be read directly from the IDE.
5346 Reading an item is faster than invoking a target.
5348 <ItemGroup Condition=" '$(OutputType)' != 'winmdobj' ">
5349 <BuiltProjectOutputGroupKeyOutput Include="@(IntermediateAssembly->'%(FullPath)')">
5350 <IsKeyOutput>true</IsKeyOutput>
5351 <FinalOutputPath>$(TargetPath)</FinalOutputPath>
5352 <TargetPath>$(TargetFileName)</TargetPath>
5353 <COM2REG Condition="'$(RegisterForComInterop)'=='true' and '$(OutputType)'=='library'">true</COM2REG>
5354 </BuiltProjectOutputGroupKeyOutput>
5357 <ItemGroup Condition=" '$(OutputType)' == 'winmdobj' ">
5358 <WinMDExpOutputWindowsMetadataFileItem Include="$(_IntermediateWindowsMetadataPath)" Condition="'$(_IntermediateWindowsMetadataPath)' != ''" />
5359 <BuiltProjectOutputGroupKeyOutput Include="@(WinMDExpOutputWindowsMetadataFileItem->'%(FullPath)')">
5360 <IsKeyOutput>true</IsKeyOutput>
5361 <FinalOutputPath>$(TargetPath)</FinalOutputPath>
5362 <TargetPath>$(TargetFileName)</TargetPath>
5363 </BuiltProjectOutputGroupKeyOutput>
5367 ============================================================
5368 BuiltProjectOutputGroup
5369 ============================================================
5372 <BuiltProjectOutputGroupDependsOn>PrepareForBuild</BuiltProjectOutputGroupDependsOn>
5373 <AddAppConfigToBuildOutputs Condition="('$(AddAppConfigToBuildOutputs)'=='') and ('$(OutputType)'!='library' and '$(OutputType)'!='winmdobj')">true</AddAppConfigToBuildOutputs>
5376 Name="BuiltProjectOutputGroup"
5377 Returns="@(BuiltProjectOutputGroupOutput)"
5378 DependsOnTargets="$(BuiltProjectOutputGroupDependsOn)">
5381 <_BuiltProjectOutputGroupOutputIntermediate Include="@(BuiltProjectOutputGroupKeyOutput)"/>
5384 <!-- This item represents the app.config file -->
5386 <_BuiltProjectOutputGroupOutputIntermediate Include="$(AppConfig)" Condition="'$(AddAppConfigToBuildOutputs)'=='true'">
5387 <FinalOutputPath>$(TargetDir)$(TargetFileName).config</FinalOutputPath>
5388 <TargetPath>$(TargetFileName).config</TargetPath>
5389 <!-- For compatibility with 2.0 -->
5390 <OriginalItemSpec>$(AppConfig)</OriginalItemSpec>
5391 </_BuiltProjectOutputGroupOutputIntermediate>
5395 <_IsolatedComReference Include="@(COMReference)" Condition=" '%(COMReference.Isolated)' == 'true' "/>
5396 <_IsolatedComReference Include="@(COMFileReference)" Condition=" '%(COMFileReference.Isolated)' == 'true' "/>
5399 <!-- This item represents the native manifest, example: WindowsApplication1.exe.manifest or Native.ClassLibrary1.manifest -->
5401 <_BuiltProjectOutputGroupOutputIntermediate Include="$(OutDir)$(_DeploymentTargetApplicationManifestFileName)" Condition="'@(NativeReference)'!='' or '@(_IsolatedComReference)'!=''">
5402 <TargetPath>$(_DeploymentTargetApplicationManifestFileName)</TargetPath>
5403 <!-- For compatibility with 2.0 -->
5404 <OriginalItemSpec>$(OutDir)$(_DeploymentTargetApplicationManifestFileName)</OriginalItemSpec>
5405 </_BuiltProjectOutputGroupOutputIntermediate>
5408 <!-- Convert intermediate items into final items; this way we can get the full path for each item -->
5410 <BuiltProjectOutputGroupOutput Include="@(_BuiltProjectOutputGroupOutputIntermediate->'%(FullPath)')">
5411 <!-- For compatibility with 2.0 -->
5412 <OriginalItemSpec Condition="'%(_BuiltProjectOutputGroupOutputIntermediate.OriginalItemSpec)' == ''">%(_BuiltProjectOutputGroupOutputIntermediate.FullPath)</OriginalItemSpec>
5413 </BuiltProjectOutputGroupOutput>
5419 ============================================================
5420 DebugSymbolsProjectOutputGroup
5422 This target performs population of the Debug Symbols project output group.
5423 ============================================================
5426 <DebugSymbolsProjectOutputGroupDependsOn></DebugSymbolsProjectOutputGroupDependsOn>
5428 <ItemGroup Condition="'$(_DebugSymbolsProduced)' != 'false' and '$(OutputType)' != 'winmdobj'">
5429 <DebugSymbolsProjectOutputGroupOutput Include="@(_DebugSymbolsIntermediatePath->'%(FullPath)')">
5430 <FinalOutputPath>@(_DebugSymbolsOutputPath->'%(FullPath)')</FinalOutputPath>
5431 <TargetPath>@(_DebugSymbolsIntermediatePath->'%(Filename)%(Extension)')</TargetPath>
5432 </DebugSymbolsProjectOutputGroupOutput>
5434 <ItemGroup Condition="'$(_DebugSymbolsProduced)' != 'false' and '$(OutputType)' == 'winmdobj'">
5435 <WinMDExpOutputPdbItem Include="$(WinMDExpOutputPdb)" Condition="'$(WinMDExpOutputPdb)' != ''" />
5436 <WinMDExpFinalOutputPdbItem Include="$(_WinMDDebugSymbolsOutputPath)" Condition="'$(_WinMDDebugSymbolsOutputPath)' != ''" />
5437 <DebugSymbolsProjectOutputGroupOutput Include="@(WinMDExpOutputPdbItem->'%(FullPath)')">
5438 <FinalOutputPath>@(WinMDExpFinalOutputPdbItem->'%(FullPath)')</FinalOutputPath>
5439 <TargetPath>@(WinMDExpOutputPdbItem->'%(Filename)%(Extension)')</TargetPath>
5440 </DebugSymbolsProjectOutputGroupOutput>
5443 Name="DebugSymbolsProjectOutputGroup"
5444 Returns="@(DebugSymbolsProjectOutputGroupOutput)"
5445 DependsOnTargets="$(DebugSymbolsProjectOutputGroupDependsOn)"/>
5448 ============================================================
5449 DocumentationProjectOutputGroup
5451 This target performs population of the Documentation project output group.
5452 ============================================================
5455 <DocumentationProjectOutputGroupDependsOn></DocumentationProjectOutputGroupDependsOn>
5457 <ItemGroup Condition="'$(DocumentationFile)'!='' and '$(OutputType)' != 'winmdobj'">
5458 <DocumentationProjectOutputGroupOutput Include="@(DocFileItem->'%(FullPath)')">
5459 <FinalOutputPath>@(FinalDocFile->'%(FullPath)')</FinalOutputPath>
5460 <IsKeyOutput>true</IsKeyOutput>
5461 <TargetPath>@(DocFileItem->'%(Filename)%(Extension)')</TargetPath>
5462 </DocumentationProjectOutputGroupOutput>
5464 <ItemGroup Condition="'$(DocumentationFile)' != '' and '$(OutputType)' == 'winmdobj'">
5465 <WinMDOutputDocumentationFileItem Include="$(WinMDOutputDocumentationFile)" Condition="'$(WinMDOutputDocumentationFile)' != ''" />
5466 <WinMDExpFinalOutputDocItem Include="$(_WinMDDocFileOutputPath)" Condition="'$(_WinMDDocFileOutputPath)' != ''" />
5467 <DocumentationProjectOutputGroupOutput Include="@(WinMDOutputDocumentationFileItem->'%(FullPath)')">
5468 <FinalOutputPath>@(WinMDExpFinalOutputDocItem->'%(FullPath)')</FinalOutputPath>
5469 <TargetPath>@(WinMDOutputDocumentationFileItem->'%(Filename)%(Extension)')</TargetPath>
5470 </DocumentationProjectOutputGroupOutput>
5473 Name="DocumentationProjectOutputGroup"
5474 Returns="@(DocumentationProjectOutputGroupOutput)"
5475 DependsOnTargets="$(DocumentationProjectOutputGroupDependsOn)"/>
5478 ============================================================
5479 SatelliteDllsProjectOutputGroup
5481 This target performs population of the Satellite Files project output group.
5482 ============================================================
5485 <SatelliteDllsProjectOutputGroupDependsOn>PrepareForBuild;PrepareResourceNames</SatelliteDllsProjectOutputGroupDependsOn>
5488 Name="SatelliteDllsProjectOutputGroup"
5489 Returns="@(SatelliteDllsProjectOutputGroupOutput)"
5490 DependsOnTargets="$(SatelliteDllsProjectOutputGroupDependsOn)">
5493 <SatelliteDllsProjectOutputGroupOutputIntermediate Include="$(IntermediateOutputPath)%(EmbeddedResource.Culture)\$(TargetName).resources.dll"
5494 Condition="'%(EmbeddedResource.WithCulture)' == 'true'">
5495 <TargetPath>%(EmbeddedResource.Culture)\$(TargetName).resources.dll</TargetPath>
5496 <Culture>%(EmbeddedResource.Culture)</Culture>
5497 </SatelliteDllsProjectOutputGroupOutputIntermediate>
5500 <!-- Convert intermediate items into final items; this way we can get the full path for each item. -->
5502 <SatelliteDllsProjectOutputGroupOutput Include="@(SatelliteDllsProjectOutputGroupOutputIntermediate->'%(FullPath)')">
5503 <FinalOutputPath Condition=" '%(SatelliteDllsProjectOutputGroupOutputIntermediate.FinalOutputPath)' == '' ">$(TargetDir)%(SatelliteDllsProjectOutputGroupOutputIntermediate.TargetPath)</FinalOutputPath>
5504 <!-- For compatibility with 2.0 -->
5505 <OriginalItemSpec>%(SatelliteDllsProjectOutputGroupOutputIntermediate.Identity)</OriginalItemSpec>
5506 </SatelliteDllsProjectOutputGroupOutput>
5512 ============================================================
5513 SourceFilesProjectOutputGroup
5515 This target performs population of the Source Files project output group.
5516 Source files are items in the project whose type is "Compile" and "EmbeddedResource".
5517 ============================================================
5520 <SourceFilesProjectOutputGroupDependsOn>PrepareForBuild;AssignTargetPaths</SourceFilesProjectOutputGroupDependsOn>
5523 Name="SourceFilesProjectOutputGroup"
5524 Returns="@(SourceFilesProjectOutputGroupOutput)"
5525 DependsOnTargets="$(SourceFilesProjectOutputGroupDependsOn)">
5527 <AssignTargetPath Files="@(Compile)" RootFolder="$(MSBuildProjectDirectory)">
5528 <Output TaskParameter="AssignedFiles" ItemName="_CompileWithTargetPath" />
5532 <!-- First we deal with Compile, EmbeddedResource and AppConfig -->
5533 <SourceFilesProjectOutputGroupOutput Include="@(_CompileWithTargetPath->'%(FullPath)');@(EmbeddedResource->'%(FullPath)');@(_LicxFile->'%(FullPath)');@(AppConfigWithTargetPath->'%(FullPath)')"/>
5535 <!-- Include the project file -->
5536 <SourceFilesProjectOutputGroupOutput Include="$(MSBuildProjectFullPath)">
5537 <!-- For compatibility with 2.0 -->
5538 <OriginalItemSpec>$(MSBuildProjectFullPath)</OriginalItemSpec>
5539 <TargetPath>$(ProjectFileName)</TargetPath>
5540 </SourceFilesProjectOutputGroupOutput>
5545 <!-- Get just the compile items -->
5546 <Target Name="GetCompile" Returns="@(Compile)"/>
5549 ============================================================
5550 ContentFilesProjectOutputGroup
5552 This target performs population of the Content Files project output group.
5553 Content files are items in the project whose type is "Content".
5554 ============================================================
5557 <ContentFilesProjectOutputGroupDependsOn>PrepareForBuild;AssignTargetPaths</ContentFilesProjectOutputGroupDependsOn>
5560 Name="ContentFilesProjectOutputGroup"
5561 Returns="@(ContentFilesProjectOutputGroupOutput)"
5562 DependsOnTargets="$(ContentFilesProjectOutputGroupDependsOn)">
5564 <!-- Convert items into final items; this way we can get the full path for each item. -->
5566 <ContentFilesProjectOutputGroupOutput Include="@(ContentWithTargetPath->'%(FullPath)')"/>
5572 ============================================================
5573 SGenFilesOutputGroup
5575 This target performs population of the GenerateSerializationAssemblies Files project output group.
5576 GenerateSerializationAssemblies files are those generated by the GenerateSerializationAssemblies target and task.
5577 ============================================================
5580 <SGenFilesOutputGroupDependsOn></SGenFilesOutputGroupDependsOn>
5583 Condition="'$(_SGenGenerateSerializationAssembliesConfig)' == 'On' or ('@(WebReferenceUrl)'!='' and '$(_SGenGenerateSerializationAssembliesConfig)' == 'Auto')">
5584 <SGenFilesOutputGroupOutput Include="@(_OutputPathItem->'%(FullPath)$(_SGenDllName)')">
5585 <FinalOutputPath>@(_OutputPathItem->'%(FullPath)$(_SGenDllName)')</FinalOutputPath>
5586 <TargetPath>$(_SGenDllName)</TargetPath>
5587 </SGenFilesOutputGroupOutput>
5590 Name="SGenFilesOutputGroup"
5591 Returns="@(SGenFilesOutputGroupOutput)"
5592 DependsOnTargets="$(SGenFilesOutputGroupDependsOn)"/>
5595 ============================================================
5596 SDKRelated Output groups
5598 These targets are to gather information from the SDKs.
5599 ============================================================
5601 <!-- Get the resolved SDK reference items -->
5602 <Target Name="GetResolvedSDKReferences" DependsOnTargets="ResolveSDKReferences" Returns="@(ResolvedSDKReference)"/>
5605 ============================================================
5608 This target performs population of the pri files output group
5609 ============================================================
5612 Name="PriFilesOutputGroup"
5613 Condition="'@(_ReferenceRelatedPaths)' != ''"
5614 DependsOnTargets="BuildOnlySettings;PrepareForBuild;AssignTargetPaths;ResolveReferences"
5615 Returns="@(PriFilesOutputGroupOutput)">
5617 <!-- This item represents dependent pri file's -->
5619 <PriFilesOutputGroupOutput Include="@(_ReferenceRelatedPaths->'%(FullPath)')" Condition="'%(Extension)' == '.pri'"/>
5625 <SDKRedistOutputGroupDependsOn>ResolveSDKReferences;ExpandSDKReferences</SDKRedistOutputGroupDependsOn>
5629 ============================================================
5630 SDKRedistOutputGroup
5632 This target gathers the Redist folders from the SDKs which have been resolved.
5633 ============================================================
5636 Name="SDKRedistOutputGroup"
5637 Returns="@(SDKRedistOutputGroupOutput)"
5638 DependsOnTargets="$(SDKRedistOutputGroupDependsOn)">
5640 <!-- This list starts with the least specific files to the most specific so that later files can overwrite earlier files-->
5642 <SDKRedistOutputGroupOutput Include="@(ResolvedRedistFiles)"/>
5647 ***********************************************************************************************
5648 ***********************************************************************************************
5649 AllProjectOutputGroupsDependencies Section
5650 ***********************************************************************************************
5651 ***********************************************************************************************
5655 ============================================================
5656 AllProjectOutputGroupsDependencies
5657 ============================================================
5660 Name="AllProjectOutputGroupsDependencies"
5662 BuiltProjectOutputGroupDependencies;
5663 DebugSymbolsProjectOutputGroupDependencies;
5664 SatelliteDllsProjectOutputGroupDependencies;
5665 DocumentationProjectOutputGroupDependencies;
5666 SGenFilesOutputGroupDependencies"/>
5669 ============================================================
5670 BuiltProjectOutputGroupDependencies
5672 This target performs population of the Built project output group dependencies.
5673 ============================================================
5676 Name="BuiltProjectOutputGroupDependencies"
5677 DependsOnTargets="BuildOnlySettings;PrepareForBuild;AssignTargetPaths;ResolveReferences"
5678 Returns="@(BuiltProjectOutputGroupDependency)">
5681 <BuiltProjectOutputGroupDependency Include="@(ReferencePath->'%(FullPath)');
5682 @(ReferenceDependencyPaths->'%(FullPath)');
5683 @(NativeReferenceFile->'%(FullPath)');
5684 @(_DeploymentLooseManifestFile->'%(FullPath)');
5685 @(ResolvedIsolatedComModules->'%(FullPath)')"/>
5691 ============================================================
5692 DebugSymbolsProjectOutputGroupDependencies
5694 This target performs population of the dependencies for the debug symbols project output group.
5695 ============================================================
5698 Name="DebugSymbolsProjectOutputGroupDependencies"
5699 Condition="'$(DebugSymbols)'!='false'"
5700 DependsOnTargets="BuildOnlySettings;PrepareForBuild;AssignTargetPaths;ResolveReferences"
5701 Returns="@(DebugSymbolsProjectOutputGroupDependency)">
5703 <!-- This item represents dependent PDB's -->
5705 <DebugSymbolsProjectOutputGroupDependency Include="@(_ReferenceRelatedPaths->'%(FullPath)')" Condition="'%(Extension)' == '.pdb'"/>
5711 ============================================================
5712 SatelliteDllsProjectOutputGroupDependencies
5714 This target performs population of the dependencies for the satellite files project output group.
5715 ============================================================
5718 Name="SatelliteDllsProjectOutputGroupDependencies"
5719 DependsOnTargets="BuildOnlySettings;PrepareForBuild;AssignTargetPaths;ResolveReferences"
5720 Returns="@(SatelliteDllsProjectOutputGroupDependency)">
5722 <!-- This item represents dependent satellites -->
5724 <SatelliteDllsProjectOutputGroupDependency Include="@(ReferenceSatellitePaths->'%(FullPath)')"/>
5730 ============================================================
5731 DocumentationProjectOutputGroupDependencies
5733 This target performs population of the dependencies for the documentation project output group.
5734 ============================================================
5737 Name="DocumentationProjectOutputGroupDependencies"
5738 Condition="'$(DocumentationFile)'!=''"
5739 DependsOnTargets="BuildOnlySettings;PrepareForBuild;AssignTargetPaths;ResolveReferences"
5740 Returns="@(DocumentationProjectOutputGroupDependency)">
5742 <!-- This item represents dependent XMLs -->
5744 <DocumentationProjectOutputGroupDependency Include="@(_ReferenceRelatedPaths->'%(FullPath)')" Condition="'%(Extension)' == '.xml'"/>
5750 ============================================================
5751 SGenFilesOutputGroupDependencies
5753 This target performs population of the dependencies for the GenerateSerializationAssemblies project output group.
5754 ============================================================
5757 Name="SGenFilesOutputGroupDependencies"
5758 DependsOnTargets="BuildOnlySettings;PrepareForBuild;AssignTargetPaths;ResolveReferences"
5759 Returns="@(SGenFilesOutputGroupDependency)">
5761 <!-- This item represents sgen xml serializer dll's -->
5763 <SGenFilesOutputGroupDependency Include="@(_ReferenceSerializationAssemblyPaths->'%(FullPath)')" Condition="'%(Extension)' == '.dll'"/>
5769 <CodeAnalysisTargets Condition="'$(CodeAnalysisTargets)'==''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeAnalysis\Microsoft.CodeAnalysis.targets</CodeAnalysisTargets>
5772 <Import Project="$(CodeAnalysisTargets)" Condition="Exists('$(CodeAnalysisTargets)')"/>
5774 <Import Project="$(ReportingServicesTargets)" Condition="Exists('$(ReportingServicesTargets)')"/>
5776 <Import Project="$(MSBuildToolsPath)\Microsoft.NETFramework.targets" Condition="('$(TargetFrameworkIdentifier)' == '' or '$(TargetFrameworkIdentifier)' == '.NETFramework') and ('$(TargetRuntime)' == 'Managed')"/>
5779 <ImportXamlTargets Condition="'$(ImportXamlTargets)'=='' and ('$(TargetFrameworkVersion)' != 'v2.0' and '$(TargetFrameworkVersion)' != 'v3.5') and Exists('$(MSBuildToolsPath)\Microsoft.Xaml.targets')">true</ImportXamlTargets>
5782 <Import Project="$(MSBuildToolsPath)\Microsoft.Xaml.targets" Condition="('$(ImportXamlTargets)' == 'true')" />
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] -->
5785 <!-- Underlying assumption is that there shouldn't be any other versions between v4.0.* and v4.5 -->
5786 <Import Project="$(MSBuildToolsPath)\Microsoft.WorkflowBuildExtensions.targets"
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')"/>
5789 <!-- This import is temporary and will be removed once it is moved into the silverlight targets -->
5790 <Import Project="$(MSBuildToolsPath)\Microsoft.WinFX.targets" Condition="'$(TargetFrameworkIdentifier)' == 'Silverlight' and Exists('$(MSBuildToolsPath)\Microsoft.WinFX.targets')"/>
5793 <MsTestToolsTargets Condition="'$(MsTestToolsTargets)'==''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TeamTest\Microsoft.TeamTest.targets</MsTestToolsTargets>
5796 <Import Project="$(MsTestToolsTargets)" Condition="Exists('$(MsTestToolsTargets)')" />
5798 <!-- App packaging support -->
5801 Following two targets are needed to be present in every project being built
5802 because the app packaging targets recursively scan all projects referenced
5803 from projects that generate app packages for them.
5805 <Target Name="CleanAppxPackage" />
5806 <Target Name="GetPackagingOutputs" />
5809 <MsAppxPackageTargets Condition="'$(MsAppxPackageTargets)'==''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\AppxPackage\Microsoft.AppXPackage.Targets</MsAppxPackageTargets>
5812 <Import Project="$(MsAppxPackageTargets)" Condition="'$(WindowsAppContainer)' == 'true' and Exists('$(MsAppxPackageTargets)')" />
5814 <!-- This import is temporary and will be removed once it is moved into the silverlight targets -->
5815 <Import Project="$(MSBuildToolsPath)\Microsoft.Data.Entity.targets" Condition="'$(TargetFrameworkIdentifier)' == 'Silverlight' and Exists('$(MSBuildToolsPath)\Microsoft.Data.Entity.targets')"/>
5817 <Import Project="$(CustomAfterMicrosoftCommonTargets)" Condition="'$(CustomAfterMicrosoftCommonTargets)' != '' and Exists('$(CustomAfterMicrosoftCommonTargets)')"/>
5819 <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.targets\ImportAfter\*" Condition="'$(ImportByWildcardAfterMicrosoftCommonTargets)' == 'true' and exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.targets\ImportAfter')"/>
5820 <Import Project="$(MSBuildUserExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.targets\ImportAfter\*" Condition="'$(ImportUserLocationsByWildcardAfterMicrosoftCommonTargets)' == 'true' and exists('$(MSBuildUserExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.targets\ImportAfter')"/>