Reputation: 11
My project is in solution1. I want to refer a project from solution2. I could refer the dll successfully, but not the project.
I can not add the other project to my solution. In that case how can I add it as a project reference. Need some suggestions.
I have added the reference manual in the csproj file, but the build is failing.
<ProjectReference Include="..\..\Common\Project2.csproj">
<Project>{78cd0a60-06fb-4941-323e-337f0e43c693}</Project>
<Name>Project2</Name>
</ProjectReference>
Upvotes: 0
Views: 579
Reputation: 1434
Place both of your project in same folder (class library project and your current project)- recommended but not necessary
1) Right click your solution file and click Add --> Existing Project --> go to the folder of class library project and select project file.
2) Once the project is added to the solution, you need to add reference to your present application.
3) Now right click your project and click Add Reference
4) Select solution and check your class library project and Press OK.
5) Rebuild your solution.
6) You can now use classes and objects of class library with the use of using statement at top of your .cs files
Upvotes: 2