0

Project 1

-- Class X

Project 2
References Project 1

Project 3
* References Project 2 * Needs ClassX ?

I want to access ClassX from Project 3 - is there anyway to do that?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Thang Dinh
  • 13
  • 2
  • 1
    Reference Project 1 in Project 3. Whatever you do don't reference Project 1 from Project 2 and Project 2 from Project 1 (or some other circular reference dependency) - in such cases you need a third common project which contains the required shared types. – ProgrammingLlama Jan 10 '20 at 04:49
  • No i dont reference Project 1 from Project 2 and Project 2 from Project 1. I just want to know is there anyway to create new Class X in Project 3 without using common project :D – Thang Dinh Jan 10 '20 at 05:02
  • Re-read my comment. The part you responded to was additional advice for the future since you said you're a beginner. – ProgrammingLlama Jan 10 '20 at 05:31

2 Answers2

0

Yes, you can do that.

In this example, Project3 is the main project while Project1 and Project2 are class library projects.

Since Project2 refers to Project1. Project3 just needs to refer to Project2. Then you can access all of class libraries from Project1.

Tân
  • 1
  • 15
  • 56
  • 102
0

You can Add reference of project1 in project3

enter image description here

Anant Dabhi
  • 10,864
  • 3
  • 31
  • 49