I do not do this anymore (see *note at bottom), but I used to keep all of my various projects under one solution.
I had my Main MDI application project.
I had 3 small, single form projects (one on the server, and 2 different label printing applications)
There were 2 Windows Mobile projects (one called Packout, and one called Inspections)
These projects already share their file locations on my PC where I have a folder called Common with classes that are used in all of the whole solution.
Take the Database.cs
class shown above: Whether my project is an MDI Form, a stand alone form, or a Windows Mobile application, they are generally all going to connect to the same company database.
Instead of adding the file to your project (which makes a copy of the file, and places the copy in your project), add the file as a link:
I must admit: I never noticed the Add button was a Drop-Down until ctacke pointed it out to me years ago.
Now, whenever you edit this Database.cs
file in one project, it will automatically be updated in all other projects that have it linked.
Warning!
This does present issues, though!
Sometimes you NEED things in your Windows Forms that Windows Mobile just does not support. Sounds crazy, but it's true. Windows Mobile just won't do it all. So, instead of being stuck writing all of your classes for the weakest link (Windows Mobile), include some #define
statements in your class.
Below is a screenshot of a WM5 project that now has System.ComponentModel
commented out of the code because the BackgroundWorker control is not defined in Windows Mobile:
What does this do for you?
Now you can have multiple projects within your solution. Depending upon which one you want to test your code on, just Right-Click that project, and select Set as StartUp Project.
Now you can test and develop for a Windows Form application for basic code or whatever emulator you prefer (as long as it isn't one of those icky iPhones and Android devices), then switch back to your old Company Clunker for final testing and fine tuning.
*Since we got VS2010 and VS2012, I have not been able to keep all of my projects under one solution. Most of the files, however, are still linked to the separate projects.