Guest User

MSBuild Targets Documentation

a guest
Jul 10th, 2019
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 36.25 KB | None | 0 0
  1. ===================================================
  2. Build
  3. The main build entry point.
  4. ===================================================
  5. <Target Name="Build"
  6. Condition=" '$(_InvalidConfigurationWarning)' != 'true' "
  7. DependsOnTargets="$(BuildDependsOn)"
  8. Returns="$(TargetPath)" />
  9.  
  10.  
  11. ===================================================
  12. BeforeBuild
  13. Redefine this target in your project in order to run tasks just before Build
  14. ===================================================
  15. <Target Name="BeforeBuild"/>
  16.  
  17.  
  18. ===================================================
  19. AfterBuild
  20. Redefine this target in your project in order to run tasks just after Build
  21. ===================================================
  22. <Target Name="AfterBuild"/>
  23.  
  24.  
  25. ===================================================
  26. CoreBuild
  27. The core build step calls each of the build targets.
  28. ===================================================
  29. <Target Name="CoreBuild"
  30. DependsOnTargets="$(CoreBuildDependsOn)">
  31.  
  32.  
  33. ===================================================
  34. Rebuild
  35. Delete all intermediate and final build outputs, and then build the project from scratch.
  36. ===================================================
  37. <Target Name="Rebuild"
  38. Condition=" '$(_InvalidConfigurationWarning)' != 'true' "
  39. DependsOnTargets="$(RebuildDependsOn)"
  40. Returns="$(TargetPath)"/>
  41.  
  42.  
  43. ===================================================
  44. BeforeRebuild
  45. Redefine this target in your project in order to run tasks just before Rebuild
  46. ===================================================
  47. <Target Name="BeforeRebuild"/>
  48.  
  49.  
  50. ===================================================
  51. AfterRebuild
  52. Redefine this target in your project in order to run tasks just after Rebuild
  53. ===================================================
  54. <Target Name="AfterRebuild"/>
  55.  
  56.  
  57. ===================================================
  58. BuildGenerateSources
  59. Redefine this target in your project in order to run tasks for BuildGenerateSources
  60. Set BuildPassReferences to enable P2P builds
  61. ===================================================
  62. <Target Name="BuildGenerateSources"
  63. DependsOnTargets="BuildGenerateSourcesTraverse;$(BuildGenerateSourcesAction)" />
  64.  
  65.  
  66. ===================================================
  67. BuildCompile
  68. Redefine this target in your project in order to run tasks for BuildCompile
  69. ===================================================
  70. <Target Name="BuildCompile"
  71. DependsOnTargets="BuildCompileTraverse;$(BuildCompileAction)" />
  72.  
  73.  
  74. ===================================================
  75. BuildLink
  76. Redefine this target in your project in order to run tasks for BuildLink
  77. ===================================================
  78. <Target Name="BuildLink"
  79. DependsOnTargets="BuildLinkTraverse;$(BuildLinkAction)" />
  80.  
  81.  
  82. ===================================================
  83. CopyRunEnvironmentFiles
  84. Copy environment files necessary to run the user's app to the final directory.
  85. This is a public target that can be invoked by an IDE.
  86. This may be used by an IDE to make the app.config file available for running
  87. the target app.
  88. ===================================================
  89. <Target
  90. Name="CopyRunEnvironmentFiles"
  91. DependsOnTargets="PrepareForBuild;SetWin32ManifestProperties;_CopyAppConfigFile;_CleanRecordFileWrites"/>
  92.  
  93.  
  94. ===================================================
  95. Run
  96. Run the final build output if it is a .EXE
  97. ===================================================
  98. <Target
  99. Name="Run"
  100. DependsOnTargets="$(RunDependsOn)">
  101.  
  102.  
  103. ===================================================
  104. BuildOnlySettings
  105. This target is called only when doing a real build. It is specifically not called during project load.
  106. ===================================================
  107. <Target Name="BuildOnlySettings">
  108.  
  109.  
  110. ===================================================
  111. PrepareForBuild
  112. Prepare the prerequisites for building.
  113. ===================================================
  114. <Target Name="PrepareForBuild"
  115. DependsOnTargets="$(PrepareForBuildDependsOn)">
  116.  
  117.  
  118. ===================================================
  119. GetFrameworkPaths
  120. Get the paths for the .NET Framework installation directory
  121.  
  122. These paths are not used directly by this .targets file but are available for pre and
  123. post build steps.
  124.  
  125. This is a generally overriden target, for example it is overriden in the Microsoft.NETFramework.targets file
  126. ===================================================
  127. <Target Name="GetFrameworkPaths"/>
  128.  
  129.  
  130. ===================================================
  131. GetReferenceAssemblyPaths
  132. Get the paths for the Reference Assemblies for the known versions of the
  133. .NET Framework.
  134.  
  135. These paths are used by the build process in order to resolve the correct
  136. assemblies from the various directories, and to support multi-targeting
  137. ===================================================
  138. <Target Name="GetReferenceAssemblyPaths"
  139. DependsOnTargets="$(GetReferenceAssemblyPathsDependsOn)">
  140.  
  141.  
  142. ===================================================
  143. AssignLinkMetadata
  144. For items of a certain set of whitelisted types, make sure that
  145. if they are defined in a file other than the project file, that
  146. they have "Link" metadata set to an appropriate default.
  147. ===================================================
  148. <Target Name="AssignLinkMetadata"
  149. Condition=" '$(SynthesizeLinkMetadata)' == 'true' ">
  150.  
  151.  
  152. ===================================================
  153. PreBuildEvent
  154. Run the pre-build event if there is one.
  155. ===================================================
  156. <Target Name="PreBuildEvent"
  157. Condition="'$(PreBuildEvent)'!=''"
  158. DependsOnTargets="$(PreBuildEventDependsOn)">
  159.  
  160.  
  161. ===================================================
  162. UnmanagedUnregistration
  163. If the main assembly had previously been registered for COM interop, unregister it now.
  164. We will re-register the new version after it has been built.
  165. ===================================================
  166. <Target Name="UnmanagedUnregistration"
  167. Condition="(('$(_AssemblyTimestampBeforeCompile)' != '$(_AssemblyTimestampAfterCompile)' or '$(RegisterForComInterop)' != 'true' or '$(OutputType)' != 'library') or
  168. ('$(_AssemblyTimestampBeforeCompile)' == '')) and
  169. Exists('@(_UnmanagedRegistrationCache)')"
  170. DependsOnTargets="$(UnmanagedUnregistrationDependsOn)">
  171.  
  172.  
  173. ===================================================
  174. GetTargetFrameworkVersion
  175. This stand-alone target returns the target framework version (i.e. v3.5, v4.0, etc.)
  176. that would be used if we built this project.
  177. ===================================================
  178. <Target
  179. Name="GetTargetFrameworkVersion"
  180. Returns="$(TargetFrameworkVersion)" />
  181.  
  182.  
  183. ===================================================
  184. ResolveReferences
  185. ===================================================
  186. <Target Name="ResolveReferences"
  187. DependsOnTargets="$(ResolveReferencesDependsOn)"/>
  188.  
  189.  
  190. ===================================================
  191. BeforeResolveReferences
  192. Redefine this target in your project in order to run tasks just before ResolveReferences
  193. ===================================================
  194. <Target Name="BeforeResolveReferences"/>
  195.  
  196.  
  197. ===================================================
  198. AfterResolveReferences
  199. Redefine this target in your project in order to run tasks just after ResolveReferences
  200. ===================================================
  201. <Target Name="AfterResolveReferences"/>
  202.  
  203.  
  204. ===================================================
  205. AssignProjectConfiguration
  206. Assigns the appropriate configuration to each project in the list of project references passed in.
  207. Adds to the project references passed in any project references implied by dependencies expressed in the solution file, if any.
  208. ===================================================
  209. <Target Name="AssignProjectConfiguration"
  210. Condition="'$(CurrentSolutionConfigurationContents)' != '' or '@(ProjectReference)'!=''">
  211.  
  212.  
  213. ===================================================
  214. ResolveProjectReferences
  215. Build referenced projects
  216. ===================================================
  217. <Target Name="ResolveProjectReferences"
  218. DependsOnTargets="AssignProjectConfiguration;_SplitProjectReferencesByFileExistence"
  219. Returns="@(_ResolvedNativeProjectReferencePaths);@(_ResolvedProjectReferencePaths)">
  220.  
  221.  
  222. ===================================================
  223. GetTargetPath
  224. This stand-alone target returns the name of the build product (i.e. EXE, DLL)
  225. that would be produced if we built this project.
  226. ===================================================
  227. <Target Name="GetTargetPath"
  228. DependsOnTargets="$(GetTargetPathDependsOn)"
  229. Returns="$(TargetPath)"/>
  230.  
  231.  
  232. ===================================================
  233. GetTargetPathWithTargetPlatformMoniker
  234. This stand-alone target returns the name and version of the target platform for this project.
  235. ===================================================
  236. <Target Name="GetTargetPathWithTargetPlatformMoniker"
  237. DependsOnTargets="$(GetTargetPathWithTargetPlatformMonikerDependsOn)"
  238. Returns="@(TargetPathWithTargetPlatformMoniker)">
  239.  
  240.  
  241. ===================================================
  242. GetNativeManifest
  243. Compute the manifest item for this project.
  244. ===================================================
  245. <Target
  246. Name="GetNativeManifest"
  247. Returns="@(ComputedApplicationManifest)">
  248.  
  249.  
  250. ===================================================
  251. ResolveNativeReferences
  252. Resolve native references
  253. ===================================================
  254. <Target Name="ResolveNativeReferences"
  255. Condition="'@(NativeReference)'!=''"
  256. DependsOnTargets="ResolveProjectReferences">
  257.  
  258.  
  259. ===================================================
  260. ResolveAssemblyReferences
  261. Given the list of assemblies, find the closure of all assemblies that they depend on. These are
  262. what we need to copy to the output directory.
  263.  
  264. [IN]
  265. @(Reference) - List of assembly references as fusion names.
  266. @(_ResolvedProjectReferencePaths) - List of project references produced by projects that this project depends on.
  267.  
  268. The 'Private' attribute on the reference corresponds to the Copy Local flag in IDE.
  269. The 'Private' flag can have three possible values:
  270. - 'True' means the reference should be Copied Local
  271. - 'False' means the reference should not be Copied Local
  272. - [Missing] means this task will decide whether to treat this reference as CopyLocal or not.
  273.  
  274. [OUT]
  275. @(ReferencePath) - Paths to resolved primary files.
  276. @(ReferenceDependencyPaths) - Paths to resolved dependency files.
  277. @(_ReferenceRelatedPaths) - Paths to .xmls and .pdbs.
  278. @(ReferenceSatellitePaths) - Paths to satellites.
  279. @(_ReferenceSerializationAssemblyPaths) - Paths to XML serialization assemblies created by sgen.
  280. @(_ReferenceScatterPaths) - Paths to scatter files.
  281. @(ReferenceCopyLocalPaths) - Paths to files that should be copied to the local directory.
  282. ===================================================
  283. <Target Name="ResolveAssemblyReferences"
  284. Returns="@(ReferencePath)"
  285. DependsOnTargets="$(ResolveAssemblyReferencesDependsOn)">
  286.  
  287.  
  288. ===================================================
  289. GenerateBindingRedirects
  290. Inject the binding redirects into the app config file based on suggested redirects as output from ResolveAssemblyReferences.
  291.  
  292. [IN]
  293. @(AppConfigWithTargetPath) - Path to the source app config file. This can be null if the project
  294. doesn't contain an app config file.
  295. $(TargetFileName) - The file name of the build target.
  296.  
  297. [OUT]
  298. @(OutputAppConfigFile) - Path to the output app config file in the intermediate directory.
  299. ===================================================
  300. <Target Name="GenerateBindingRedirects"
  301. Inputs="$(MSBuildAllProjects);@(AppConfigFile);$(ResolveAssemblyReferencesStateFile);$(IntermediateOutputPath);@(SuggestedBindingRedirects)"
  302. Outputs="$(_GenerateBindingRedirectsIntermediateAppConfig)"
  303. Condition="'$(AutoGenerateBindingRedirects)' == 'true' and '$(GenerateBindingRedirectsOutputType)' == 'true'">
  304.  
  305.  
  306. ===================================================
  307. GenerateBindingRedirectsUpdateAppConfig
  308. Updates the project to use the generated app.config content. This needs to run regardless of
  309. inputs/outputs so it is seperate from GenerateBindingRedirects.
  310. ===================================================
  311. <Target Name="GenerateBindingRedirectsUpdateAppConfig"
  312. AfterTargets="GenerateBindingRedirects"
  313. Condition="'$(AutoGenerateBindingRedirects)' == 'true' and '$(GenerateBindingRedirectsOutputType)' == 'true' and Exists('$(_GenerateBindingRedirectsIntermediateAppConfig)')">
  314.  
  315.  
  316. ===================================================
  317. GetInstalledSDKs
  318. Gets the list of SDKs installed in the SDKDirectoryRoot and SDKRegistryRoot locations
  319. These paths are used by the ResolveSDKReference task and the ResolveAssemblyReference task.
  320. ===================================================
  321. <Target Name="GetInstalledSDKLocations"
  322. DependsOnTargets="$(GetInstalledSDKLocationsDependsOn)"
  323. Returns="@(InstalledSDKLocations)" />
  324.  
  325.  
  326. ===================================================
  327. ResolveSDKReferences
  328. Given a list of SDKReference items and a list of resolved winmd files which may contain metadata as to which sdk they came from
  329. we need to find the sdk root folders on disk and populate a ResolvedSDKReference item which has the full path to the SDK ROOT
  330. and the sdk identity as a piece of metadata.
  331. ===================================================
  332. <Target Name="ResolveSDKReferences"
  333. Returns="@(ResolvedSDKReference)"
  334. DependsOnTargets="$(ResolveSDKReferencesDependsOn)">
  335.  
  336.  
  337. ===================================================
  338. FindInvalidProjectReferences
  339. Find project to project references with target platform version higher than the one used by the current project and
  340. creates a list of invalid references to be unresolved. It issues a warning for each invalid reference.
  341. ===================================================
  342. <Target Name="FindInvalidProjectReferences"
  343. Condition ="'$(FindInvalidProjectReferences)' == 'true'"
  344. DependsOnTargets="$(FindInvalidProjectReferencesDependsOn)">
  345.  
  346.  
  347. ===================================================
  348. ExpandSDKReferences
  349. 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)
  350. as part of the assemblies passed to the compiler.
  351.  
  352. Project systems or project which do not want to reference all dlls or winmd files should override this target to do nothing.
  353. ===================================================
  354. <Target Name="ExpandSDKReferences"
  355. Returns="@(ReferencesFromSDK)"
  356. DependsOnTargets="$(ExpandSDKReferencesDependsOn)" />
  357.  
  358.  
  359. ===================================================
  360. ExportWindowsMDFile
  361. 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
  362. through the winmdexp tool in order to generate the resulting WinMD file.
  363. ===================================================
  364. <Target Name="ExportWindowsMDFile"
  365. DependsOnTargets="Compile"
  366. Condition="'$(ExportWinMDFile)' == 'true'"
  367. Inputs="@(IntermediateAssembly);@(DocFileItem);@(_DebugSymbolsIntermediatePath);@(ReferencePath);$(MSBuildAllProjects)"
  368. Outputs="$(_IntermediateWindowsMetadataPath);$(WinMDExpOutputPdb);$(WinMDOutputDocumentationFile)" />
  369.  
  370.  
  371. ===================================================
  372. DesignTimeResolveAssemblyReferences
  373. Given the list of assemblies, resolve their reference paths.
  374. This target is called by Visual Studio at run time in order to filter references
  375. according to the targeted framework.
  376. ===================================================
  377. <Target Name="DesignTimeResolveAssemblyReferences"
  378. Condition="'$(DesignTimeReference)'!=''"
  379. DependsOnTargets="$(DesignTimeResolveAssemblyReferencesDependsOn)">
  380.  
  381.  
  382. ===================================================
  383. ResolveComReferences
  384. Resolve COM references
  385. ===================================================
  386. <Target Name="ResolveComReferences"
  387. Condition="'@(COMReference)'!='' or '@(COMFileReference)'!=''"
  388. Returns="@(ReferencePath)"
  389. DependsOnTargets="PrepareForBuild;ResolveKeySource;ResolveAssemblyReferences" />
  390.  
  391.  
  392. ===================================================
  393. PrepareResources
  394. Prepare resources for the Compile step.
  395. ===================================================
  396. <Target Name="PrepareResources"
  397. DependsOnTargets="$(PrepareResourcesDependsOn)"/>
  398.  
  399.  
  400. ===================================================
  401. PrepareResourceNames
  402. Prepare the names of resource files.
  403. ===================================================
  404. <Target Name="PrepareResourceNames"
  405. DependsOnTargets="$(PrepareResourceNamesDependsOn)"/>
  406.  
  407.  
  408. ===================================================
  409. AssignTargetPaths
  410. This target creates <TargetPath> tags for items. <TargetPath> is a relative folder plus filename
  411. for the destination of this item.
  412. ===================================================
  413. <Target Name="AssignTargetPaths"
  414. DependsOnTargets="$(AssignTargetPathsDependsOn)">
  415.  
  416.  
  417. ===================================================
  418. GetItemTargetPaths
  419. This target returns all items that have TargetPath metadata assigned by the AssignTargetPaths target.
  420. ===================================================
  421. <Target Name="GetItemTargetPaths"
  422. DependsOnTargets="AssignTargetPaths"
  423. Returns="
  424. @(EmbeddedResource);
  425. @(ContentWithTargetPath);
  426. @(_NoneWithTargetPath);
  427. @(_DeploymentBaseManifestWithTargetPath);
  428. " />
  429.  
  430.  
  431. ===================================================
  432. SplitResourcesByCulture
  433. Split EmbeddedResource items into five lists based on whether
  434. they are resx files, licx files or other resources and whether they should be localized. Also adds Type and Culture
  435. metadata. Type indicates whether the resource is "Resx" or "Non-Resx".
  436. ===================================================
  437. <Target Name="SplitResourcesByCulture"
  438. DependsOnTargets="AssignTargetPaths">
  439.  
  440.  
  441. ===================================================
  442. CreateCustomManifestResourceNames
  443. Allows custom manifest resource name generation tasks to plug
  444. into the build process
  445. ===================================================
  446. <Target Name="CreateCustomManifestResourceNames"
  447. DependsOnTargets="$(CreateCustomManifestResourceNamesDependsOn)"/>
  448.  
  449.  
  450. ===================================================
  451. ResGen
  452. Run GenerateResource on the given resx files.
  453. ===================================================
  454. <Target Name="ResGen"
  455. DependsOnTargets="$(ResGenDependsOn)"/>
  456.  
  457.  
  458. ===================================================
  459. BeforeResGen
  460. Redefine this target in your project in order to run tasks just before Resgen.
  461. ===================================================
  462. <Target Name="BeforeResGen"/>
  463.  
  464.  
  465. ===================================================
  466. AfterResGen
  467. Redefine this target in your project in order to run tasks just after Resgen.
  468. ===================================================
  469. <Target Name="AfterResGen"/>
  470.  
  471.  
  472. ===================================================
  473. ResolveKeySource
  474. Resolve the strong name key used to sign the assembly as well as the certificate used to
  475. sign the ClickOnce manifests.
  476. ===================================================
  477. <Target Name="ResolveKeySource"
  478. Condition="$(SignManifests) == 'true' or $(SignAssembly) == 'true'">
  479.  
  480.  
  481. ===================================================
  482. Compile
  483. ===================================================
  484. <Target Name="Compile"
  485. DependsOnTargets="$(CompileDependsOn)"/>
  486.  
  487.  
  488. ===================================================
  489. GenerateTargetFrameworkMonikerAttribute
  490. Emit the target framework moniker attribute as a code fragment into a temporary source file for the compiler.
  491. ===================================================
  492. <Target Name="GenerateTargetFrameworkMonikerAttribute"
  493. BeforeTargets="BeforeCompile"
  494. DependsOnTargets="PrepareForBuild;GetReferenceAssemblyPaths"
  495. Inputs="$(MSBuildToolsPath)\Microsoft.Common.targets"
  496. Outputs="$(TargetFrameworkMonikerAssemblyAttributesPath)"
  497. Condition="'$(GenerateTargetFrameworkAttribute)' == 'true'">
  498.  
  499.  
  500. ===================================================
  501. GenerateAdditionalSources
  502. Emit any specified code fragments into a temporary source file for the compiler.
  503. ===================================================
  504. <Target Name="GenerateAdditionalSources"
  505. BeforeTargets="BeforeCompile"
  506. DependsOnTargets="PrepareForBuild;GetReferenceAssemblyPaths"
  507. Inputs="$(MSBuildAllProjects)"
  508. Outputs="$(AssemblyAttributesPath)"
  509. Condition="'@(AssemblyAttributes)' != '' and '$(GenerateAdditionalSources)' == 'true'">
  510.  
  511.  
  512. ===================================================
  513. BeforeCompile
  514. Redefine this target in your project in order to run tasks just before Compile.
  515. ===================================================
  516. <Target Name="BeforeCompile"/>
  517.  
  518.  
  519. ===================================================
  520. AfterCompile
  521. Redefine this target in your project in order to run tasks just after Compile.
  522. ===================================================
  523. <Target Name="AfterCompile"/>
  524.  
  525.  
  526. ===================================================
  527. GenerateSerializationAssemblies
  528. Run GenerateSerializationAssemblies on the assembly produced by this build.
  529. ===================================================
  530. <Target Name="GenerateSerializationAssemblies"
  531. Condition="'$(_SGenGenerateSerializationAssembliesConfig)' == 'On' or ('@(WebReferenceUrl)'!='' and '$(_SGenGenerateSerializationAssembliesConfig)' == 'Auto')"
  532. DependsOnTargets="AssignTargetPaths;Compile;ResolveKeySource"
  533. Inputs="$(MSBuildAllProjects);@(IntermediateAssembly)"
  534. Outputs="$(IntermediateOutputPath)$(_SGenDllName)">
  535.  
  536.  
  537. ===================================================
  538. CreateSatelliteAssemblies
  539. Create one satellite assembly for every unique culture in the resources.
  540. ===================================================
  541. <Target Name="CreateSatelliteAssemblies"
  542. DependsOnTargets="$(CreateSatelliteAssembliesDependsOn)" />
  543.  
  544.  
  545. ===================================================
  546. GenerateSatelliteAssemblies
  547. Actually run al.exe to create the satellite assemblies.
  548. ===================================================
  549. <Target Name="GenerateSatelliteAssemblies"
  550. Inputs="$(MSBuildAllProjects);@(_SatelliteAssemblyResourceInputs);$(IntermediateOutputPath)$(TargetName)$(TargetExt)"
  551. Outputs="$(IntermediateOutputPath)%(Culture)\$(TargetName).resources.dll"
  552. Condition="'@(_SatelliteAssemblyResourceInputs)' != ''">
  553.  
  554.  
  555. ===================================================
  556. ComputeIntermediateSatelliteAssemblies
  557. Compute the paths to the intermediate satellite assemblies,
  558. with culture attributes so we can copy them to the right place.
  559. ===================================================
  560. <Target Name="ComputeIntermediateSatelliteAssemblies"
  561. Condition="@(EmbeddedResource->'%(WithCulture)') != ''"
  562. DependsOnTargets="$(ComputeIntermediateSatelliteAssembliesDependsOn)">
  563.  
  564.  
  565. ===================================================
  566. SetWin32ManifestProperties
  567. Set Win32Manifest and EmbeddedManifest properties to be used later in the build.
  568. ===================================================
  569. <Target Name="SetWin32ManifestProperties"
  570. Condition="'$(Win32Manifest)'==''"
  571. DependsOnTargets="ResolveComReferences;ResolveNativeReferences;_SetExternalWin32ManifestProperties;_SetEmbeddedWin32ManifestProperties" />
  572.  
  573.  
  574. ===================================================
  575. GenerateManifests
  576. Generates ClickOnce application and deployment manifests or a native manifest.
  577. ===================================================
  578. <Target Name="GenerateManifests"
  579. Condition="'$(GenerateClickOnceManifests)'=='true' or '@(NativeReference)'!='' or '@(ResolvedIsolatedComModules)'!='' or '$(GenerateAppxManifest)' == 'true'"
  580. DependsOnTargets="$(GenerateManifestsDependsOn)"/>
  581.  
  582.  
  583. ===================================================
  584. GenerateApplicationManifest
  585. Generates a ClickOnce or native application manifest.
  586. An application manifest specifies declarative application identity, dependency and security information.
  587. ===================================================
  588. <Target Name="GenerateApplicationManifest"
  589. DependsOnTargets="
  590. _DeploymentComputeNativeManifestInfo;
  591. _DeploymentComputeClickOnceManifestInfo;
  592. ResolveComReferences;
  593. ResolveNativeReferences;
  594. _GenerateResolvedDeploymentManifestEntryPoint"
  595. Inputs="
  596. $(MSBuildAllProjects);
  597. @(AppConfigWithTargetPath);
  598. $(_DeploymentBaseManifest);
  599. @(ResolvedIsolatedComModules);
  600. @(_DeploymentManifestDependencies);
  601. @(_DeploymentResolvedManifestEntryPoint);
  602. @(_DeploymentManifestFiles)"
  603. Outputs="@(ApplicationManifest)">
  604.  
  605.  
  606. ===================================================
  607. GenerateDeploymentManifest
  608. Generates a ClickOnce deployment manifest.
  609. An deployment manifest specifies declarative application identity and application update information.
  610. ===================================================
  611. <Target Name="GenerateDeploymentManifest"
  612. DependsOnTargets="GenerateApplicationManifest"
  613. Inputs="
  614. $(MSBuildAllProjects);
  615. @(ApplicationManifest)
  616. "
  617. Outputs="@(DeployManifest)">
  618.  
  619.  
  620. ===================================================
  621. PrepareForRun
  622. Copy the build outputs to the final directory if they have changed.
  623. ===================================================
  624. <Target Name="PrepareForRun"
  625. DependsOnTargets="$(PrepareForRunDependsOn)"/>
  626.  
  627.  
  628. ===================================================
  629. CopyFilesToOutputDirectory
  630. Copy all build outputs, satellites and other necessary files to the final directory.
  631. ===================================================
  632. <Target Name="CopyFilesToOutputDirectory"
  633. DependsOnTargets="
  634. ComputeIntermediateSatelliteAssemblies;
  635. _CopyFilesMarkedCopyLocal;
  636. _CopySourceItemsToOutputDirectory;
  637. _CopyAppConfigFile;
  638. _CopyManifestFiles;
  639. _CheckForCompileOutputs;
  640. _SGenCheckForOutputs">
  641.  
  642.  
  643. ===================================================
  644. GetCopyToOutputDirectoryItems
  645. Get all project items that may need to be transferred to the output directory.
  646. This includes baggage items from transitively referenced projects. It would appear
  647. that this target computes full transitive closure of content items for all referenced
  648. projects; however that is not the case. It only collects the content items from its
  649. immediate children and not children of children. The reason this happens is that
  650. the ProjectReferenceWithConfiguration list that is consumed by _SplitProjectReferencesByFileExistence
  651. is only populated in the current project and is empty in the children. The empty list
  652. causes _MSBuildProjectReferenceExistent to be empty and terminates the recursion.
  653. ===================================================
  654. <Target Name="GetCopyToOutputDirectoryItems"
  655. Returns="@(AllItemsFullPathWithTargetPath)"
  656. KeepDuplicateOutputs=" '$(MSBuildDisableGetCopyToOutputDirectoryItemsOptimization)' == '' "
  657. DependsOnTargets="$(GetCopyToOutputDirectoryItemsDependsOn)">
  658.  
  659.  
  660. ===================================================
  661. UnmanagedRegistration
  662. Registers the main assembly for COM interop.
  663. ===================================================
  664. <Target Name="UnmanagedRegistration"
  665. Condition="'$(RegisterForComInterop)'=='true' and '$(OutputType)'=='library'"
  666. DependsOnTargets="$(UnmanagedRegistrationDependsOn)" />>
  667.  
  668.  
  669. ===================================================
  670. IncrementalClean
  671. Remove files that were produced in a prior build but weren't produced in the current build.
  672. The reason is that if, for example, the name of the .exe has changed we want to delete the
  673. old copy.
  674.  
  675. Leave the Clean cache file containing only the files produced in the current build.
  676. ===================================================
  677. <Target Name="IncrementalClean"
  678. DependsOnTargets="_CleanGetCurrentAndPriorFileWrites">
  679.  
  680.  
  681. ===================================================
  682. Clean
  683. Delete all intermediate and final build outputs.
  684. ===================================================
  685. <Target Name="Clean"
  686. Condition=" '$(_InvalidConfigurationWarning)' != 'true' "
  687. DependsOnTargets="$(CleanDependsOn)" />
  688.  
  689.  
  690. ===================================================
  691. BeforeClean
  692. Redefine this target in your project in order to run tasks just before Clean.
  693. ===================================================
  694. <Target Name="BeforeClean"/>
  695.  
  696.  
  697. ===================================================
  698. AfterClean
  699. Redefine this target in your project in order to run tasks just after Clean.
  700. ===================================================
  701. <Target Name="AfterClean"/>
  702.  
  703.  
  704. ===================================================
  705. CleanReferencedProjects
  706. Call Clean target on all Referenced Projects.
  707. ===================================================
  708. <Target Name="CleanReferencedProjects"
  709. DependsOnTargets="AssignProjectConfiguration; _SplitProjectReferencesByFileExistence">
  710.  
  711.  
  712. ===================================================
  713. CleanPublishFolder
  714. ===================================================
  715. <Target Name="CleanPublishFolder"/>
  716.  
  717.  
  718. ===================================================
  719. PostBuildEvent
  720. Run the post-build event. This step is driven by two parameters:
  721.  
  722. (1) The $(RunPostBuildEvent) property is set by the user through the IDE and can be one of four values.
  723.  
  724. - OnBuildSuccess: In this case, every step of the build must succeed for the post-build step to run.
  725. - <Blank>: This is the same as OnBuildSuccess.
  726. - OnOutputUpdated: In this case, the post-build step will run only if the main output assembly was
  727. actually updated.
  728. - Always: The post-build step is always run.
  729.  
  730. (2) The $(_AssemblyTimestampBeforeCompile) and $(_AssemblyTimestampAfterCompile) values are
  731. set by the _TimeStampBeforeCompile and _TimeStampAfterCompile targets. If the assembly was actually
  732. rebuilt during this build, then the two values will be different.
  733. ===================================================
  734. <Target Name="PostBuildEvent"
  735. Condition="'$(PostBuildEvent)' != '' and ('$(RunPostBuildEvent)' != 'OnOutputUpdated' or '$(_AssemblyTimestampBeforeCompile)' != '$(_AssemblyTimestampAfterCompile)')"
  736. DependsOnTargets="$(PostBuildEventDependsOn)">
  737.  
  738.  
  739. ===================================================
  740. Publish
  741. This target is only called when doing ClickOnce publishing outside the IDE, which implicitly builds before publishing.
  742. ===================================================
  743. <Target Name="Publish"
  744. DependsOnTargets="$(PublishDependsOn)"/>
  745.  
  746.  
  747. ===================================================
  748. SetGenerateManifests
  749. This target simply assures the GenerateClickOnceManifests property is set whenever the publish target is invoked.
  750. ===================================================
  751. <Target Name="SetGenerateManifests"/>
  752.  
  753.  
  754. ===================================================
  755. PublishOnly
  756. The "PublishOnly" target is intended for ClickOnce publishing inside the IDE, where the build has already been done
  757. by the BuildManager.
  758. ===================================================
  759. <Target Name="PublishOnly"
  760. DependsOnTargets="$(PublishOnlyDependsOn)"/>
  761.  
  762.  
  763. ===================================================
  764. BeforePublish
  765. Redefine this target in your project in order to run tasks just before Publish.
  766. ===================================================
  767. <Target Name="BeforePublish"/>
  768.  
  769.  
  770. ===================================================
  771. AfterPublish
  772. Redefine this target in your project in order to run tasks just after Publish.
  773. ===================================================
  774. <Target Name="AfterPublish"/>
  775.  
  776.  
  777. ===================================================
  778. PublishBuild
  779. Defines the set of targets that publishing is directly dependent on.
  780. ===================================================
  781. <Target Name="PublishBuild"
  782. DependsOnTargets="$(PublishBuildDependsOn)"/>
  783.  
  784.  
  785. ===================================================
  786. AllProjectOutputGroups
  787. The targets below drive output groups, which provide generic information about a
  788. project's inputs (e.g., content files, compilation sources, etc.) and built outputs
  789. (e.g., built EXE/DLL, PDB, XML documentation files, etc.)
  790.  
  791. Each target may produce two kinds of items: outputs and dependencies. Outputs are
  792. items from the current project; dependencies are items that are brought into the
  793. current project as a result of referencing other projects or components.
  794.  
  795. For both outputs and dependencies, the Include attribute
  796. specifies the location of the output/dependency; it must be a full path. Any number
  797. of additional attributes may be placed on an output/dependency item.
  798. ===================================================
  799. <Target Name="AllProjectOutputGroups"
  800. DependsOnTargets="
  801. BuiltProjectOutputGroup;
  802. DebugSymbolsProjectOutputGroup;
  803. DocumentationProjectOutputGroup;
  804. SatelliteDllsProjectOutputGroup;
  805. SourceFilesProjectOutputGroup;
  806. ContentFilesProjectOutputGroup;
  807. SGenFilesOutputGroup"/>
  808.  
  809.  
  810. ===================================================
  811. BuiltProjectOutputGroup
  812. This target performs population of the Build project output group.
  813. ===================================================
  814. <Target Name="BuiltProjectOutputGroup"
  815. Returns="@(BuiltProjectOutputGroupOutput)"
  816. DependsOnTargets="$(BuiltProjectOutputGroupDependsOn)">
  817.  
  818.  
  819. ===================================================
  820. DebugSymbolsProjectOutputGroup
  821. This target performs population of the Debug Symbols project output group.
  822. ===================================================
  823. <Target Name="DebugSymbolsProjectOutputGroup"
  824. Returns="@(DebugSymbolsProjectOutputGroupOutput)"
  825. DependsOnTargets="$(DebugSymbolsProjectOutputGroupDependsOn)"/>
  826.  
  827.  
  828. ===================================================
  829. DocumentationProjectOutputGroup
  830. This target performs population of the Documentation project output group.
  831. ===================================================
  832. <Target Name="DocumentationProjectOutputGroup"
  833. Returns="@(DocumentationProjectOutputGroupOutput)"
  834. DependsOnTargets="$(DocumentationProjectOutputGroupDependsOn)"/>
  835.  
  836.  
  837. ===================================================
  838. SatelliteDllsProjectOutputGroup
  839. This target performs population of the Satellite Files project output group.
  840. ===================================================
  841. <Target Name="SatelliteDllsProjectOutputGroup"
  842. Returns="@(SatelliteDllsProjectOutputGroupOutput)"
  843. DependsOnTargets="$(SatelliteDllsProjectOutputGroupDependsOn)">
  844.  
  845.  
  846. ===================================================
  847. SourceFilesProjectOutputGroup
  848. This target performs population of the Source Files project output group.
  849. Source files are items in the project whose type is "Compile" and "EmbeddedResource".
  850. ===================================================
  851. <Target Name="SourceFilesProjectOutputGroup"
  852. Returns="@(SourceFilesProjectOutputGroupOutput)"
  853. DependsOnTargets="$(SourceFilesProjectOutputGroupDependsOn)">
  854.  
  855.  
  856. ===================================================
  857. ContentFilesProjectOutputGroup
  858. This target performs population of the Content Files project output group.
  859. Content files are items in the project whose type is "Content".
  860. ===================================================
  861. <Target Name="ContentFilesProjectOutputGroup"
  862. Returns="@(ContentFilesProjectOutputGroupOutput)"
  863. DependsOnTargets="$(ContentFilesProjectOutputGroupDependsOn)">
  864.  
  865.  
  866. ===================================================
  867. SGenFilesOutputGroup
  868. This target performs population of the GenerateSerializationAssemblies Files project output group.
  869. GenerateSerializationAssemblies files are those generated by the GenerateSerializationAssemblies target and task.
  870. ===================================================
  871. <Target Name="SGenFilesOutputGroup"
  872. Returns="@(SGenFilesOutputGroupOutput)"
  873. DependsOnTargets="$(SGenFilesOutputGroupDependsOn)"/>
  874.  
  875.  
  876. ===================================================
  877. GetResolvedSDKReferences
  878. These targets are to gather information from the SDKs.
  879. ===================================================
  880. <Target Name="GetResolvedSDKReferences"
  881. DependsOnTargets="ResolveSDKReferences"
  882. Returns="@(ResolvedSDKReference)"/>
  883.  
  884.  
  885. ===================================================
  886. PriFilesOutputGroup
  887. This target performs population of the pri files output group
  888. ===================================================
  889. <Target Name="PriFilesOutputGroup"
  890. Condition="'@(_ReferenceRelatedPaths)' != ''"
  891. DependsOnTargets="BuildOnlySettings;PrepareForBuild;AssignTargetPaths;ResolveReferences"
  892. Returns="@(PriFilesOutputGroupOutput)">
  893.  
  894.  
  895. ===================================================
  896. SDKRedistOutputGroup
  897. This target gathers the Redist folders from the SDKs which have been resolved.
  898. ===================================================
  899. <Target Name="SDKRedistOutputGroup"
  900. Returns="@(SDKRedistOutputGroupOutput)"
  901. DependsOnTargets="$(SDKRedistOutputGroupDependsOn)"/>
Advertisement
Add Comment
Please, Sign In to add comment