Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

passing define into a build

3 views
Skip to first unread message

alex

unread,
May 11, 2005, 12:32:48 AM5/11/05
to
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.

Jon Skeet [C# MVP]

unread,
May 11, 2005, 1:47:52 AM5/11/05
to

Have you tried using different project configurations for each
different set of symbols you want to be defined?

--
Jon Skeet - <sk...@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Carlos J. Quintero [.NET MVP]

unread,
May 11, 2005, 6:23:18 AM5/11/05
to
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

"alex" <al...@sparkysys.com> escribió en el mensaje
news:oj238151ifvvflolv...@4ax.com...

alex

unread,
May 11, 2005, 9:05:47 PM5/11/05
to
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.
0 new messages