Programming in C# — Question 86
You are creating an application that reads from a database.
You need to use different databases during the development phase and the testing phase by using conditional compilation techniques.
What should you do?
Answer options
- A. Specify the /define compiler option.
- B. Decorate the code by using the [DebuggerDisplay("Mydebug")] attribute.
- C. Decorate the code by using the [assembly:AssemblyDelaySignAttribute(true)] attribute.
- D. Run the Assembly Linker tool from the Windows Software Development Kit (Windows SDK).
Correct answer: A
Explanation
The correct answer is A because using the /define compiler option allows you to define symbols that can be used for conditional compilation, enabling you to switch between different database configurations. Options B and C are related to debugging and assembly signing, respectively, and do not provide a means for conditional compilation. Option D involves linking assemblies but does not address database selection during development and testing.