Sign in to follow this  
AndyTang

[.net] C# - Referencing to another project

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this