Question

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.

Was it helpful?

Solution

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 

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top