You have created an application to interface with an inventory storage system, and want to enable
tracing in the application to track stock shortages and surpluses.
The application should not, however, trace inventory levels if no shortages or surpluses exist.
In addition, you do not want recompile every time to switch tracing capabilities on or off.
What should you do?
A.
Specify a command-line argument named InventoryTrace, and configure the application to read the argument.
B.
Specify a system-wide environmental variable named InventoryTrace, and configure the application to read the environmental variable.
C.
Specify a registry key named InventoryTrace, and configure the application to read the registry key setting.
D.
Specify a BooleanSwitch named InventoryTrace, and configure it in the application configuration file.
Explanation:
The BooleanSwitch class is used to toggle trace messages on and off. The application configuration is intended to manage any application-specific settings, including tracing.
The value of the Enabled property determines whether the BooleanSwitch is turned on or off. This value is set in the application configuration file. If the value is 0, then the BooleanSwitch object is turned off and the Enabled property returns false.
If the value is any other value, the BooleanSwitch object is turned on and the Enabled property returns true.
Incorrect Answers:
A: This option requires the application to run from the command-line.
B: This option requires EnvironmentPermission and is intended for more complex application settings.
C: This option requires RegistryPermission and is intended for system-wide settings, not for application-specific settings.
I agree with the answer. D