<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM64'"> <DebugSymbols>true</DebugSymbols> <OutputPath>bin\ARM64\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP;CODE_ANALYSIS</DefineConstants> <NoWarn>;2008</NoWarn> <NoStdLib>true</NoStdLib> <DebugType>full</DebugType> <PlatformTarget>ARM64</PlatformTarget> <UseVSHostingProcess>false</UseVSHostingProcess> <ErrorReport>prompt</ErrorReport> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <DisableWin2DPlatformCheck>true</DisableWin2DPlatformCheck> <Use64Bitcompiler>true</Use64Bitcompiler> <SingleThreadNUTC>true</SingleThreadNUTC> </PropertyGroup> |
when I run the app, it crashes with NULLReferenceException when I set the datasource of a SfDataPager:
System.NullReferenceException: Object reference not set to an instance of an object. at Syncfusion.SfDataGrid.XForms.GridColumnSizer.GetHeaderCellWidth(GridColumn) + 0x1a4 at Syncfusion.SfDataGrid.XForms.GridColumnSizer.CalculateHeaderWidth(GridColumn, Boolean) + 0x44 at Syncfusion.SfDataGrid.XForms.GridColumnSizer.GetColumnAutoSizeWidth(GridColumn) + 0x4c at Syncfusion.SfDataGrid.XForms.GridColumnSizer.SetColumnWidthBasedOnGridColumnSizer(Double, List`1, GridColumn, Double) + 0x26c at Syncfusion.SfDataGrid.XForms.GridColumnSizer.CalculateColumnSizerWidth(Double) + 0xeac at Syncfusion.SfDataGrid.XForms.GridColumnSizer.Refresh(Double) + 0x94 at Syncfusion.SfDataGrid.XForms.GridColumnSizer.Refresh(Boolean) + 0x190 at Syncfusion.SfDataGrid.XForms.SfDataGrid.OnItemsSourceChanged(BindableObject, Object, Object) + 0xa18 at Xamarin.Forms.BindableProperty.BindingPropertyChangedDelegate.InvokeOpenStaticThunk(BindableObject, Object, Object) + 0x9c at Xamarin.Forms.BindableProperty.BindingPropertyChangedDelegate.Invoke(BindableObject, Object, Object) + 0xb4 at Xamarin.Forms.BindableObject.SetValueActual(BindableProperty, BindableObject.BindablePropertyContext, Object, Boolean, SetValueFlags, Boolean) + 0x450 at Xamarin.Forms.BindableObject.SetValueCore(BindableProperty, Object, SetValueFlags, BindableObject.SetValuePrivateFlags) + 0x5f8 at Xamarin.Forms.BindableObject.SetValue(BindableProperty, Object, Boolean, Boolean) + 0x1a8 at Xamarin.Forms.BindableObject.SetValue(BindableProperty, Object) + 0x40 at Syncfusion.SfDataGrid.XForms.SfDataGrid.set_ItemsSource(Object) + 0x5c |
I'll analyze this more.
ColumnSizer="Auto" SelectionMode="Single" VerticalOverScrollMode="None"> |
I use latest XF 4.4.0.991537. And I set source via
DataPager.Source = list;
DataGrid.ItemsSource = DataPager.PagedSource;
I finally fixed it. The Release mode issue in UWP platform entry in Getting Started is incomplete.
I included both lines, but that was NOT enough.
I see that the SfDataGrid has the dependency Syncfusion.Xamarin.SfComboBox, so I needed to add this line:
assembliesToInclude.Add(typeof(Syncfusion.XForms.UWP.ComboBox.SfComboBoxRenderer).GetTypeInfo().Assembly);
Now
the app runs fine in Debug and Release mode for ARM64, because unlike
x86/x64 for ARM configurations, .NET Native is used even in debug!!!!
So,
you need to update the documentation and check all dependencies and
update the codelines. Your demo did not trigger the load of SfComboBox,
while my app does it, even if I don't use a Combobox, maybe this is
triggered from my model as I use public virtual TYPE PropertyName { get;
set; }. And because the the Combobox is not loaded I get
NullReferenceException.
.NET Native is a precompilation technology for building and deploying Windows apps that is included with Visual Studio 2015 and later versions. It automatically compiles the release version of apps that are written in managed code (C# or Visual Basic) and that target the .NET Framework and Windows 10 to native code.