Winforms Windows窗体应用程序立即崩溃

Winforms Windows窗体应用程序立即崩溃,winforms,visual-studio-2010,entity-framework,Winforms,Visual Studio 2010,Entity Framework,我已经检查了CPU编译选项,并确保设置了所有CPU。以下是事件查看器中的日志 Application: QuickBooks-Sync.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.ArgumentException Stack: at System.Data.EntityClien

我已经检查了CPU编译选项,并确保设置了所有CPU。以下是事件查看器中的日志

Application: QuickBooks-Sync.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentException
Stack:
   at System.Data.EntityClient.EntityConnection.GetFactory(System.String)
   at System.Data.EntityClient.EntityConnection.ChangeConnectionString(System.String)
   at System.Data.Objects.ObjectContext..ctor(System.String, System.String)
   at LSTQBEntities.QBEntities..ctor()
   at QuickBooks_Sync.Form1..ctor()
   at QuickBooks_Sync.Program.Main()

存在未通过安装包安装的数据提供程序。安装数据提供程序后,一切正常

请在Form1构造函数中发布代码。或者,移动InitializeComponent()之外的所有内容;从Form1构造函数中取出并在表单的OnLoad事件中执行-然后将该代码包装在try/catch块中。也许lstqbenties.qbenties构造函数代码可以帮助解决Form1构造函数中没有任何内容(除了InitializeComponent())&我的加载中也没有任何内容。.exe在我的开发计算机上运行良好。您需要提供有关您在这里执行的操作的更多信息。。。应用程序是否加载外部DLL(如一些Quickbooks API或其他)?这些DLL是否存在于您的计算机上而不是目标计算机上?将来,请尝试使用try-catch块捕获异常,以便您可以处理它们。例如,您可以将错误消息输出到日志文件或GUI,这样您就可以了解应用程序失败的确切原因。