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

Tags:
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:
Status:
RESOLVED FIXED

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.

StackTrace
   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 2.0.0.6490.
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 2.0.0.6490
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 2.0.1.6505 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