System.ArgumentException: <Timeout exceeded getting exception details> Xamarin.Forms

This one is quite subtle and hard to catch (well, actually it isn't hard to catch; just put a try/catch around InitializeComponent and you can examine the exception).

XAML is declarative which makes us believe that the order of attributes of a control does not matter. Unfortunately, since at some point the declarative XAML will be turned into a sequence of property assignments, the order of attributes does matter and it's the order of your Slider attributes that is causing your exception to be thrown.

You can imagine your Slider being constructed the following way:

var slider = new Slider();
slider.Minimum = 16;
slider.Maximum = 45;
...

But Slider.Minimum and Slider.Maximum seem to check if the values passed are valid.

When your code begins, the value of Maximum defaults to 0. But before its value can be assigned, Minimum's value is assigned a value of 16.

At this moment your Minimum value (16) is greater than the default Maximum value (0) and hence an ArgumentOutOfRangeException is thrown.

To solve it, just set the Maximum before the Minimum value and it does work.


As @Paul mentioned. Wrap it with try-catch and it gives more details about the exception. I spent few hours before figuring out to do that