Oct 21, 2017 08:55 AM
(This post was last modified: Oct 21, 2017 09:05 AM by CacheIsAFag.)
EDIT: I have fixed this issue, It was a common bug found in .net framework 2.0, I switched to 4.5.2 and it fixed the issue :)
I'm getting this error on the Dim results line:
{"Object reference not set to an instance of an object."}
Code:
Form1 Button Press (i have 2 text boxes, one for message and one for title)
SourceCode.txt (the stub)
I'm getting this error on the Dim results line:
{"Object reference not set to an instance of an object."}
Code:
Form1 Button Press (i have 2 text boxes, one for message and one for title)
Quote: Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
SaveFileDialog1.ShowDialog()
Dim compiler As System.CodeDom.Compiler.ICodeCompiler = New VBCodeProvider().CreateCompiler
Dim parameters As New System.CodeDom.Compiler.CompilerParameters
parameters.ReferencedAssemblies.Add("System.Windows.Forms.dll")
parameters.GenerateExecutable = True
parameters.OutputAssembly = SaveFileDialog1.FileName
parameters.CompilerOptions = "/target:winexe"
Dim title As String = TextBox1.Text
Dim message As String = TextBox2.Text
Dim results As System.CodeDom.Compiler.CompilerResults = compiler.CompileAssemblyFromSource(parameters, My.Resources.SourceCode.Replace("title", title).Replace("message", message)) 'line that i'm getting the error on'
End Sub
SourceCode.txt (the stub)
Quote:Imports System
Imports System.Windows.Forms
Namespace MyApp
Public Class EntryPoint
Public Shared Sub Main()
MessageBox.Show("message", "title", MessageBoxButtons.YesNoCancel)
End Sub
End Class
End Namespace
Need Something? HMU i can provide almost anything.

