Reputation:
Trying to upgrade a solution from 2008 to 2010. And I suddenly get a lot of ambiguous reference errors compiling in VS 2010.
It works fine in 2008. Is VS 2010 more strict regarding the using directives?
Upvotes: 3
Views: 5254
Reputation: 10359
There is a quite similar post on StackOverFlow : Ambiguous reference error in VS2010
From this article, from Richard :
There may be slight changes in lookup rules about how different cases (e.g. identifier in current namespace takes precedence (as in class Program above).
There are two options to disambiguate:
Use a namespace alias to fully qualify the identifier without so much typing:
using MyAction = MyNamespace.Action;
Upvotes: 0
Reputation: 14755
have you references to two different dll-versions of the same assembly in your solution?
For example are you referencing "System.dll from dotnet 2" plus "System.dll from dotnet 4"?
Upvotes: 2
Reputation: 4347
I had a similar issue.
I dont think it is stricter, but more a coincidences of the newer framework now having the same class name I was using in the dlls referenced, either things were moved or there was some new development to existing dlls.
It took some time to fix the entire project, but the ways around it I found were:
To use either define the full location of the classes
or
define an alias:
using CompanyMagic = Core.Company.Magic;
Upvotes: 4