public CompileAssemblyFromFile ( |
||
options | ||
return |
using System.CodeDom.Compiler; using Microsoft.CSharp; CodeDomProvider provider = new CSharpCodeProvider(); CompilerResults results = provider.CompileAssemblyFromFile("path\\to\\source\\file.cs");
using System.CodeDom.Compiler; using Microsoft.VisualBasic; CodeDomProvider provider = new VBCodeProvider(); CompilerResults results = provider.CompileAssemblyFromFile("path\\to\\source\\file.vb");This example uses the VBCodeProvider to create a CodeDomProvider object, which is then used to compile a Visual Basic source code file into an assembly. The results object contains information about the compilation, such as errors and warnings. Package/Library: System.CodeDom.Compiler (part of the .NET Framework)
public CompileAssemblyFromFile ( |
||
options | ||
return |