Share common codes between multiple projects

I have a class library project containing common codes used in my projects, and I use subversion as a control source.
I have a question about managing solution, projects and codes for ease of use.
I want to share this class library between projects, and when I update it, this update is easily applicable to all projects. Where can I find this class library for sharing between projects and improve version control, usability and ...?

Any idea?

+4
source share
3 answers

You can use NuGet packages as a distribution tool for DLLs - create your general assemblies, pack the assembly results into a specific directory and use this directory as a repository for the NuGet package manager. One part of the NuGet options automatically downloads the latest version of the package, so whenever you open the solution, the package manager looks at the repository for the newer version and downloads it, if any.

Here's a very simple tutorial: http://juristr.com/blog/2012/04/using-nuget-to-distribute-our-company/

+3
source

You can use several approaches:

  • You can add this project as an existing project to all solutions from one place. This is the easiest way, but when it changes in one solution, all others can break.

  • You can divide your general library project into all solutions as a different brunch. In this case, when you change it in one solution, all other solutions will not slow down, but you should spend a lot of time to combine the changes from all brunches of your shared library.

+1
source

A solution can contain many projects, so you can effectively place the class library project anywhere and refer to it from each new solution as necessary. This means that there is only one copy of the source on your computer.

When you build each project, it will compile a class library if necessary, so all you have to do is process that supports the source code.

+1
source

Source: https://habr.com/ru/post/1447822/


All Articles