Compiler Error CS0229
Ambiguity between 'member1' and 'member2'
Members of different interfaces have the same name. If you want to keep the same names, you must qualify the names. For more information, see Interfaces.
Note
In some cases, this ambiguity can be resolved by providing an explicit prefix to the identifier via a using alias.
Example
The following example generates CS0229:
// CS0229.cs
interface IList
{
int Count
{
get;
set;
}
void Counter();
}
interface ICounter
{
double Count
{
get;
set;
}
}
interface IListCounter : IList, ICounter {}
class MyClass
{
void Test(IListCounter x)
{
x.Count = 1; // CS0229
// Try one of the following lines instead:
// ((IList)x).Count = 1;
// or
// ((ICounter)x).Count = 1;
}
public static void Main() {}
}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for