Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Created attachment 15404 [details]
Cannot use XamlC with OnPlatform in resources, the XF throws following exception (on both iOS and Android)
System.InvalidCastException: Specified cast is not valid.
at xamlcomptest.MainView.InitializeComponent () [0x00172] in <filename unknown>:0
at xamlcomptest.MainView..ctor () [0x00008] in /Users/prashantvc/Desktop items/Xamarin/309509/xamlcomptest/xamlcomptest/MainView.xaml.cs:12
at xamlcomptest.App..ctor () [0x0000e] in /Users/prashantvc/Desktop items/Xamarin/309509/xamlcomptest/xamlcomptest/App.xaml.cs:14
at xamlcomptest.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication app, Foundation.NSDictionary options) [0x00007] in /Users/prashantvc/Desktop items/Xamarin/309509/xamlcomptest/iOS/AppDelegate.cs:17
at at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string,intptr,intptr)
at UIKit.UIApplication.Main (System.String args, IntPtr principal, IntPtr delegate) [0x00005] in /Users/builder/data/lanes/2966/58ba2bc3/source/maccore/src/UIKit/UIApplication.cs:77
at UIKit.UIApplication.Main (System.String args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/2966/58ba2bc3/source/maccore/src/UIKit/UIApplication.cs:61
at xamlcomptest.iOS.Application.Main (System.String args) [0x00008] in /Users/prashantvc/Desktop items/Xamarin/309509/xamlcomptest/iOS/Main.cs:17
# Steps to reproduce
- Create Xamarin.Forms project
- Setup XAML ResourceDictionary
- Define a value using OnPlatform
- Reference the value in XAML
- Enable XamlCompilation
- Download and run the attached test case
# Using Xamarin.Forms version 184.108.40.20629
Should be fixed in 2.3.0-pre1
I have checked this issue with the XF 220.127.116.11-pre2 and observed that this issue has been fixed and no longer exist with this version of XF. Now user is able to run attached test same successfully without any exception.
This issue has been fixed, hence I am closing this issue.
I have update the Xamarin Forms to 18.104.22.168, but this issue still exist.
I checked this issue with Xamarin.Forms 22.214.171.124 and using attached sample in bug description. and this issue is working fine at my end.
@David, Could you please let me know some more information regarding your issue or Please file a separate bug for the same.