Difficulty: Easy
Correct Answer: Add a reference to the assembly that contains the namespace. Import the namespace with a using directive. Use its elements.
Explanation:
Introduction / Context:
To consume types from an external library, you must reference the assembly and optionally add using directives. This question checks the exact order of operations.
Given Data / Assumptions:
Concept / Approach:
Reference resolves the binary dependency; using resolves name lookup convenience within source code. Without the reference, the compiler/linker cannot locate the types, regardless of usings.
Step-by-Step Solution:
Verification / Alternative check:
Try to compile with only using and no reference; the build fails because the type is unresolved.
Why Other Options Are Wrong:
A confuses namespaces with assemblies; C misses the required reference; D is not sufficient; E is unnecessary for most scenarios and does not by itself wire references.
Common Pitfalls:
Believing using imports binaries, or thinking copying the DLL beside the EXE is enough without adding a reference.
Final Answer:
Add a reference to the assembly that contains the namespace. Import the namespace with a using directive. Use its elements.
Discussion & Comments