successfuly运行与Visual Basic 2008 Express Edition的XPSP3主机上编写的应用程序后,我的EXE文件复制到新的Windows 7 主机...它没有太大的信息应声:如何调查VB.NET不在新主机上运行?
说明: 停止工作
问题签名:
问题事件名称:CLR20r3
问题签名01:MyApp.exe的
问题签名02:1.0.0.0
问题签名03:4eb2a385
问题签名04:MYAPP
问题签名05:1.0.0.0
问题签名06:4eb2a385
问题签名07:f
问题签名0 8:6
问题签名09信息:System.InvalidOperationException
OS版本:6.1.7600.2.0.0.256.1
区域设置ID:1033
我可以采取什么步骤来调查原因一个VB.NET应用程序不能在不同的主机上运行?
这是由于缺少依赖性。为了赶上这种类型的错误,添加以下到Form 1:
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
您是否使用可执行文件部署了.PDB? –
我的第一步是确保在新主机上支持用于创建应用程序的框架(例如,您是否需要.NET 4,但主机只有2.0?) – Widor
感谢您的提示。我添加了PDB文件,并且Windows7安装了.Net 4,但是我收到了同样的错误。 – Gulbahar