passing define into a build

  • Thread starter Thread starter alex
  • Start date Start date
A

alex

I'm compiling a c# csproj project from the command line. However, I'd
like to pass in different defines to that project for different times
that I build it. I don't see any parameters on devenv command line
interface that seem to allow this. Should I be using something else
to compile the csproj file that would allow me to pass in preprocessor
defines?

i tried using nant but the <solution> doesn't seem to have anythign
that allows this either.
 
alex said:
I'm compiling a c# csproj project from the command line. However, I'd
like to pass in different defines to that project for different times
that I build it. I don't see any parameters on devenv command line
interface that seem to allow this. Should I be using something else
to compile the csproj file that would allow me to pass in preprocessor
defines?

i tried using nant but the <solution> doesn't seem to have anythign
that allows this either.

Have you tried using different project configurations for each
different set of symbols you want to be defined?
 
You must create a different configuration for each "define". This is done
through the Build \ Configuration Manager menu: In the dropdown combo for
your project ("Configuration" column), select "New..." and create a
configuration for each "define". Then, to set the "defines" for each
configuration, you select the project in the Solution Explorer, right-click
"properties", select the configuration in the combobox, go to
"Configuration Properties \ Build" node, and type your defines in the
"Custom constants" textbox. Click Apply and repeat for the next
configuration in the combobox. When compiling from the command line, you
pass the configuration name to the devenv.exe (see the docs).
--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
 
yea, I was trying to avoid having to use different configurations. I
can't believe there is no way to just pass in values. owell, guess
I'll just have to do that.
 
Back
Top