Multiple choice technology programming languages

Which of the following is correct way to compile a C# program file.cs, and add a reference to an external assembly Vehicle.dll?

  1. csc /target:library file.cs

  2. csc /target:exe file.cs

  3. csc Vehicle.dll file.cs

  4. csc /r:Vehicle.dll file.cs

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The /r: compiler switch is used to reference external assemblies. The correct syntax is 'csc /r:Vehicle.dll file.cs' where /r:Vehicle.dll adds the reference, followed by the source file(s) to compile. The /target switch specifies output type but doesn't add references.