xamarin/xamarin-forms-book-samples

Chapter 8 ColorViewList: Unhandled Exception

Opened this issue · 1 comments

I'm getting an unhandled exception when trying to deploy the ColorViewList program with the following message:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.

It breaks at line 21 of the .g.cs file this.LoadFromXaml(typeof(ColorViewListPage));
I have Xamarin C8 / 4.2.0.680 installed for Visual Studio 2015 which was released only a few days ago and other projects in the chapter deploy ok.

I changed line 25 of the ColorView.xaml.cs file from ColorTypeConverter colorTypeConv = new ColorTypeConverter(); to Color color = (Color)colorTypeConv.ConvertFromInvariantString(colorName); as visual studio was highlighting that ConvertFrom() is now obsolete. The example then deployed successfully.