Ambiguous references with the same namespace

The RC class is not connected to the database; it is a simple class. The class is located in only one place and is not partial. The AΓ©rochem.Domain dll project compiles just fine.

Note. If I select one of two identical namespaces in the quick fix menu, it does nothing.

Note2: This happens with several classes (some are database related and some are not)

Is there a fix for this or a way to figure out what's wrong?

enter image description here

+49
c # asp.net-mvc-3 resharper ef-code-first
Aug 16 2018-12-12T00:
source share
11 answers

I had the same problem. I am using ReSharper. The solution to my problem is not to clear the solution, but to delete the suo file. Hope this helps.

+42
Jan 13 '14 at 16:10
source share

As for the link for future users: this topic covers four answers, while two in the comments. I ran into a problem several times, three of these answers have helped me in the past, so if you run into the same problem, try any of them:

  • Clean and / or reinstall the solution, then reanalyze the files in Resharper.
  • Restart Visual Studio, then re-analyze
  • Delete the bin folder / then re-analyze
  • (Obviously, deleting the suo file may also help, although I never had to do this, and I can't figure out how this should help)
  • The combination of the three above.

(This is not a completely new answer, it is rather a comment on the many answers and comments found - this is a community wiki, so do not hesitate to adapt it if necessary)

+12
May 20 '14 at 9:17
source share

For ReSharper users who, like me, do not want to remove their *.suo file solution:

Clear your caches via: ReSharper β†’ Options β†’ Environment β†’ General β†’ Clear Caches !

Clear resharper caches

Thanks for the comment on this comment AUSTX_RJL . I wanted his valuable information to become more visible.

+11
Sep 30 '15 at 16:04
source share

.dll already in my /bin .

When I deleted it, he got rid of this error.

+4
Feb 03 '14 at 15:34
source share

I had this problem as well as ReSharper installed on visual studio.

Print screen 1

Print screen 2

I open the big code on the ReSharper tracker , and the development team advised me to do:

Decision:

This problem can be resolved by removing Solution User Options (.Suo) File . This file is stored in the root of the project, but is hidden. you need to check Folder Options-> View-> Show hidden files, folders, drives. , and you need to close the visual studio if you opened this project because it is used by the visual studio.

+3
Jun 02 '14 at 10:25
source share

If your project structure contains more than one project under one solution, you must delete the contents of the bin folder in each project. This resolved the error I encountered.

0
Aug 31 '15 at 6:27
source share

In my case, I referenced proyect X internally. So the problem is not ReSharper (but it was ReSharper that added the link ...)

0
Apr 01 '16 at 15:58
source share

I had this problem in a standard .NET project (I call it a host project). The namespace causing the problem was in another project with a link (which was also a standard .NET project) in the same solution.

I did everything: clear, delete resharper caching, close soln, delete.suo, delete binary files. Nothing seemed to work.

Then I converted the host project to the .NET framework, and then the problem disappeared.

0
Sep 19 '18 at 21:33
source share

For me, this was because I referenced the DLL both under the Project link and the Assembly link. Fixed problem with deleting assembly link.

0
Dec 01 '18 at 11:51
source share

I had the same problem, while two packages ambiguously referenced the same dll, and this worked for me:

I gave alias name one of the packages (called Dapper.StrongName) by putting in my .csproj file:

  <Target Name="ChangeNameAlias" BeforeTargets="FindReferenceAssembliesForReferences;ResolveReferences"> <ItemGroup> <ReferencePath Condition="'%(FileName)' == 'Dapper.StrongName'"> <Aliases>AliasName</Aliases> </ReferencePath> </ItemGroup> </Target> 

And then added namespace using AliasName::Dapper;

I added a post here: Ambiguous Extension Methods

See related articles:

0
Apr 10 '19 at 20:24
source share

I know this is a pretty old problem, but maybe it will help someone. If you use C # razor in Asp.Net Core 2+, if you have this problem.

1) Copy the contents of the file to notepad.

2) Delete the .cshtml file.

3) Create a .cshtml file with the same name.

4) Copy content from notepad to a new file

I don’t know if this is just a strange mistake or a consequence of updating the project from Core 1.0 to 2+, but this FULLY solved the problem for me. This was a problem for me both in Visual Studio 2017 and in 2019.

0
Apr 26 '19 at 22:23
source share



All Articles