We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

SfCalendar load generates exception on Xamarin UWP

Hi,

I try to implement the SfCalendar in a Xamarin.Forms App with Android, iOS, and UWP. I followed the instructions from the online documentation - getting started section. On Android and iOS it works perfectly, on UWP I get the following exception when the XAML page loads:

System.NullReferenceException: Object reference not set to an instance of an object.
   at Syncfusion.UI.Xaml.Controls.Input.SfCalendar.SfCalendar_HeaderLoadedEvent(DataTemplate dataTemplate)
   at Syncfusion.UI.Xaml.Controls.Input.SfCalendar.CalendarLoaded(Object sender, RoutedEventArgs e)

SfCalendar Version 14.3.0.49
Xamarin Forms 2.3.2.127

XAML:

<xForms:SfCalendar x:Name="SfCalendar" ViewMode="MonthView" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"/>

Code on page initialization:

SfCalendar.MaxDate = DateTime.Now.AddDays(100);
SfCalendar.MinDate = DateTime.Now;

Referenced DLL's in UWP project (14.3.0.49):

Syncfusion.SfInput.UWP.dll
Syncfusion.SfShared.UWP.dll
Syncfusion.SfCalendar.XForms.dll
Syncfusion.SfCalendar.XForms.UWP.dl

Is there anything I missed to initialize for UWP?

Another issue I found is, that the Xamarin SfCalendar NuGet Package only contains the dll's for Android and iOS, not for UWP.

Thanks for your help
Rudy


15 Replies

RG Rajkumar Ganesamoorthy Syncfusion Team October 28, 2016 07:46 AM UTC

Hi Rudy,

Thanks for contacting Syncfusion Support.

We have checked your reported issue in our side based on your provided details but we were unable to reproduce your reported issue in our side. Please find the sample in which we check your reported issue in our side in below

Sample: http://www.syncfusion.com/downloads/support/forum/127139/ze/App41966774635 

So could you please provide issue reproducing sample with complete stack trace details that will help us to provide appropriate solution on this.

Regards,
Rajkumar G 



RM Rudy Marki October 29, 2016 11:32 PM UTC

Hi Rajkumar,

I have downloaded your sample and run it. First it trapped in App.g.i.cs with the same exception as described in the initial post:



After a cleanup and rebuild the App runs and the calendar is displayed, but I still get exceptions in the event log when I run it:




Also if I do not initialize the date range of the SfCalendar then it generates the following exceptions and gets trapped in App.g.i.cs as shown above:




I don't know why there are System.IO.FileNotFoundException's, I get them also on newly created Xamarin UWP projects.

Regards
Rudy


RG Rajkumar Ganesamoorthy Syncfusion Team November 1, 2016 12:47 PM UTC

Hi Rudy,

Thanks for your update.

Query 1: "Resource Map not found exception"

Currently we are analyzing the reported issue "Resource Map not found exception" in our side. We will update more details on November 3,2016.

Query 2: "Invalid operation exception"

We have checked your reported issue in our side. But we were unable to reproduce your reported issue. So could you please provide issue reproducing sample , that will help us to provide appropriate solution on this.

Regards,
Rajkumar G


RG Rajkumar Ganesamoorthy Syncfusion Team November 3, 2016 01:36 PM UTC

Hi Rudy,

Query : "Resource Map not found exception"

This is an internal exception, which is raised for Localization purpose. In SfCalendar, Localization input is maintained as resource map file and this exception will be raised as it is not found and it will not cause any impacts/crash to application. So you can ignore the exception .

Regards,
Rajkumar G
 



RM Rudy Marki November 7, 2016 12:29 AM UTC

Hi Rajkumar.

Query 2: "Invalid operation exception"

In the sample you have provided I commented out these two lines in Page1.xaml.cs:

            //calendar.MaxDate = DateTime.Now.AddDays(100);
            //calendar.MinDate = DateTime.Now;

Then rebuild and run it. The App stops with an unhandled exception:






I have uploaded the solution.

Best Regards
Rudy


Attachment: App4_6f134c87.zip


RG Rajkumar Ganesamoorthy Syncfusion Team November 7, 2016 10:14 AM UTC

Hi Rudy,

Thanks for your update.

We have analyzed the reported issue by using the provided sample in our side but  we were unable to reproduce the reported issue. We have attached sample with assemblies in which we check our end in below


 
So could you please check the reported issue by using the assemblies attached in sample and let us know about the issue still persists or not.

Regards,
Rajkumar G



RM Rudy Marki November 10, 2016 06:22 AM UTC

Hi Rajkumar,

I have downloaded your solution and used the assemblies from the provided DLL folder. I still have the same behavior.

I thought maybe its my development environment and uninstalled all Windows 10 SDK's and re-installed them. Still the same behavior.

Here the installed Versions:



Best Regards
Rudy



RG Rajkumar Ganesamoorthy Syncfusion Team November 11, 2016 12:10 PM UTC

Hi Rudy,

Thank you for contacting Syncfusion Support.

We have created a new support incident under your account to track the status of your latest query. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Please let us know, if you have any query.

Regards,
Rajkumar G


CA Casey February 24, 2018 04:53 AM UTC

I have the same exact problem, Version 16.1.0.24.  I have a sample solution, using a mvvm pattern.  When a calendar date is clicked, it is handled by the Handle_SelectionChanged(), which then attempts to set a property in the view model. It is the setting of the property that causes the problem.

I'm unable to upload the 13 MB solution zip file, can you contact me to get it?





