Sida 1 av 1

C# & WPF Hur debuggar man AmbiguousMatchException?

Postat: 23 september 2019, 16:22:34
av Krille Krokodil
An unhandled exception of type 'System.Reflection.AmbiguousMatchException' occurred in mscorlib.dll
Ambiguous match found.
Exception-meddelandet ger bara generell felinformation och inga ledtrådar om var exakt man ska leta, finns
där något slugt systematiskt sätt att debugga det här felet?

Re: C# & WPF Hur debuggar man AmbiguousMatchException?

Postat: 23 september 2019, 20:37:56
av TomasL
Har du googlat?
An AmbiguousMatchException is thrown when a member is invoked late-bound and multiple overloads satisfy the binding criteria, or when more than one member matches the binding criteria passed to a reflection method that can return only a single result (for example, Type.GetMethod or Type.GetProperty).
Du borde få lite mer info om vad det är som rest det hela.

Re: C# & WPF Hur debuggar man AmbiguousMatchException?

Postat: 23 september 2019, 22:24:51
av Krille Krokodil
Jo, jag vet vad det beror på men jag lyckas inte hitta var det är fel i min kod och dessutom är det så lurigt att
programmet startar ibland och ibland inte.

Men jag hittade nu hur man debuggar i externa bibliotek i VS, så jag ska nog lyckas leta mig fram till
lusen imorgon. Jag kände inte till det där med "Just my code"-flaggan...

https://docs.microsoft.com/en-us/visual ... ew=vs-2019