Skip to content

Commit 3255b50

Browse files
committed
Ensure GetVersion runs prior to XAML's Markup Compiler
The XAML Markup Compiler (from PresentationBuildTasks via target "MarkupCompilePass1") generates C# code which loads the XAML at run time from a managed resource. This resource is identified by an URI, containing the assembly where the resource is embedded and the path towards it. Without the "AssemblyVersion" property being set, this URI contains only the simple assembly name, without version information. This works as long as the assembly is only loaded once. However, in e.g. advanced plugin scenarios it may happen that the same (strong named) assembly is loaded several times in different versions. In those cases the XAML resource can only be located when the version information is available in the URI. This fixes #1465.
1 parent 3293afc commit 3255b50

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/GitVersionTask/NugetAssets/build/functionality/GitVersionCommon.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@
2626
<GetVersion Condition=" '$(GetVersion)' == '' and '$(NCrunch)' != '' ">false</GetVersion>
2727
<GetVersion Condition=" '$(GetVersion)' == '' ">true</GetVersion>
2828

29+
<!--
30+
Ensure GetVersion runs prior to XAML's Markup Compiler in order to have the assembly version available.
31+
Otherwise the generated resource URI's are ambiguous when multiple versions are loaded simultaneously (i.e. in plugins)
32+
-->
33+
<MarkupCompilePass1DependsOn>$(MarkupCompilePass1DependsOn);GetVersion</MarkupCompilePass1DependsOn>
34+
2935
<GetPackageVersionDependsOn>$(GetPackageVersionDependsOn);GetVersion</GetPackageVersionDependsOn>
3036

3137
<!-- Property that enables setting of Version -->

0 commit comments

Comments
 (0)