• Advertisement
Sign in to follow this  

[.net] C# - Referencing to another project

This topic is 3159 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I am very new to C#. I have a created some common code within a project that I can use with any of my other projects/solution. However, this code is stored in a path outside to the current solution. Although I can add the project to the solution, is there a way to reference to those code like you can in C++? i.e. #include "..\..\myCommonCode.h"

Share this post


Link to post
Share on other sites
Advertisement
Go to solution explorer and right click on the project references folder and select Add Reference. Go to the browse tab on the dialog box that comes up (it might take a while for that to happen) and browse to the component you wish to reference.

Share this post


Link to post
Share on other sites
If you wish to reference source files instead of whole assemblies, you can Add → Existing Item in the solution explorer. Note that by default it copies the file into your solution - click the drop-down to the right of the Add button to Add As Link.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement