How can I refer to a project from another one in c#?

前端 未结 9 1110
孤街浪徒
孤街浪徒 2020-12-01 12:13

I added a project, Project2, to my solution. It already had another project lets say Project 1. How can I call classes and methods from project2 into project1?

What

9条回答
  •  眼角桃花
    2020-12-01 12:28

    Select the project you will be using (project1 for example), right click it in the solution explorer and click "Add reference".

    You'll be able to add a reference to the other solution from there (project2).

    All you have to do then is add a using statement in your main project (project1) and you'll be able to access it normally.

提交回复
热议问题