Hi there, I would like to find out how I can make this work... I have a Text file containing two classes, but the compiler keeps on failing... A bit frustrated now... Been battling for about a week... Please help.
IN TEXT FILE... If you would like to see the code I can send it via email
1. Public Class Form1
2. Public Class Settings
This is how far I got
Private Function Compile(ByVal output As String) As Boolean
Dim result As Boolean
Dim vbcode As VBCodeProvider = New VBCodeProvider
Dim compiler As ICodeCompiler = vbcode.CreateCompiler()
Dim compargs As New CompilerParameters()
compargs.GenerateInMemory = False
Dim references() As String = {"System.Windows.Forms.dll", "System.Drawing.dll", "Microsoft.VisualBasic.dll", "System.dll"}
compargs.CompilerOptions = "/target:winexe /m:Form1 /win32icon:" & "C:\install.ico"
compargs.GenerateExecutable = True
compargs.IncludeDebugInformation = False
compargs.OutputAssembly = output
compargs.TreatWarningsAsErrors = False
compargs.ReferencedAssemblies.AddRange(references)
Dim res As CompilerResults
res = compiler.CompileAssemblyFromFile(compargs, "C:\TDIR\prg.txt")
If res.Errors.Count > 0 Then
result = False
Else
result = True
End If
Return result
End Function