Conditional compilation symbols and releases
I. Conditional compilation symbols
Conditional compilation is used to set some application scenarios in the code. The most common one is how DEBUG works; otherwise, how DEBUG works.
If you want to add some scenarios except DEBUG and TRACE, you can define the conditions yourself. The method is as follows: Right-click the project and select Properties. On the generate tab, enter the custom Conditional compilation symbol.
For example, the project we are working on now puts the login module on early, gets frequent login, get bored, and waste a lot of time. Then, I can set a Conditional compilation symbol, for example, NoLogin, and then in the Code:
# If NoLogin // forge a login information and do not log on... # Else // Well-Behaved login... # Endif
In this way, as long as the NoLogin condition compilation symbol is valid and exists, you do not need to log on.
The condition compilation symbol is saved in the project file.
Ii. Release
If you expand WEB. config in a web project, web. debug. config and web. release. config exist. This is the compilation option for release. For example, if you select "Release", the system will use the web. release. the configuration in config overwrites the web. the published web. config will be the overwritten version.
Note that the configuration for release replacement has some format requirements, but it is described in detail and can be written as needed.
If you have other release requirements besides debug and release, you can add them as needed. The method is:
Click Generate in the vs menu bar, select the Configuration Manager, and create a new one. For example, if I create a configuration scheme named NoLogin, the system will automatically add a web. NoLogin. config
Iii. Relationship between conditional compilers and releases
It does not seem to matter. Condition compilers are not supported in web. config. The condition compiler only starts with the code. However, it seems that the Code released by the debug and release schemes does not work for the customized conditional compilers. It is possible that debug and release are system-retained solutions and will automatically Clear Custom conditional compilers. Forget it. Don't try it.