【问题标题】:App exe crashing at startup. Faulting module path c:\windows\syswow64\kernalbase.dll应用程序 exe 在启动时崩溃。错误模块路径 c:\windows\syswow64\kernalbase.dll
【发布时间】:2012-08-22 01:14:33
【问题描述】:

每当我尝试在不是我的机器上启动我的应用程序时,它都会在启动时崩溃。我不知所措,做了很多没有解决办法的搜索。没有真正的错误,我只是让标准 Windows 7 没有响应。所有机器都是win7Pro 64和.net4。我在下面看到事件查看器日志。

事件 ID 1000:

Faulting application name: MarketingRequests.exe, version: 1.0.0.0, time stamp: 0x5033e787

Faulting module name: KERNELBASE.dll, version: 6.1.7601.17651, time stamp: 0x4a5bdbdf

Exception code: 0xe0434352

Fault offset: 0x0000b9bc

Faulting process id: 0x1ecc

Faulting application start time: 0x01cd7fe56831cfd9

Faulting application path: C\Intranet\MarketingRequests.exe

Faulting module path: C:\Windows\syswow64\KERNELBASE.dll

Report Id: a78399b1-ebd8-11e1-9474-f04da20e6eaf

我还看到事件 ID 1026,.net 运行时:

Log Name:      Application
Source:        .NET Runtime
Date:          8/21/2012 9:08:53 PM
Event ID:      1026
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      CORRIE-Z.msing.local
Description:
Application: ExpenseReport.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidOperationException

Stack:

在 System.Data.Linq.SqlClient.SqlProvider.Execute(System.Linq.Expressions.Expression, QueryInfo, System.Data.Linq.SqlClient.IObjectReaderFactory, System.Object[], System.Object[], System. Data.Linq.SqlClient.ICompiledSubQuery[], System.Object) 在 System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(System.Linq.Expressions.Expression,QueryInfo[],System.Data.Linq.SqlClient.IObjectReaderFactory,System.Object[],System.Data.Linq.SqlClient.ICompiledSubQuery []) 在 System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(System.Linq.Expressions.Expression) 在 System.Data.Linq.DataQuery1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].System.Linq.IQueryProvider.Execute[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Linq.Expressions.Expression) at System.Linq.Queryable.First[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Linq.IQueryable1) 在 ExpenseReport.frmMain.refreshEmpInfo() 在 ExpenseReport.frmMain..ctor() 在 ExpenseReport.Program.Main()

事件 XML: 1026 2 0 0x80000000000000 26474 应用 CORRIE-Z.msing.local 应用程序:ExpenseReport.exe 框架版本:v4.0.30319 说明:进程因未处理的异常而终止。 异常信息:System.InvalidOperationException 堆: 在 System.Data.Linq.SqlClient.SqlProvider.Execute(System.Linq.Expressions.Expression,QueryInfo,System.Data.Linq.SqlClient.IObjectReaderFactory,System.Object[],System.Object[],System.Data.Linq .SqlClient.ICompiledSubQuery[], System.Object) 在 System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(System.Linq.Expressions.Expression,QueryInfo[],System.Data.Linq.SqlClient.IObjectReaderFactory,System.Object[],System.Data.Linq.SqlClient.ICompiledSubQuery []) 在 System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(System.Linq.Expressions.Expression) 在 System.Data.Linq.DataQuery1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].System.Linq.IQueryProvider.Execute[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Linq.Expressions.Expression) at System.Linq.Queryable.First[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Linq.IQueryable1) 在 ExpenseReport.frmMain.refreshEmpInfo() 在 ExpenseReport.frmMain..ctor() 在 ExpenseReport.Program.Main()

【问题讨论】:

  • "所有机器都是win7Pro 64"。您的机器可能是 32 位的,并且您有 32 位的依赖项,而只是其他所有的都是 64 位的?如果这是真的,并且您使用“Any CPU”目标选项进行编译,则会产生这个错误,或者非常接近它。
  • 我的机器是 32 位的。我解决了这个问题。这是 sql 数据库权限。

标签: c# .net winforms c#-4.0 linq-to-sql


【解决方案1】:

看起来frmMain.refreshEmpInfo 包含一个从数据库中检索记录的 LINQ 查询,并且 LINQ 查询调用 First() 来获取第一条记录。是否有可能没有返回记录,这会导致First() 抛出InvalidOperationException

(如果您将代码发布在 frmMain.refreshEmpInfo 中可能会有所帮助。您可能还希望将该代码包装在 try...catch 块中并在消息框中显示异常详细信息。)

【讨论】:

  • 在考虑了您的答案后,我弄清楚了为什么它不起作用。我没有正确设置 sql 数据库权限。
猜你喜欢
  • 2021-11-27
  • 1970-01-01
  • 2019-02-24
  • 2017-04-10
  • 2016-09-02
相关资源
最近更新 更多