New to Telerik UI for .NET MAUIStart a free 30-day trial

Resolving Managed Vtable Types NotSupportedException with Telerik .NET MAUI SkiaSharp controls on Windows

Updated over 6 months ago

Environment

ProductDataGrid, BusyIndicator, Gauge and other Telerik controls rendered through SkiaSharp

Description

This article describes how to resolve the following error on Windows:

bash
System.NotSupportedException: Managed vtable types (ie. containing any reference types) are not supported.

This exception occurs when:

  • You are using any of the Telerik .NET MAUI SkiaSharp controls, such as DataGrid, BusyIndicator, Gauge; and

  • you've updated Visual Studio 2022 to Version 17.11.5; or

  • you're using the CommunityToolkit and have explicitly set the Windows SDK version in the .csproj file due to its requirement, such as:

XML
<WindowsSdkPackageVersion>10.0.19041.41</WindowsSdkPackageVersion>

Cause

The exception is related to a known issue in the SkiaSharp library with WindowsSdkPackageVersion 10.0.19041.38 and above:

https://github.com/mono/SkiaSharp/issues/2999

Solution

To resolve this issue, update the .NET Windows SDK version in your project. Modify the project file (.csproj) to include the following line, which specifies a version of the Windows SDK where the issue has been fixed:

XML
<WindowsSdkPackageVersion>10.0.19041.54</WindowsSdkPackageVersion>

By adding this line to your project file, you ensure that your application uses a version of the Windows SDK that includes the necessary fix for the NotSupportedException related to managed vtable types.

See Also