Bug 58485 - Error MCG0024 in .NET Stardard Forms UWP Project.
Summary: Error MCG0024 in .NET Stardard Forms UWP Project.
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 2.3.5
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-07-29 17:09 UTC by Gian Maria B
Modified: 2017-10-02 14:10 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

2 solutions: OK and ERR (737.63 KB, application/x-zip-compressed)
2017-07-29 17:09 UTC, Gian Maria B

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Gian Maria B 2017-07-29 17:09:40 UTC
Created attachment 23901 [details]
2 solutions: OK and ERR

I create a blank empty (VS 2017 last update) Xamarin.Forms ( PCL solution, then I changed it to .NET Standard 1.4 (see https://blog.xamarin.com/building-xamarin-forms-apps-net-standard) and it builds correctly in debug and release mode (see attachement OK). 
Then I add Nuget Package Syncfusion.Xamarin.SfDataGrid ( (see attachement ERR) and when I rebuild the UWP project I get the error:

MCG0024:UnresolvableTypeReference Unresolvable type reference 'Xamarin.Forms.Platform.UWP.FormsDatePicker' in 'Assembly(Name=Xamarin.Forms.Platform.UAP, Version=, Culture=neutral, PublicKeyToken=null)' found. Please check the references in your build system. A reference is either missing or an assembly is missing an expected type.

If I uncheck "Compile with .NET Native tool chain" (UWP project properties) the build is OK but the Create App Package will fail with the same error
Comment 1 Jimmy [MSFT] 2017-07-31 20:31:02 UTC
It looks like the FormsDatePicker class for WinRT/UWP is removed in 2.3.5: https://github.com/xamarin/Xamarin.Forms/pull/731

The is probably being caught during build when ".NET Native toolchain" is enabled because of the analysis it does in order to compile to native code, but there is likely a runtime exception thrown instead when running debug builds.

Syncfusion will need to update their control so it does not use FormsDatePicker so I would recommend reaching out to them about this. In the meantime you can continue to use the Xamarin.Forms package instead and I will make sure this is noted in future release notes as this is a breaking change. Thank you!