After successfuly running an application written with Visual Basic 2008 Express Edition on an XPSP3 host, I copied the EXE file to a fresh Windows 7 host... And it crashed with not much information:
Description: Stopped working
Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01: myapp.exe
Problem Signature 02: 1.0.0.0
Problem Signature 03: 4eb2a385
Problem Signature 04: myapp
Problem Signature 05: 1.0.0.0
Problem Signature 06: 4eb2a385
Problem Signature 07: f
Problem Signature 08: c6
Problem Signature 09: System.InvalidOperationException
OS Version: 6.1.7600.2.0.0.256.1
Locale ID: 1033
What steps can I take to investigate why a VB.NET application doesn't run on a different host?
It was due to a missing dependency. To catch this type of error, add the following to Form1:
Public Sub New()
AddHandler Application.ThreadException, AddressOf OnThreadException
AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf UnhandledExceptionEventRaised
InitializeComponent()
End Sub
Private Sub UnhandledExceptionEventRaised(ByVal sender As Object, ByVal e As UnhandledExceptionEventArgs)
If e.IsTerminating Then
Dim o As Object = e.ExceptionObject
MessageBox.Show(o.ToString) ' use EventLog instead
End If
End Sub
Private Sub OnThreadException(ByVal sender As Object, _
ByVal e As ThreadExceptionEventArgs)
' This is where you handle the exception
MessageBox.Show(e.Exception.Message)
End Sub