Tento di riavviare l'applicazione con il comado:
...
System.Windows.Forms.Application.Restart()
...
Effettivamente si riavvia ma in debug mi restituisce quest'eccezione, però l'applicazione funziona...
System.NullReferenceException non è stata gestita
Message="Riferimento a un oggetto non impostato su un'istanza di oggetto."
Source="Microsoft.VisualBasic"
StackTrace:
in Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.MainFormLoadingDone(Object sender, EventArgs e)
in System.EventHandler.Invoke(Object sender, EventArgs e)
in System.Windows.Forms.Form.OnLoad(EventArgs e)
in System.Windows.Forms.Form.OnCreateControl()
in System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
in System.Windows.Forms.Control.CreateControl()
in System.Windows.Forms.Control.WmShowWindow(Message& m)
in System.Windows.Forms.Control.WndProc(Message& m)
in System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
in System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
in System.Windows.Forms.Form.WmShowWindow(Message& m)
in System.Windows.Forms.Form.WndProc(Message& m)
in System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
in System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
in System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
in System.Windows.Forms.SafeNativeMethods.ShowWindow( HandleRef hWnd, Int32 nCmdShow)
in System.Windows.Forms.Control.SetVisibleCore(Boolea n value)
in System.Windows.Forms.Form.SetVisibleCore(Boolean value)
in System.Windows.Forms.Control.set_Visible(Boolean value)
in System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32 reason, ApplicationContext context)
in System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason, ApplicationContext context)
in System.Windows.Forms.Application.Run(ApplicationCo ntext context)
in Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.OnRun()
in Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.DoApplicationModel()
in Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.Run(String[] commandLine)
in SoftwareTestLicenza.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:riga 81
in System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
in System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
in Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssembly()
in System.Threading.ThreadHelper.ThreadStart_Context( Object state)
in System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state)
in System.Threading.ThreadHelper.ThreadStart()