Jiminion
Jiminion

Reputation: 5168

Building related projects on Visual Studio

I am a Visual Studio noob. My background is more Unix-related and mostly used to building things via scons or make. I don't even have much Eclipse experience.

Anyway, I am frustrated how it seems very difficult to move files between projects in VS. (I am running Visual Studio 2013). For example, suppose I have a ProjectXRel (release) and I want a ProjectXDev (development). I want them both to be runnable, and the dev version might have just a few editing changes that differ it from the rel version.

The intuitive thought is to just copy the files from ProjectXRel to create ProjectXDev, but VS seems to fight me on that (it wants to rename all the namespaces to the title of the project).

Also, some of the files, like .cs files derived from .dbml via OR designer, seem uncopyable, and rely on one replicating the process of using the utility to having valid files. I'm used to a project being defined by its files, but that's not really the case in VS. Instead it seems defined by process steps used to create and organize the files.

Also, do serious developers just use command line calls and powershell? That's seems harder, but at least you know what the %@$$# is going on.....

So, the basic question is, how does one replicate an existing project to produce a similar one for development purposes? (I know source control such as git could help with that, but that's not an option for this situation.)

Thanks!

Upvotes: 0

Views: 39

Answers (1)

Kyro
Kyro

Reputation: 768

You should be using the same project for both Development and Release.

The things that are different between Development and Release should be stored in a config file (web.config or app.config, depending on what type of project).

You should then be using Configuration Transformations to transform that .config file into Development or Release.

In Visual Studio, right click on the project and click Add New Item, select "Application Configuration File".

In this file you can put connection strings or key/value pair settings in the AppSettings element (MSDN Link).

Once you have your basic settings defined, you can then right click on the config file and click Add Transformation. This will add transformations for each of the Project Configurations you have. (by default Debug and Release).

It will look like this:

Screenshot Example

Now you can build deployment packages. Or install Slowchetah and then when you press F5 to debug it will run the selected project configuration with the configuration transformation applied.

Upvotes: 1

Related Questions