Bug 36312 - DataTemplate bug when activating XamlCompile
Summary: DataTemplate bug when activating XamlCompile
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 2.0.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-11-27 10:42 UTC by Erik Renaud
Modified: 2016-02-20 17:54 UTC (History)
6 users (show)

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

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 Erik Renaud 2015-11-27 10:42:06 UTC
When i turn on XamlCompile and run using the Windows Phone 8.1 RT project, i get a MethodAccessException.

Attempt by method 'XXX.Views.Tabs.TodoPage.InitializeComponent()' to access method 'Xamarin.Forms.DataTemplate..ctor()' failed.

   at XXX.Views.Tabs.TodoPage.InitializeComponent()
   at XXX.Views.Tabs.TodoPage..ctor()
Comment 1 Stephane Delcroix 2015-11-27 15:15:27 UTC
This should have been solved already, but might not have been released yet. Could you please attach a reproduction project so we can make sure it's fixed, and take action if it is not ?
Comment 2 mario.rasch.ext 2015-12-03 12:03:24 UTC
I just like to confirm that this problem is still not fixed in Xamarin.Forms
Comment 3 Alberto Diaz Martin 2015-12-23 20:38:51 UTC
We have the same problem after upgrade from version 1.4 to 2.0. 

iOS and Android client work well but Windows Phone client has the same Exception loading a view with DataTemplate and Binding. 

any help?
Comment 4 Khusan 2016-01-10 23:18:47 UTC
Same issue here with Windows Phone 8.1 RT project, Xamarin.Forms
Comment 5 Khusan 2016-02-19 00:45:14 UTC
Its so easy to reproduce why would you need project, just use bellow code with Windows RT 
[assembly: XamlCompilation(XamlCompilationOptions.Compile)]
Comment 6 Matt 2016-02-20 15:06:24 UTC
I can confirm that I'm having this same problem with Xamarin.Forms package version and Windows Phone 8.1 Universal project. If I comment out the compile assembly attribute, all is well. Add it back in and this error occurs.
Comment 7 Stephane Delcroix 2016-02-20 17:54:32 UTC
this was fixed in 2.1.0-pre4