Useful tip

L

Lee Alexander

Sometimes all I want to do is build a particular solution without firing up
vstudio in GUI mode and then wait whilst source control get its act together
etc. Anyway I've found a nifty solution to this by adding some extra file
associations. So here is how you do it:

First some assumptions:
~~~~~~~~~~~~~~~~
1. The paths to devenv are based on the default install directory on my
machine; yours maybe different so you may have to tweak the path accordingly
(in step 5).
2. This will only work with solutions that contain release / debug builds.
Having said that you can change or add more associations where appropriate.


How to do it
~~~~~~~~~
1. Fire up the file explorer and select menu Tools->Folder Options.
2. Select the File Types tab.
3. Select from the list file type SLN and then press the Advanced Buton.
4. Click on New button and fill in Action name to be "Build Debug"
5. copy and paste the following text into the "Application ued to perform
action" edit:
cmd.exe /k ""c:\program files\Microsoft Visual Studio .NET
2003\Common7\IDE\devenv" "%1" /build debug"
6. Click on ok.

7. Repeat steps 4 -> 6 but replace the word Debug for Release in both
"Action" edit and use the following text for the "Application ued to perform
action" edit:
cmd.exe /k ""c:\program files\Microsoft Visual Studio .NET
2003\Common7\IDE\devenv" "%1" /build release"

How to use it
~~~~~~~~~
Simply right click on the .SLN file of choce and from the menu select either
Build Debug or Build Release.


Lee
 
B

Bonj

I have 'Feed into SQL Server' on .sql files , it's dead useful :) still
looking for a solution though as to how I can keep my GUI that has a combo
box to pick the server, but still be able to feed a multiple-selection of
them into it, i.e only one instance of the program will fire up, but it will
be able to process all the files...
 
L

Lee Alexander

Because cl.exe hasn't a clue what .sln files are nor for that matter vcproj
files.

Regards
Lee
 
B

Bonj

But you wouldn't pass them to it would you, you'd pass it the names of the
..cpp files. Doh!
 
L

Lee Alexander

But you wouldn't pass them to it would you, you'd pass it the names of the
.cpp files. Doh!
And how would you pass it the cpp files with all the associated settings
then? Parse the .sln files followed by th vcproj files? Seem like *lots* of
work when you can do what I just discussed. Perhaps you have the wrong end
of the stick regarding my tip?

Regards
Lee
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top