3

I'm trying to pass an additional conditional compilation symbol via devenv (vs2010) on the command line to the C# compiler.

I know it can be done for the C++ compiler through the CL environment variables. Is there something similar possible for C#?

Since this build pass needs to run Code Analysis, I'm stuck with using devenv to launch the build, as far as I know.

Frederik
  • 2,921
  • 1
  • 17
  • 26

2 Answers2

2

You can't specify any compilation symbols via the command line to devenv.exe but you can create a separate solution configuration and refer to it in the command line:

devenv.exe SolutionName /build SolnConfigName 
Mark Cidade
  • 98,437
  • 31
  • 224
  • 236
0

In the project settings under build there is a setting "symbols for conditional compilation", at least in vs2008, but I think vs2010 wilkl provide similar.

codymanix
  • 28,510
  • 21
  • 92
  • 151