Alex Rivera | Logout

Best way to work with multiple projects / solutions in Visual Studio?

Asked 2010-08-01T21:12:20.250
24

Currently I have 4 solutions that are independent projects, however there is quite a bit of duplicated code when it comes to a few areas of the applications.

At the moment it is simply a few forms and their associated code.

When I want to change or improve something, I have to copy and paste to all relevant projects.

I looked at creating a new project within one of the solutions for the .dll/class library, but I felt that this was incorrect. (Please say if I am wrong).

As it is a component for all the applications, I decided to create a new solution for the .dll/class library and am looking at moving the shared code over to that - but, having never gone down this route before, what are my options from here?

Am I able to then include this solution within the others if I need to make a simple change and have it updated in all the projects or instead, should I always be working on the shared component in a separate instance of Visual Studio, outside of the applications using it?

Edit
Report

1 Answer

10
  1. Put shared codes in separate Solution/Project as Class Library,
  2. In post build event of shared projects copy dll's to a specific directory,
  3. Add shared dll's from this directory to other projects/solutions

By doing this each time you build your consumer projects, they will use latest dll's automatically.

answered 2010-08-02T04:43:23.690

Your Answer