Open mknotzer opened 5 years ago
@mknotzer Have you tried to clean your solution first? Can you please attach a small project that demonstrates this issue? Thanks!
I cleaned and rebuild it. Actually for several years I've been using a second file called ThisApp. When I removed recently the original App.* the runtime errors occurs. Renaming App or even changing to ContentView has no impact, only removing it from the project causes trouble like this:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Xamarin.Forms.Xaml.XamlParseException: Position 46:37. Multiple properties with name 'DemoProject.Controls.Video.WidthRequest' found. ---> System.Reflection.AmbiguousMatchException: Ambiguous match found.
at System.RuntimeType.GetPropertyImpl (System.String name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Type returnType, System.Type[] types, System.Reflection.ParameterModifier[] modifiers) [0x00057] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.6.0.25/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/rttype.cs:3307
at System.Type.GetProperty (System.String name) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.6.0.25/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/type.cs:728
at System.Reflection.RuntimeReflectionExtensions.GetRuntimeProperty (System.Type type, System.String name) [0x00006] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.6.0.25/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/reflection/RuntimeReflectionExtensions.cs:48
at Xamarin.Forms.Xaml.ApplyPropertiesVisitor+<>c__DisplayClass36_0.
adding [assembly: XamlCompilation(XamlCompilationOptions.Compile)] solved it for me attached a small project, please compile and run
Oh, so you solved this issue?
The issue still exists, setting XamlCompilation is only a temporary solution. Please run my demo project.
@mknotzer It does seem like a bug that this is happening without XamlC. However, may I ask why enabling XamlC is a temporary solution? We do recommend it for performance and development productivity. Thanks!
enabling XamlC is a (pretty good) work around. The option was not enabled in my project due to a compiler bug some time ago. In general enabling XamlC makes sense. It's up to you guys if you want to investigate this bug or not.
Description
exceptions like XamlParseException are raised ...
Steps to Reproduce
rename App.xaml and App.cs to MyApp.xaml and MyApp.cs change LoadApplication(new App()); to LoadApplication(new MyApp()); compile it and run it
Basic Information