Getting ambiguous reference error

Completed

Hi;

I am getting the red squiggly line under class references for variables saying it's an ambiguous reference. First I was getting it in my test project. Now in the main project too. I am 99% certain I have no ambiguous references.

I have cleared the cache, closed VisualStudio, deleted all obj & bin folders, started VisualStudio - and still have it.

Everything compiles & runs fine.

What's going on?

thanks - dave

12 comments
Comment actions Permalink

Hi David, thank you for your feedback. First of all - what VS and ReSharper versions are you using?

If this is reproducible in the latest ReSharper 2022.1 in a test project, can you send it to us for investigation? You can use https://uploads.jetbrains.com/ for this. Thanks in advance!

0
Comment actions Permalink

I updated to 2022.1 and that fixed it.

Thank you

0
Comment actions Permalink

I've been getting the ambiguous reference warning for about 6 months now.  Every update to VS2022 and/or Resharper brings me hope that it is fixed.  Sadly, I'm disappointed.  I seem to get them in the code behind for every object defined in a XAML file.  Here is an example:

I don't understand where the ambiguity lies.

I am running VS2022 Version 17.2.1 (64-bit) and Resharper 2022.1.1 built on 2022-04-28.

0
Comment actions Permalink

Hello Culpepperj,

Does the issue go away if you disable ReSharper?

Is there any chance you could provide us some stripped solution in which the problem is reproduced? You can send it using our "Submit a request" form at the top of the page.

Thank you.

0
Comment actions Permalink

Same issue. It goes away in VS2019 once ReShaper is disabled

0
Comment actions Permalink
Hello,
thank you for contacting us.
What version of ReSharper are you using?
Does it happen in all solutions or only in specific one?
Thank you!
0
Comment actions Permalink

Hello, RS version is 2022.3.1

It seems that all solutions are affected with cross-references to Projects to share a code base. 

0
Comment actions Permalink
Hello,
please try to turn off option: ReSharper | Options | Environment | General | Read solution model directly
0
Comment actions Permalink

That fixed it for me.  After changing the setting, all Ambiguous References have gone away. Thank you both for the solution.

0
Comment actions Permalink

Sorry.  I spoke too soon.  After rebuilding my solution, the Ambiguous References returned regardless of how the "Read solution model directly" is checked in the options.

0
Comment actions Permalink

Sometimes it helps to disable RS, clean and rebuild the solution, then enable RS and after restart the Ambiguos References error disappears.

0
Comment actions Permalink

That appears to do the trick.  Thanks again for the solution.

0

Please sign in to leave a comment.