By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,663 Members | 1,337 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,663 IT Pros & Developers. It's quick & easy.

passing define into a build

P: n/a
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.

Nov 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
alex <al**@sparkysys.com> wrote:
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?

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

P: n/a
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:oj********************************@4ax.com...
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.

Nov 17 '05 #3

P: n/a
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.

On Wed, 11 May 2005 12:23:18 +0200, "Carlos J. Quintero [.NET MVP]"
<ca*****@NOSPAMsogecable.com> wrote:
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).


Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.