views:

74

answers:

2

Hi

I have a working Windows Forms app (split into an EXE and a few DLLs). Now I've been asked to look at creating another app (MyAppLite) that has only a very small subset of the functionality. Think of it as similar to MS Word Viewer vs. MS Word.

Everything that I need to build MyAppLite is contained in the main solution - essentially I need to use a couple of the WinForms and whatever bits in the DLLs they call into.

What would be the best way to do this?

I was thinking of creating another Project in my solution for MyAppLite, then adding the necessary source files as links (using Add Existing Item > Add As Link in Solution Explorer).

I definitely wouldn't want to maintain 2 copies of the source code.

FYI it's a .NET 2.0 VB app, using VS2008.

thanks

Richard

A: 

You could refactor your project so that it would keep the common functionality in a MyAppCore project, and reference that from both MyApp and MyAppLite. The core dll would contain all the common functionality and take parameters as to what to allow and what to restrict, so the set of features in your lite version is customizable(say you have a customer that reaaaallly wants a preview of a certain feature).

luvieere
thanks - have tested this concept and it looks like this should work fine. More work than I wanted to do on it however (not really supposed to refactor the project at this stage) but think I can live with it.
Richard Bysouth
+1  A: 

You can create a new class library to contain your forms that are common to both projects. Create the new project and copy the forms from the original project into the new class library. Then you can import the class library into both the original project (after removing the original versions of the forms) and the MyAppLite version. If you need to change the forms, change it in the class library and then recompile your applications

TLiebe