Which Class in C# helps to compile a .cs file into .dll file programmatically ?
-
System.Globalization
-
System.Diagnostics
-
CsharpCodeProvider
-
IcodeCompiler
-
All the Above
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.
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).