SS Sridevi Sivakumar Syncfusion Team February 26, 2018 12:40 PM UTC

 Hi Casey, 
Thank you for contacting Syncfusion support.

Query: SfCalendar generates exception on Xamarin UWP 
 We were able to reproduce the reported issue from our side. We have logged a defect report regarding the same. And the fix for the same has been updated in the incident that has been created in your Account.

Link: https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents/  
Regards,
Sridevi S. 



JO James Oliver May 5, 2019 06:45 PM UTC

This is logged using SfCalendar 17.1.0.43 when the calendar is initially displayed:

Exception thrown: 'System.Exception' in Syncfusion.SfInput.UWP.dll
WinRT information: ResourceMap Not Found.

My app then crashes when a date is selected:

Exception thrown: 'System.NullReferenceException' in Syncfusion.SfCalendar.XForms.UWP.dll
Exception thrown: 'System.NullReferenceException' in Syncfusion.SfInput.UWP.dll
Exception thrown: 'System.NullReferenceException' in Syncfusion.SfInput.UWP.dll
The program '[21400] UWP.exe: Program Trace' has exited with code 0 (0x0).
The program '[21400] UWP.exe' has exited with code -1073741189 (0xc000027b).
The program '[21400] UWP.exe: Managed (CoreCLR)' has exited with code -1 (0xffffffff).

When using 15.4.0.20 and no other code change, an error is logged in output, but the UI functions as expected and the date is successfully picked.


SP Subburaj Pandian Veluchamy Syncfusion Team May 6, 2019 12:09 PM UTC

Hi James, 
 
Thank you for contacting Syncfusion support. 
 
Query 1: Throws exception with SfInput 
Based on provided information, we have checked the mentioned exception “System.Exception in Syncfusion.SfInput.UWP.dll” in Calendar Xamarin.Forms(UWP) and it is working fine from our end. We have tested with our latest Syncfusion update version 17.1.0.38 (2019 Vol 1) and we unable to replicate the exception from our end. 
 
We have attached the tested sample for your reference, 
 
 
Query 2: Regarding the error in output window on version 15.4.0.20 
This mentioned issue not occurring in the latest update version 17.1.0.38 (2019 Vol 1) and it is occurs only in 15.4.0.20. We have fixed this issue in the later versions.  
 
Please check the sample and let us know if you still facing the same issue? If not, please modify the sample based on your scenario and revert us with the more details. It will be helpful for us to check on it and provide you the solution at the earliest. 
 
Regards,
Subburaj Pandian V 



JO James Oliver May 7, 2019 04:49 PM UTC

Thank you for your quick response.
The problem is seen when navigating back to the prior page after selecting a date and calling "Navigation.PopAsync(true)" in the action handler method.  I have modified the provided example to have MainPage navigate to SfCalendarPage.  Clicking a date is expected to return to MainPage but instead logs the following:

Exception thrown: 'System.Runtime.InteropServices.COMException' in Syncfusion.SfInput.UWP.dll
WinRT information: ResourceMap Not Found.

Exception thrown: 'System.Runtime.InteropServices.COMException' in Syncfusion.SfInput.UWP.dll
WinRT information: ResourceMap Not Found.

Exception thrown: 'System.Runtime.InteropServices.COMException' in Syncfusion.SfInput.UWP.dll
WinRT information: ResourceMap Not Found.

Exception thrown: 'System.Runtime.InteropServices.COMException' in Syncfusion.SfInput.UWP.dll
WinRT information: ResourceMap Not Found.

Exception thrown: 'System.Runtime.InteropServices.COMException' in Syncfusion.SfInput.UWP.dll
WinRT information: ResourceMap Not Found.

SfCalendarPage.xaml.Handle_OnCalendarTapped SelectedDate = 05/27/2019

     <<  Above displayed when Calendar is first displayed  >>
     <<  Below displayed when a date is clicked and app hard crashes  >>

Exception thrown: 'System.NullReferenceException' in Syncfusion.SfCalendar.XForms.UWP.dll
Exception thrown: 'System.NullReferenceException' in Syncfusion.SfInput.UWP.dll
Exception thrown: 'System.NullReferenceException' in Syncfusion.SfInput.UWP.dll



Attachment: CalendarUWPSample1437902364_mod_e3f0e007.zip


SP Subburaj Pandian Veluchamy Syncfusion Team May 8, 2019 12:17 PM UTC

Hi James, 
  
Thank you for the update. 
  
We can able to replicate the mentioned issue “Selecting a date and back prior to the page, it shows the exception” in Calendar Xamarin.Forms (UWP). Currently we are analyzing the same, we will validate and let you know the details in two business days (May 10, 2019). We appreciate your patience until then. 
 
Regards,
Subburaj Pandian V 



SP Subburaj Pandian Veluchamy Syncfusion Team May 10, 2019 12:58 PM UTC

Hi James, 
 
Thank you for your patience. 
 
Query 1: We have fixed the issue “Selecting a date and back prior to the page, it shows the exception” and the issue fix will be included in our upcoming Weekly NuGet update which is expected to be available by May 21, 2019 and appreciate your patience until then. Please let us know if you need patch earlier.  
 
Query 2: Regarding the exception “System.Runtime.InteropServices.COMException”, as per the calendar implementation for handling localization we need to add Resource file for custom string. When you are not handling the localization, mentioned exception will be thrown in output window and it is an expected one.   
 
Kindly, refer the below UG link for adding resource file in sample, 
 
We hope that this helps you, kindly revert us if you have any concern. 
 
Regards,
Subburaj Pandian V   


Loader.
Up arrow icon