Ambiguous references in VS 2010

An attempt to update the solution from 2008 to 2010. And I suddenly get a lot of ambiguous compilation links in VS 2010.

It works great in 2008. Is VS 2010 stricter regarding the use of directives?

+3
source share
3 answers

I had a similar problem.

I don’t think it is more strict, but more matches of the new structure now have the same class name that I used in the dll links, either were moved, or a new development for existing DLLs appeared.

It took some time to fix the whole project, but I found ways around it:

To use or determine the full layout of classes

or

define an alias:

using CompanyMagic = Core.Company.Magic;
+4

dll ?

, "System.dll dotnet 2" "System.dll dotnet 4"?

+2

StackOverFlow : VS2010

Richard:

There may be slight changes in the search rules regarding how different cases are (for example, the identifier in the current namespace takes precedence (as in the previous class program).

There are two options for eliminating ambiguity:

  • Use full identifiers in the above System.Action or ConsoleApplication1.Action example.
  • Use a namespace alias to fully qualify an identifier without so much input:

    using MyAction = MyNamespace.Action;

0
source

Source: https://habr.com/ru/post/1783850/


All Articles