9

I'm new to ASP and wanted to know if it has conditional "compiling" (I know it is not compiled)

What I mean is: My app is delivered to diferent users. Each has it's own conditional app compilation. Now I need to condicionaly change Web.config's is there a way to use conditional compilation symbols ?

EOG

EOG
  • 1,677
  • 2
  • 22
  • 36

2 Answers2

8

transformations that @Daniel mentioned are great if their deployment requirements meet your needs. an alternative approach which is less powerful but easier to deploy is using the configSource attribute in your main config file to specify that certain sections should be loaded from other files. http://msdn.microsoft.com/en-us/library/system.configuration.sectioninformation.configsource.aspx

Robert Levy
  • 28,747
  • 6
  • 62
  • 94
5

There is nothing like that for config files. The best thing to use is configuration file transformations.

Here is some documentation: http://msdn.microsoft.com/en-us/library/ie/dd465318.aspx

Daniel A. White
  • 187,200
  • 47
  • 362
  • 445
  • 4
    I'm not sure different build configurations for different customers is the right way to go, but if you're going that way I'd second @Daniel's recommendation – Dave Watts Jan 30 '12 at 14:16
  • 1
    Note that these transformations are applied only when publishing, not when building – JBSnorro Mar 28 '18 at 09:47