Error: ‘MethodName’ is an ambiguous reference between ‘namespace1’ and ‘namespace2’.
Scenario1: Well, this is simple, you have the same method name in both ‘namespace1’ and ‘namespace2’.
Cause of Scenario 1: When you add namespace references that contains the same method name you use in your code, .NET don’t know from where to take the good method and throw the error above.
Resolution of Scenario 1: You have two possibilities:
- You remove one of the namespaces that has the same method;
- You add an alias to one of your namespaces if you must keep both of them and then you add in front of the conflicted method the namespace alias. Ex:
using myNamespace = System.Namespace1;