Using: - Visual Studio 2019 16.4.4 Version 4.8.03752. - Project .Net Core 3.1 With WPF
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWPF>true</UseWPF>
<Platforms>AnyCPU;x64</Platforms>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Toolkit.Wpf.UI.Controls" Version="6.0.0" />
<PackageReference Include="Microsoft.Toolkit.Wpf.UI.XamlHost" Version="6.0.0" />
<PackageReference Include="Microsoft.VCRTForwarders.140" Version="1.0.5" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PtdcFieldView\PtdcFieldView.csproj" />
</ItemGroup>
</Project>
I receive an error from the XAML Designer :
Catastrophic failure.
WindowsXamlManager and DesktopWindowXamlSource are supported for apps targeting Windows version 10.0.18226.0 and later. Please check either the application manifest or package manifest and ensure the MaxTestedVersion property is updated.
Please note that Microsoft message is totally awkward because "MaxTestedVersion" is "maxversiontested" in project Manifest and it is, as far as I understand, the minimum version required.
With this code:
<Window x:Class="PtdcGui.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:PtdcGui"
xmlns:ptdcfieldview="clr-namespace:PtdcFieldView;assembly=PtdcFieldView"
xmlns:maps="clr-namespace:Windows.UI.Xaml.Controls.Maps;assembly=Windows.Foundation.UniversalApiContract"
xmlns:controls="clr-namespace:Microsoft.Toolkit.Wpf.UI.Controls;assembly=Microsoft.Toolkit.Wpf.UI.Controls"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid Grid.Row="0"> <!--<maps:MapControl/>--> </Grid>
<Grid Grid.Row ="1"> <controls:MapControl x:Name="MyMapControl" /> </Grid>
</Grid>
</Window>
Question :
- Why do I get an error from the XAML Designer although the code is compiling fine and running fine?
- Why I can't acces my control with it's name from code behind? (This question if fixed, I had to reboot Visual Studio)