Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ambiguous reference

I removed a project in my solution and then later re-added it. Since reading it.. I'm getting an ambiguous reference error now which I can't remove. viewing the implementation of the class (which is getting the error) I see it references it twice:

> ClassName (myclass.Class)    myclass.Class
> ClassName (myclass.Class)    myclass.Class, Version=1.0.0.0

the namespace is only viewed once, but this problem only exists in 1 partial view.

EDIT:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<MyClass.Class.MyViewModel>" %>

MyViewModel is giving the ambiguous error, if i view all the available classes it shows duplicates like:

MyClass.Class.MyViewModel
MyClass.Class.MyViewModel
MyClass.Class.MyOtherViewModel
MyClass.Class.MyOtherViewModel

but when I open another partial view in the same project, it's fine. It's just the 1 partial that seems to be retaining the duplicate reference.

Any idea how I can resolve this?

like image 361
nologo Avatar asked Mar 16 '11 13:03

nologo


People also ask

What is ambiguous error in C#?

This answer is not useful. Show activity on this post. ambiguity error is that you named field and property tha same name "colour". change the property definition f.e. public string Colour { get { return colour;} set { colour = value;} }


1 Answers

Have you tried right-clicking the solution and doing Clean Solution?

like image 200
Sergi Papaseit Avatar answered Oct 10 '22 17:10

Sergi Papaseit