Reputation: 120
Due to code merge issues, or accidentally mistyping in a XAML file it is possible for it to have errors to the extent that the XAML is not even valid XML...
e.g. note the missing <
on the middle line
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
ResourceDictionary Source="pack://application:,,,/Lovely.UI.Wpf.Themes;component/Theme.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
Our build system (Azure DevOps) will happily build the executable. Even locally, we only get errors if the XAML is open in the designer...
Is it possible to promote malformed XAML files to be a build error to help with the accidental key press or merge issues that sometimes occur?
Note: We are fairly up to date and are using build profiles e.g. YAML steps: - task: VSBuild@1
I would have to check exactly which version of the Compiler it using, but it is at least VS2017.
I am not the Dev Ops admin, so cannot answer too many questions on the Server side. To be honest if there was a local build (VS2019) switch that could tell me there was broken XAML during a full rebuild, that would help me sleep at night :-)
Upvotes: 1
Views: 113
Reputation: 169200
Unfortunately the compiler doesn't detect this kind of errors and this has nothing to do with Azure DevOps.
When the compiled BAML is parsed at runtime, you will get an exception though so make sure to test running the app before releasing it.
To be honest if there was a local build (VS2019) switch that could tell me there was broken XAML during a full rebuild, that would help me sleep at night :-)
I am afraid it isn't :(
Upvotes: 1