This has happened on the last 3 projects i created.
All projects only had a textbox and button with basic code.
If i comment out all code in the form, project runs.
Application.Designer.vb
ERRORCode:'------------------------------------------------------------------------------ ' <auto-generated> ' This code was generated by a tool. ' Runtime Version:4.0.30319.42000 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' </auto-generated> '------------------------------------------------------------------------------ Option Strict On Option Explicit On Namespace My 'NOTE: This file is auto-generated; do not modify it directly. To make changes, ' or if you encounter build errors in this file, go to the Project Designer ' (go to Project Properties or double-click the My Project node in ' Solution Explorer), and make changes on the Application tab. ' Partial Friend Class MyApplication <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses End Sub <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ Protected Overrides Sub OnCreateMainForm() Me.MainForm = Global.NewClientConsole.Form1 'ERROR HERE End Sub End Class End Namespace
System.InvalidOperationException
HResult=0x80131509
Message=An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an instance of an object.
Source=NewClientConsole
StackTrace:
at NewClientConsole.My.MyProject.MyForms.Create__Instance__[T](T Instance) in :line 190
at NewClientConsole.My.MyProject.MyForms.get_Form1()
at NewClientConsole.My.MyApplication.OnCreateMainForm() in C:\Users\mcapp\OneDrive\Documents\Visual Studio 2017\NewClientConsole\NewClientConsole\My Project\Application.Designer.vb:line 35
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at NewClientConsole.My.MyApplication.Main(String[] Args) in :line 81
Inner Exception 1:
NullReferenceException: Object reference not set to an instance of an object.




Reply With Quote