1

Environment :

In C#, I have a solution with many project. They were added with *.csproj files.

Problem :

In a project, you can use classes of other files through namespace. However, is there a way to use namespace and classes of another project in the same solution?

Cher
  • 2,789
  • 10
  • 37
  • 64
  • 1
    you need add reference to project where placed classes and namespaces which you want – Grundy Jun 10 '15 at 20:22
  • 3
    Can you clarify why you wrote "internal" in your question title? If you are referring to [C#'s `internal` keyword](https://msdn.microsoft.com/en-us/library/vstudio/7c5ka91b%28v=vs.110%29.aspx), this could very well entirely change the answer to your question. – O. R. Mapper Jun 10 '15 at 20:23
  • 1
    If you just want to use files with code from another solution then you can add this files as link https://msdn.microsoft.com/en-us/library/windows/apps/jj714082(v=vs.105).aspx – Oleg Jun 10 '15 at 20:49
  • I set internal because the project is part of the solution (I guess I could use it even if it would not be a part of it). For example I had another question about the same problem, but without having the project in the solution. I wanted to distinguish between both. – Cher Jun 11 '15 at 13:41
  • The link to other question which serve the same purpose but without having the project in the actual solution : http://stackoverflow.com/questions/30761543/how-to-use-namespace-of-external-project – Cher Jun 11 '15 at 13:47

1 Answers1

1

In visual studio you should have a "References" area in the Solution Explorer. Right click that and click "Add Reference..."
From here, it's just a matter of locating where you other code is on your machine.

Edit: Here is some additional information on DLLs, in case it helps you.

Broots Waymb
  • 4,713
  • 3
  • 28
  • 51