Multiple choice technology programming languages

Which Class in C# helps to compile a .cs file into .dll file programmatically ?

  1. System.Globalization

  2. System.Diagnostics

  3. CsharpCodeProvider

  4. IcodeCompiler

  5. All the Above

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

CsharpCodeProvider class in the System.CodeDom.Compiler namespace helps compile .cs files into .dll files programmatically. System.Globalization and System.Diagnostics are unrelated namespaces. ICodeCompiler is an interface, not a class.

AI explanation

CSharpCodeProvider (part of the Microsoft.CSharp namespace) exposes a compiler interface that lets you programmatically compile C# source code (a .cs file) into an assembly such as a .dll, using its CompileAssemblyFromFile/CompileAssemblyFromSource methods. System.Globalization and System.Diagnostics serve unrelated purposes (culture handling and process/logging diagnostics).