Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Xamarin Forms UWP System.ArgumentException

$
0
0

Hi, I'm working on Xamarin Forms project with custom map renderers on all three platforms. I'm using bindable properties to pass data to the renderers. It works fine on IoS and Android but not on UWP. I've done a significant amount of debugging. The UWP exceptions have no line numbers, at least in this case. I'm getting a System.ArgumentException -- value does not fall within the expected range. The one time I was able to get Visual Studio debugger to throw a meaningful stacktrace pointing to code in the project, I got this:

at Windows.UI.Xaml.UIElement.Measure(Size availableSize)
at Xamarin.Forms.Platform.UWP.VisualElementRenderer`2.GetDesiredSize(Double widthConstraint, Double heightConstraint)
at Xamarin.Forms.Platform.UWP.Platform.GetNativeSize(VisualElement element, Double widthConstraint, Double heightConstraint)
at Xamarin.Forms.VisualElement.OnSizeRequest(Double widthConstraint, Double heightConstraint)
at Xamarin.Forms.VisualElement.GetSizeRequest(Double widthConstraint, Double heightConstraint)
at Xamarin.Forms.VisualElement.Measure(Double widthConstraint, Double heightConstraint, MeasureFlags flags)
at Xamarin.Forms.StackLayout.CalculateNaiveLayout(LayoutInformation layout, StackOrientation orientation, Double x, Double y, Double widthConstraint, Double heightConstraint)
at Xamarin.Forms.StackLayout.CalculateLayout(LayoutInformation layout, Double x, Double y, Double widthConstraint, Double heightConstraint, Boolean processExpanders)
at Xamarin.Forms.StackLayout.LayoutChildren(Double x, Double y, Double width, Double height)
at Xamarin.Forms.Layout.UpdateChildrenLayout()
at Xamarin.Forms.VisualElement.SetSize(Double width, Double height)
at Xamarin.Forms.VisualElement.set_Bounds(Rectangle value)
at Xamarin.Forms.Layout.LayoutChildIntoBoundingRegion(VisualElement child, Rectangle region)
at Xamarin.Forms.AbsoluteLayout.LayoutChildren(Double x, Double y, Double width, Double height)
at Xamarin.Forms.Layout.UpdateChildrenLayout()
at Xamarin.Forms.Element.OnPropertyChanged(String propertyName)
at Xamarin.Forms.BindableObject.SetValueActual(BindableProperty property, BindablePropertyContext context, Object value, Boolean currentlyApplying, SetValueFlags attributes, Boolean silent)
at Xamarin.Forms.BindableObject.SetValueCore(BindableProperty property, Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes)
at Xamarin.Forms.BindingExpression.ApplyCore(Object sourceObject, BindableObject target, BindableProperty property, Boolean fromTarget)
at Xamarin.Forms.BindingExpression.Apply(Boolean fromTarget)
at Xamarin.Forms.BindingExpression.BindingExpressionPart.PropertyChanged(Object sender, PropertyChangedEventArgs args)
at Xamarin.Forms.BindingExpression.WeakPropertyChangedProxy.OnPropertyChanged(Object sender, PropertyChangedEventArgs e)
at JCX.ViewModels.CleanMapViewModel.set_MapBounds(Rectangle value) in C:\Users\or39\Documents\JCX\JCX\JCX\ViewModels\CleanMapViewModel.cs:line 746
at JCX.ViewModels.CleanMapViewModel.b__362_0() in C:\Users\or39\Documents\JCX\JCX\JCX\ViewModels\CleanMapViewModel.cs:line 1177

I commented out anything related to the MapBounds but the exception continued. It always hits the auto-generated App.g.cs file with an unhandled exception. I've tried different map keys, removing large sections of code, debug assertions, and debug log statements. It seems to be something with external code. A post that is related to this issue is the following: https://forums.xamarin.com/discussion/125971/system-argumentexception-crash-in-custom-uwp-framerenderer Is this a UWP Xamarin bug or a compatibility issue?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>