How to overcome the crash System.Reflection.MissingRuntimeArtifactException when UseDotNetNativeToolChain is enabled
While compiling the application using SfDataGrid with UseDotNetNativeToolChain (.Net Native Tool Chain) enabled, you will get the crash “System.Reflection.MissingRuntimeArtifactException” when you sort any column in our 13.4 and its previous version. This issue was fixed in our 13.4 Service pack1 release.
You can overcome this problem in older versions by adding the below directives under Default.rd.xml file in the application,
<Library Name="Syncfusion.Data.UWP"> <Type Name="System.Linq.EnumerableExecutor{System.Int32}" Dynamic="Required Public" /> <Type Name="System.Collections.ObjectModel.ObservableCollection{}" Dynamic="Required Public" /> <Namespace Name="System.Linq" Dynamic="Required All" /> <Type Name="System.Linq.Queryable"> <!--Sorting, Filtering operations for integer type--> <MethodInstantiation Name="OrderBy" Arguments="Syncfusion.Data.Extensions.QueryableExtensions,System.Int32" Dynamic="Required" /> <MethodInstantiation Name="OrderByDescending" Arguments="Syncfusion.Data.Extensions.QueryableExtensions,System.Int32" Dynamic="Required" /> <MethodInstantiation Name="ThenBy" Arguments="Syncfusion.Data.Extensions.QueryableExtensions,System.Int32" Dynamic="Required" /> <MethodInstantiation Name="ThenByDescending" Arguments="Syncfusion.Data.Extensions.QueryableExtensions,System.Int32" Dynamic="Required" /> <!--Sorting, Filtering operations for integer nullable type--> <MethodInstantiation Name="OrderBy" Arguments="Syncfusion.Data.Extensions.QueryableExtensions,System.Nullable{System.Int32}" Dynamic="Required" /> <MethodInstantiation Name="OrderByDescending" Arguments="Syncfusion.Data.Extensions.QueryableExtensions,System.Nullable{System.Int32}" Dynamic="Required" /> <MethodInstantiation Name="ThenBy" Arguments="Syncfusion.Data.Extensions.QueryableExtensions,System.Nullable{System.Int32}" Dynamic="Required" /> <MethodInstantiation Name="ThenByDescending" Arguments="Syncfusion.Data.Extensions.QueryableExtensions,System.Nullable{System.Int32}" Dynamic="Required" /> </Type> </Library>
You can add the directives in rd.xml file when you are facing issues with reflection.
https://dotnet.github.io/native/troubleshooter/method.html