c# - Changing Conditional Compilation in project reference in Visual Studio -


i have class library used in other projects in solution b , c.

class library behaves differently based on presence of pre-processor directive, example :

#if some_directive       // code #else       // other code #end 

how can use class library in project b enabled some_directive use in project c disabled some_directive?

you can using conditionalattribute

this how debug.writeline() present or non-present depending on presence of "debug" symbol.

you able define own name conditional symbol use control presence or absence of code.

you can put symbol list in "conditional compilation symbols" settings on project properties "build" tab project want code.

this doesn't allow have "some other code" part unfortunately, , applies entire methods.


Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -