-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Forms 3.0: System.Reflection.AmbiguousMatchException #2632
Comments
And another one:
|
Seems like this is caused by Edit: Seems like to work on the other hand if I use the name of the list itself instead of the whole page. Well this will be a lot of work to change this in 19 apps with multiple pages and this is used quit often in my apps. :/ |
@Sebastian1989101 as you isolated the issue, could you please attach a small sample project triggering the issue ? This looks serious, we should address this pretty quickly |
@StephaneDelcroix I'm getting this on Android and iOS with I'm manually calling this, because I am using a bindable repeater, but I notice the same line is called in the StackTrace's above.
My BindableRepeater has this property
And the DataTemplate is loaded by defining it in XAML. Actually this error seems to be trashing most of my ListViews too. |
@StephaneDelcroix - can confirm using |
Similar bug here: |
I can't reproduce the issue with the following xaml <ListView x:Name="xRefToPage">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell><Label Text="{Binding Source={x:Reference Page}}"/></ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView> could you please attach a sample project ? or @adamped |
Here is a new project that reproduces the exception. This is with a fresh install of VSMac on the stable channel FYI. === Visual Studio Community 2017 for Mac === Version 7.5 (build 1254)
=== NuGet === Version: 4.3.1.4445 === .NET Core === Runtime: /usr/local/share/dotnet/dotnet === Xamarin.Profiler === Version: 1.6.2 === Xamarin.Android === Version: 8.3.0.19 (Visual Studio Community) SDK Tools Version: 26.1.1 Java SDK: /usr Android Designer EPL code available here: === Apple Developer Tools === Xcode 9.3 (14154) === Xamarin.Mac === Version: 4.4.1.176 (Visual Studio Community) === Xamarin.iOS === Version: 11.10.1.177 (Visual Studio Community) === Xamarin Inspector === Version: 1.4.0 === Build Information === Release ID: 705001254 === Operating System === Mac OS X 10.13.4 |
@StephaneDelcroix the name needs to be attached to the page not an element in the page.
|
@Nerves82 your repro is incomplete. also, from the screenshot, it looks like an intelisense problem, and not something preventing a build. am i wrong ? |
@StephaneDelcroix Yes, another wonderful (and not at all frustrating) bug in VSMac. The files are in the project but the .csprog file does not include them no matter how many times they are added to the project. Just add BasePage.xaml, BasePage.xaml.cs and BasePageViewModel to the project. |
@Nerves82 you can be frustrated, or you can fix your
|
@StephaneDelcroix Yep. Been there, done that. Many, many, many times. And yet still VSMac does not save the .csproj file and restarting VSMac opens the project with those files missing. But that is another bug for another thread. |
@Nerves82 your problem seems like an Also, even with BasePage in, your project throws NRE at multiple places. |
@adamped @Sebastian1989101 I still need a valid repro for this. |
@StephaneDelcroix It acted like more then intelligence as it would prevent the project from compiling. I just tried to create another new Forms project and pull in those 3 files with the same issue. VSMac seems to keep overriding the .csproj file so the BasePage.xaml never gets included. |
@StephaneDelcroix After a few more tests, it might be more a Problem combined with MvvmCross. Because every repository of mine that was affected by this, uses MvvmCross (but it works with XF 2.5). I guess I need a bit more time to find the real source of this. I just thought on first tests that Xamarin.Forms 3.0 was the problem because that was everything I changed. |
@Sebastian1989101 I think I can eliminate that possibility. I don't use MVVMCross but was experiencing the issue. My projects are Xamarin Forms with .NETStandard 2.0 for UWP, iOS and Android. |
Hopefully this helps some people. ( @MelbourneDeveloper ) Was getting the same Ambiguous exception on my content pages, by adding e.g. namespace xxxxx |
@ryanharding indeed, that AmbiguousMatch only happen when runtime-inflating XAML |
@StephaneDelcroix I put together a very simple example project showing the issue (no mvvmcross here!). It produces 3 AmbiguousMatchExceptions: Interestingly enough, the ListView by itself does NOT cause the issue. Only in conjunction with an enclosing StackLayout (or probably some other similar Layout?) the Exception gets thrown. Even more interesting is the fact that the more controls we add to the Stacklayout, the more Exceptions get thrown as I put down in the comments of my xaml.
Hope that helps in reproducing and narrowing down the issue. Good luck! |
Thanks for the repro, but we know exactly where and why it happens.
|
Any estimation for release? |
The latest pre-release has the same issue |
@StephaneDelcroix any idea of when your changes to fix this issue will be released? I even went so far as to see about getting the "nightly" build from MyGet, but it seems that the last time that was released was a few days before your PR was merged (which, I mean, you really ought to re-name the MyGet feed, as it's not really "nightly" now, is it?). |
Ive got VS 15.2.7 and using xf 3.0.0.482510. Just updated to both today(May 31). An using Win 10 build1809. It is still happening. As said above it is a RUNTIME exception on the LoadFromXaml in the .g.cs. The exception gets swallowed by XF. Im only using normal basic binding, eg, <Entry x:Name="Pin1" Text="{Binding Pin1, Mode=TwoWay}" However, the view appears to work after the exception. |
Ive just checked - I have 11 basic bindings on a form and the exception gets thrown 11 times. |
@ryanharding that fixed it! Thanks for the suggestion. |
Getting it even with [XamlCompilation(XamlCompilationOptions.Compile)] (both page and assembly level) |
I just migrate from Xamarin Forms 2.5 to 3.1.0 and everything failed with AmbiguousMatchException at application start :( |
You should clean and rebuild. This issue has been fixed in the June version.
On Wed, 1 Aug 2018 at 16:00 vodevil ***@***.***> wrote:
I just migrate from Xamarin Forms 2.5 to 3.1.0 and everything failed with
AmbiguousMatchException at application start :(
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2632 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHbkI3r9wR8pFvWvtRo-hRHTMYmN3gtrks5uMaZcgaJpZM4T27Os>
.
--
Best Regards,
Gena
|
I'm getting this error since I upgraded from Xamarin 2.5 to 3.2. I removed all the "Source={x:Reference Page}}" in my xaml file but still the error is there. any ideas what else can be the cause? |
@alicint please open a new issue, with a reproduction. thx |
Hello, i'm getting this error on new Project. Remove last line solve runtime error, but obviously it's doens't works as expected. Any workaround, solution?. Many thanks |
@txarito please open a new issue, with a reproduction. thx |
it is strange but this error was caused by livesharp for me. as referenced link |
After the update to Xamarin.Forms 3.0 I got
AmbiguousMatchException
all over the place in my code. I'm not 100% why this happens and what it causes yet. A friend of mine got the same exceptions after the update - he has a complete different coding style and uses complete different libraries. Sadly he dosn't know why this happen and where it comes from.The text was updated successfully, but these errors were encountered: