Let's say there is such a structure:

- SimpleSolution |--apps (folder) |--core (folder) |--DataAccess (project) |--DataAccessPolicy.cs |--Domain (project) |--Development.cs 

I added a link to Domain in DataAccess, specified it in the DataAccessPolicy.cs file using SimpleSolution.Domain , but in this file the studio emphasizes all classes from the Domain, as well as in using SimpleSolution.Domain Domain . Tell me please, why is this happening?

  • one
    Did you try to direct the red lines? What does the studio write and what does it offer? Maybe you need a private class? - EvgeniyZ
  • one
    In Visual Studio 2017 you should not add another project link manually. Just create an instance of the class in the desired project and he himself offers to add a link. If you still do this, look at the namespace and access classes ( public , private ...) - DIlshod
  • one
    You need to add a link to the Assembly to the Reference list - Artem Prokudin
  • one
    To what then Я добавил ссылку на Domain в DataAccess in a question ... Only misled. - EvgeniyZ
  • one
    @dexploizer "through the project" - is it like? - Pavel Mayorov

1 answer 1

There are several reasons for this behavior:

  1. You have not connected a link to the Domain project in the DataAccess project
  2. Did not add namespace from Domain project in DataAccess project .cs file
  3. Domain project classes have an access modifier internal (default) or lower.
  4. The versions of the framework in the DataAccess and Domain projects do not match or are not valid for interaction.
  5. Studio hung (restarting studio, reinstalling OS)