Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET - Conditional Web.config

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

like image 431
EOG Avatar asked Jan 30 '12 14:01

EOG


People also ask

Does ASP NET core have web config?

The web. config file has also been replaced in ASP.NET Core. Configuration itself can now be configured, as part of the application startup procedure described in Startup.

How do I change the trust level in web config?

Trust levels are associated with policy files using the <securityPolicy> configuration element, which is valid only in a site-level configuration (Web. config) file. You can add or remove trust levels by adding entries to the configuration section that specify the trust level name and the policy file to be used.

What is Xdt transform SetAttributes?

The xdt:Transform attribute value "SetAttributes" indicates that the purpose of this transform is to change attribute values of an existing element in the Web.


1 Answers

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

like image 154
Robert Levy Avatar answered Sep 17 '22 22:09

Robert Levy