[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How do I use Configuration Manager to produce 2 slightly different versions of same program?

Posted on 2004-10-23
4
Medium Priority
?
189 Views
Last Modified: 2013-12-03
I am pretty sure the configuration manager in visual studio is the place to figure this out, but don't know how.  I need to create 2 projects that have most of the same forms and code, but where the entry form on one deployment will be tailored for a specific client login procedure and another deployment that has a more generic login procedure.  
0
Comment
Question by:thefumbler
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 14

Accepted Solution

by:
ptakja earned 2000 total points
ID: 12391001
You could use conditional compilation arguments to do this.  Open your project. Next select Project --> Properties.

In the BUILD section under Configuration, you can add your own constants as:

CUSTOM_CLIENT=True

Next in your code you can include or leave out sections of code using the conditional compilation statements as:

#if CUSTOM_CLIENT Then
    Code for custom client stuff goes here

#else
   Code for everyone else goes here

#End If

You can set up your own build configurations to include this symbol or not...

Note that if the symbol is not defined, it will evaluate as false.

Jeff
0
 
LVL 1

Author Comment

by:thefumbler
ID: 12402760
ptakja,

I expected a simpler way to do this without code - is this really the only way?   It just seems like this would be a very common issue for many developers and that there should be a option to select which files are included in which build.  I would prefer not to change the code in the generic version for everyone because I would have to deploy a new version for no benefit to those users.  This type of option would also be helpful in developing and testing so I can have very client specific files in a build for release and files related to my test development system in another build.  

I am still getting feet wet in .net so I may be out to lunch, feel free to say so.
0
 
LVL 14

Expert Comment

by:ptakja
ID: 12402932
The project structure in Visual Studio .Net is file-based. That is, when you create a new project, files are created under the folder hierarchy for the project.  This even happens when you add an "existing" item to a project. In this case, Visual Studio doesn't point to existing file location, it goes over there and COPIES it to your local project folder. This makes it impossible to share source code between projects.

It sounds like you want to exclude/include various files for a project build. Since the build system in VS is _Project_ based and not file based I think you are out of luck.

An alternative to the conditional compilation idea I posted above would be to maintain 2 separate projects. But that is more headache than it's worth, in my opinion.

I may be out to lunch on this one as well, but as far as I know, the solutions I presented are the only ways to deal with this.
0
 
LVL 1

Author Comment

by:thefumbler
ID: 12549922
I haven't been able to find any better way, so ptakja's method is probably the best.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question