Windows Develop Bookmark and Share   
 index > Windows Forms General > Compiling Multiple Projects - Best Approach?
 

Compiling Multiple Projects - Best Approach?

I've built a WinForms app that is working fine. But a client wants an alternate version that has a number of different features locked down (turned off). I've thought about different approaches to accomplish this. One would be to go into the Options screen, change a setting and add a password to secure the change.

But another approach suggested to me by a colleague would be to have a second, nearly identical project within the same solution except that it would have an extra little XML file included with something like "ReadOnly = True" in it. The presence of this file would be checked for upon startup. If found then the code would shut off what it needed to; it not found then it wouldn't.

Since the original EXE would never have this file embedded in it, it would always run in "Standard" mode whereas the second project would always have the file, so it would always run in "Read Only" mode.

I'm curious to know if anyone has ever used this approach? Or is there perhaps a 3rd way to accomplish my end goal that I haven't thought of?

Sincerely,

Robert Werner
http://PocketPollster.com

rwerner  Friday, March 09, 2007 8:03 PM

My tought:

If your working at a company and they want an application for internal use only. If some people want to option and others not then sure, create a setting in the .config set at true or false. You don't need two different project, in the form Load event, set the menu item to True/False.

If it's a commercial application and you don't want some knowledgebal user to go in the .config file and change this setting, then I suggest you use the #const #if pre-processor instruction and compile the code differently depending on the one you want, still you don't need two different project.

If the forms are completely different or if the changes are so major that the layout has to be changed significaly then you have no choice but to create two different UI.

I would'nt use a seperate xml as the .config can do the job. I would'nt create two different UI unless I really need two cause it can be trouble to update two things.

ThE_lOtUs  Friday, March 09, 2007 9:06 PM
I'm not super familiar with App.config but I get the general idea of what you're saying. I will investigate the capabilities of this file further, thank you.

It still may be worth it for me to always compile 2 EXEs everytime. They will be identical except for the settings within App.config. But then the Setup will package both EXEs, and ask during installation which version the user wants to install.

Robert

rwerner  Friday, March 09, 2007 10:05 PM

You can use google to search for other answers

Custom Search

More Threads

• Form Inheritance and the Anchor Property
• Read cookie from desktop application.
• Pop Up Window
• Button to scroll MDI Parent Form
• Populating Datagridview
• help ToolStripDropDounButton
• I'm not understanding this...
• ComboBox.FindString bug?
• OTP: Install Vista Ultimate over Home Premium
• Close form in windows forms after new form event has been clicked