Click here to Skip to main content
15,890,579 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a utilities module in it's own project, I want to be able to use that module in other projects such that changes in the secondary copy of the module will be reflected in the original project if possible.

What I have tried:

copying the module doesn't work as it becomes part of the receiving project with no ties to the original.
Posted
Updated 3-Oct-18 6:08am
v2

You can add any source file to a project without creating a new copy. Just make sure it does not get moved or deleted and break the build. Go to the Solutions Explorer window, and right click on the Project name. Select Add -> Existing Item in the menu popup, and navigate to the file that you want to add. It probably makes more sense to make this module and its project part of the same Solution.
 
Share this answer
 
Comments
JymBoe 5-Oct-18 7:51am    
I tried this and it doesn't work as the file added becomes part of the project and any changes to it are not reflected int the original file. I want to be able to edit the utility module in various other projects and have the edits reflected in the original utility module so that I don't have to do a diff/merge with the original utility module.
Richard MacCutchan 5-Oct-18 8:28am    
I have done this in a number of projects and never had a problem.
Compile your utilities project as a class library, and reference it from your other projects.

Building a class library with Visual Basic and .NET Core in Visual Studio 2017 | Microsoft Docs[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900