Link to home
Start Free TrialLog in
Avatar of elfield
elfield

asked on

Visual Studio 6: How to set default workspace directories?

My workspace consists of many projects.  Each project creates a console application.  By default, Visual Studio creates Debug and Release directories as subdirectories of each project.  I want one Debug and Release directory for the entire workspace (elsewhere on the disk).  I also want all the objects and libraries to be built in the same intermediate directory, also elsewhere.

For each project, under Settings, I can override the default assignment.  But I must do this each time I add a new project to the workspace (and I have many projects).

Is there some way to set up "default project options for this workspace" so I don't have to specify these directories (and other options) each time?
Avatar of sanjeev_rao
sanjeev_rao

Do you want it to be done for existing projects also?

Or only for ones you will add from now on?
As far as I know--no.  Its something I've wanted to.  With all the settings in a project!

The alternative is to use makefiles and/or the command line (batch files) to automate the build.  
Avatar of elfield

ASKER

sanjeev, either way is okay because this is my first Visual Studio project.  

I've used the Borland IDE for many years, and with it, defining a set of common options is easy.

nietod, regarding makefiles, I already made one that does the job.  But I'd like to take advantage of the features of Visual Studio.
If this is for new projects, create an empty console project & give it the settings you require. This will be your 'template' project.

Now copy & rename the template project as you need. You'll need do some search & replace in a text editor once you've renamed it.

Depending on how complex your apps are, this may not gain you anything, but it might be worth a try.
Where are you doing the search and replace?  what are you searching and replacing?
The project name isn't just defined by the project filename, it's embedded in the DSP file.

So if I've created a template project (let's call it con_template.dsp) and want to use it to create an actual project (called foo), you have to:
1. Copy con_template.dsp to foo.dsp
2. Open foo.dsp in a text editor (e.g. the DevStudio one)
3. Search for all occurences of "con_template" and replace them with "foo".
Avatar of elfield

ASKER

abancroft, just to make sure I follow you:

1.   create a default project as a template.

2.   copy <default>.dsp to <newproject>.dsp.

3.   Using a simple text editor, replace all occurences of <default> with <newproject>".

4.   Open Visual Studio.  Open the workspace, right-click on the Workspace, and choose "Insert project into workspace", and pick <newproject>.dsp.

5.   Repeat steps 2-4 for each project.

Is that correct?

     
ASKER CERTIFIED SOLUTION
Avatar of abancroft
abancroft

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of elfield

ASKER

Thanks very much.  (The Borland method is much easier.  I hope this is not the first of a series of disappointments using Visual Studio.)
I did not realize that the .dsp and .dsw files were ASCII.  I asumed they are binary.  Interestingly however they have comments at the top that explicitly warn against editing them.  I can't imagine why though, other than they don't want you making mistake in them.
'
>>  I hope this is not the first of a series of
>> disappointments using Visual Studio
Both have their advantages and dissadvantages, but I think overall you will find that VC is better.