In the spirit of a solution found should be shared, I am getting the following error when building a WPF project using TFS. The project would build fine on the local dev machine, as well as on the build server using VS or msbuild, just not when it was built via TFS.
error MC4108: The root of a Template
content section cannot contain an
element of type ‘{0}’. Only
FrameworkElement and
FrameworkContentElement types are
valid.
It is pointing to a custom control contained within a data template:
<Window.Resources>
<DataTemplate x:Key="TabItemTemplate">
<d:ConnectionControl />
</DataTemplate>
</Window.Resources>
The workaround that I found was to wrap the custom control in a Grid:
I guess it’s not a bad workaround, but the markup in the question should have worked.