KERNELBASE。在Windows Server 2008 R2上运行c# app的dll错误?

时间:2022-02-16 20:30:42

I have a .NET 3.5 executable, compiled with 'Any CPU' and when I attempt to run it on Windows Server 2008 x64 R2 - It gives me:

我有一个。net 3.5可执行文件,它是用“任何CPU”编译的,当我试图在Windows Server 2008 x64 R2上运行它时,它给了我:

Faulting application name: mcb.exe, version: 0.1.0.8, time stamp: 0x4e08e871
Faulting module name: KERNELBASE.dll, version: 6.1.7600.16385, time stamp: 0x4a5bdfe0

Has anyone else encountered/solved this issue?

有其他人遇到/解决了这个问题吗?

I suspect the DLLImports is that it doesn't even make it to main() -- I should also add that this works fine on non-R2 Win Server 2008 x64

我怀疑DLLImports甚至没有把它变成main()——我还应该补充,这在非r2 Win Server 2008 x64上运行良好。

EDIT: Nevermind -- the dll import doesn't appear to be the cause of the issue -- I commented it out and tried it, the same behavior occurred. Renaming question.

编辑:Nevermind——dll导入似乎并不是问题的原因——我注释了它并尝试了它,同样的行为也发生了。重命名问题。

EDIT II: This kernel base dll error seems to be rather common but I can't find any reason why.

编辑II:这个内核库的dll错误似乎很常见,但我找不到任何理由。

Complete error per request:

完整的错误每个请求:

Faulting application name: mcb.exe, version: 0.1.0.8, time stamp: 0x4e08eb21
Faulting module name: KERNELBASE.dll, version: 6.1.7600.16385, time stamp: 0x4a5bdfe0
Exception code: 0xe0434f4d
Fault offset: 0x000000000000aa7d
Faulting process id: 0x%9
Faulting application start time: 0x%10
Faulting application path: %11
Faulting module path: %12
Report Id: %13

I can't attach a debugger in time and cannot install VS on faulting machine :-(

我不能及时安装调试器,不能在故障机器上安装VS . -(

Here is the windbg output, I'm afraid it is just gibberish to me... I don't know if anyone can make sense of it.

这是windbg的输出,我担心它只是gibberish。我不知道是否有人能理解。

Executable search path is: 
ModLoad: 00000000`01180000 00000000`0132c000   mcb.exe 
ModLoad: 00000000`77710000 00000000`778bc000   ntdll.dll
ModLoad: 000007fe`f4dc0000 000007fe`f4e2f000   C:\Windows\SYSTEM32\MSCOREE.DLL
ModLoad: 00000000`775f0000 00000000`7770f000   C:\Windows\system32\KERNEL32.dll
ModLoad: 000007fe`fd8f0000 000007fe`fd95b000   C:\Windows\system32\KERNELBASE.dll
(1870.15fc): Break instruction exception - code 80000003 (first chance)
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntdll.dll - 
ntdll!CsrSetPriorityClass+0x40:
00000000`777c0fb0 cc              int     3
0:000> g
ModLoad: 000007fe`fd500000 000007fe`fd557000   C:\Windows\system32\apphelp.dll
ModLoad: 000007fe`fea90000 000007fe`feb6b000   C:\Windows\system32\ADVAPI32.dll
ModLoad: 000007fe`fde60000 000007fe`fdeff000   C:\Windows\system32\msvcrt.dll
ModLoad: 000007fe`feb70000 000007fe`feb8f000   C:\Windows\SYSTEM32\sechost.dll
ModLoad: 000007fe`fdcb0000 000007fe`fddde000   C:\Windows\system32\RPCRT4.dll
ModLoad: 000007fe`fe7f0000 000007fe`fe861000   C:\Windows\system32\SHLWAPI.dll
ModLoad: 000007fe`ff9b0000 000007fe`ffa17000   C:\Windows\system32\GDI32.dll
ModLoad: 00000000`774f0000 00000000`775ea000   C:\Windows\system32\USER32.dll
ModLoad: 000007fe`fda40000 000007fe`fda4e000   C:\Windows\system32\LPK.dll
ModLoad: 000007fe`fe9c0000 000007fe`fea8a000   C:\Windows\system32\USP10.dll
ModLoad: 000007fe`ff980000 000007fe`ff9ae000   C:\Windows\system32\IMM32.DLL
ModLoad: 000007fe`fe2e0000 000007fe`fe3e9000   C:\Windows\system32\MSCTF.dll
ModLoad: 000007fe`f3cc0000 000007fe`f466e000   C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorwks.dll
ModLoad: 00000000`75370000 00000000`75439000   C:\Windows\WinSxS\amd64_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4927_none_88dce9872fb18caf\MSVCR80.dll
ModLoad: 000007fe`feb90000 000007fe`ff916000   C:\Windows\system32\shell32.dll
ModLoad: 000007fe`fe0d0000 000007fe`fe2d2000   C:\Windows\system32\ole32.dll
ModLoad: 000007fe`fd670000 000007fe`fd67f000   C:\Windows\system32\profapi.dll
ModLoad: 000007fe`f27e0000 000007fe`f36bb000   C:\Windows\assembly\NativeImages_v2.0.50727_64\mscorlib\10e3a3015e967b69f90d58230a694f67\mscorlib.ni.dll
ModLoad: 000007fe`fd560000 000007fe`fd56f000   C:\Windows\system32\CRYPTBASE.dll
ModLoad: 000007fe`f2650000 000007fe`f27d4000   C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorjit.dll
ModLoad: 00000642`ff4a0000 00000642`ff4aa000   C:\Windows\Microsoft.NET\Framework64\v2.0.50727\culture.dll
(1870.15fc): C++ EH exception - code e06d7363 (first chance)
(1870.15fc): C++ EH exception - code e06d7363 (first chance)
(1870.15fc): C++ EH exception - code e06d7363 (first chance)
(1870.15fc): C++ EH exception - code e06d7363 (first chance)
(1870.15fc): C++ EH exception - code e06d7363 (first chance)
(1870.15fc): CLR exception - code e0434f4d (first chance)
(1870.15fc): C++ EH exception - code e06d7363 (first chance)
(1870.15fc): C++ EH exception - code e06d7363 (first chance)
(1870.15fc): C++ EH exception - code e06d7363 (first chance)
(1870.15fc): C++ EH exception - code e06d7363 (first chance)
(1870.15fc): C++ EH exception - code e06d7363 (first chance)
(1870.15fc): CLR exception - code e0434f4d (first chance)
ModLoad: 000007fe`f1c30000 000007fe`f264e000   C:\Windows\assembly\NativeImages_v2.0.50727_64\System\98ac7ad6dcf7484bf8b4478ea6951cb6\System.ni.dll
ModLoad: 000007fe`f19f0000 000007fe`f1c27000   C:\Windows\assembly\NativeImages_v2.0.50727_64\System.Drawing\62f46b8689863e5f23b1b69fe9c92eaf\System.Drawing.ni.dll
ModLoad: 000007fe`f0950000 000007fe`f19e6000   C:\Windows\assembly\NativeImages_v2.0.50727_64\System.Windows.Forms\1109b73499e4e9b612bf55e2014d94df\System.Windows.Forms.ni.dll
(1870.15fc): C++ EH exception - code e06d7363 (first chance)
(1870.15fc): C++ EH exception - code e06d7363 (first chance)
(1870.15fc): C++ EH exception - code e06d7363 (first chance)
(1870.15fc): C++ EH exception - code e06d7363 (first chance)
(1870.15fc): C++ EH exception - code e06d7363 (first chance)
(1870.15fc): CLR exception - code e0434f4d (first chance)
(1870.15fc): C++ EH exception - code e06d7363 (first chance)
(1870.15fc): CLR exception - code e0434f4d (first chance)
(1870.15fc): CLR exception - code e0434f4d (!!! second chance !!!)
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\Windows\system32\KERNELBASE.dll - 
KERNELBASE!RaiseException+0x3d:
000007fe`fd8faa7d 4881c4c8000000  add     rsp,0C8h

More information:

更多信息:

0:000> |* ~* kp

.  0  Id: 198c.1874 Suspend: 1 Teb: 000007ff`fffde000 Unfrozen
Child-SP          RetAddr           Call Site
00000000`0043a8c0 00000000`753a96d0 KERNELBASE!RaiseException+0x39
00000000`0043a990 00000000`7775f001 MSVCR80!_CxxCallCatchBlock+0x180
00000000`0043aa40 000007fe`f3e721da ntdll!RcFrameConsolidation+0x3
00000000`0043e640 000007fe`f3e3543f mscorwks!MethodDesc::MakeJitWorker+0x1ea
00000000`0043e760 000007fe`f3e2702a mscorwks!MethodDesc::DoPrestub+0x116f
00000000`0043e910 000007fe`f3f8d387 mscorwks!PreStubWorker+0x1fa
00000000`0043e9d0 000007fe`f3f8d4a2 mscorwks!ThePreStubAMD64+0x87
00000000`0043eaa0 000007fe`f3e66ef3 mscorwks!CallDescrWorker+0x82
00000000`0043eaf0 000007fe`f3e56d1f mscorwks!CallDescrWorkerWithHandler+0xd3
00000000`0043eb90 000007fe`f3ee35b7 mscorwks!MethodDesc::CallDescr+0x24f
00000000`0043ede0 000007fe`f3eff358 mscorwks!ClassLoader::RunMain+0x22b
00000000`0043f040 000007fe`f3ec7835 mscorwks!Assembly::ExecuteMainMethod+0xbc
00000000`0043f330 000007fe`f3db349f mscorwks!SystemDomain::ExecuteMainMethod+0x491
00000000`0043f900 000007fe`f3ef8ab0 mscorwks!ExecuteEXE+0x47
00000000`0043f950 000007fe`f5195b21 mscorwks!CorExeMain+0xac
00000000`0043f9b0 00000000`7760f56d MSCOREE!CorExeMain_Exported+0x57
00000000`0043f9e0 00000000`77742cc1 KERNEL32!BaseThreadInitThunk+0xd
00000000`0043fa10 00000000`00000000 ntdll!RtlUserThreadStart+0x1d

   1  Id: 198c.13f8 Suspend: 1 Teb: 000007ff`fffdc000 Unfrozen
Child-SP          RetAddr           Call Site
00000000`020df7f8 000007fe`fd8f13a6 ntdll!NtWaitForMultipleObjects+0xa
00000000`020df800 00000000`775ff190 KERNELBASE!WaitForMultipleObjectsEx+0xe8
00000000`020df900 000007fe`f3f1b525 KERNEL32!WaitForMultipleObjects+0xb0
00000000`020df990 000007fe`f3efe331 mscorwks!DebuggerRCThread::MainLoop+0xbd
00000000`020dfa40 000007fe`f3db5caa mscorwks!DebuggerRCThread::ThreadProc+0xf9
00000000`020dfa90 00000000`7760f56d mscorwks!DebuggerRCThread::ThreadProcStatic+0x56
00000000`020dfae0 00000000`77742cc1 KERNEL32!BaseThreadInitThunk+0xd
00000000`020dfb10 00000000`00000000 ntdll!RtlUserThreadStart+0x1d

   2  Id: 198c.1840 Suspend: 1 Teb: 000007ff`fffda000 Unfrozen
Child-SP          RetAddr           Call Site
00000000`1ae1f608 000007fe`fd8f10ac ntdll!ZwWaitForSingleObject+0xa
00000000`1ae1f610 000007fe`f3df72e2 KERNELBASE!WaitForSingleObjectEx+0x79
00000000`1ae1f6b0 000007fe`f3df73d3 mscorwks!ZapImage::OutputDebugInfo+0xaa
00000000`1ae1f710 000007fe`f3f0f0a9 mscorwks!CLREvent::WaitEx+0x63
00000000`1ae1f7c0 000007fe`f3ef922a mscorwks!WKS::WaitForFinalizerEvent+0x49
00000000`1ae1f7f0 000007fe`f3ee4ffc mscorwks!WKS::GCHeap::FinalizerThreadWorker+0x4a
00000000`1ae1f830 000007fe`f3ea85ad mscorwks!MethodTableBuilder::AllocateFromHighFrequencyHeap+0x70
00000000`1ae1f880 000007fe`f3ef0f2d mscorwks!List<tagNgenDependents * __ptr64>::AddTail+0x11d
00000000`1ae1f950 000007fe`f3da4d1e mscorwks!ZapStubPrecode::GetType+0x39
00000000`1ae1f990 000007fe`f3eff984 mscorwks!ManagedThreadBase_NoADTransition+0x42
00000000`1ae1f9f0 000007fe`f3db0718 mscorwks!WKS::GCHeap::FinalizerThreadStart+0x74
00000000`1ae1fa30 00000000`7760f56d mscorwks!Thread::intermediateThreadProc+0x78
00000000`1ae1fb00 00000000`77742cc1 KERNEL32!BaseThreadInitThunk+0xd
00000000`1ae1fb30 00000000`00000000 ntdll!RtlUserThreadStart+0x1d

Seems like when I run 'analyze', the money error file is

似乎当我运行“分析”时,金钱错误文件是。

EXCEPTION_MESSAGE:  Could not load file or assembly 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a
MANAGED_OBJECT_NAME:  System.IO.FileNotFoundException
MANAGED_STACK_COMMAND:  !pe 24b6010

But I don't understand how this could be -- .NET 3.5 is installed!

但我不明白这是怎么回事——net 3.5安装了!


I'm an idiot - I had to go enable .NET Framework 3.5.1 Features in the Features Pane of Win2008 R2 x64. I guess at least I learned a little about windbg...

我是一个很傻的人,我必须在Win2008 R2 x64的特性窗格中启用。net Framework 3.5.1特性。我想至少我学到了一些关于windbg的知识…

3 个解决方案

#1


6  

Exception 0xE0434F4D is an unhandled CLR exception. Most likely the KERNELBASE stuff was just the library function to raise the exception - RtlRaiseException or similar. You'll need to either catch the exception in your CLR code, create a crash dump, or attach a debugger (such as windbg) to get details, such as a stack trace. This MSDN blog post has an example of using windbg to diagnose a CLR crash.

异常0xE0434F4D是一个未处理的CLR异常。最可能的是,KERNELBASE的内容仅仅是库函数来引发异常——RtlRaiseException或类似的。您需要在CLR代码中捕获异常,创建一个崩溃转储,或者附加一个调试器(比如windbg)来获取详细信息,比如堆栈跟踪。这个MSDN博客文章有一个使用windbg来诊断CLR崩溃的例子。

#2


3  

I just encountered this issue in a Windows form App I created. Apparently there is a plethora of issues that can cause this. In my case you could open the Task Manager, click the application, see it open in the task manager, and immediately close. The only way to see what the issue was, was to look at the event viewer and find the error.

我在我创建的Windows窗体应用程序中遇到了这个问题。显然,有太多的问题可以导致这种情况。在我的情况下,您可以打开任务管理器,单击应用程序,在任务管理器中看到它打开,然后立即关闭。查看问题的唯一方法是查看事件查看器并找到错误。

I had a method running in the constructor of Program.cs which is the first thing instantiated when you start a windows form app. I had a bug in code that was causing an exception before any exception handling was created. To fix the problem I moved the code to a point after I create an unhandled exception method as such:

我有一个在程序构造函数中运行的方法。当你启动一个windows窗体应用程序时,它是第一个实例化的东西。在创建任何异常处理之前,我有一个代码错误导致异常。为了解决这个问题,我在创建了一个未处理的异常方法之后将代码移动到一个点:

AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

AppDomain.CurrentDomain。新UnhandledExceptionEventHandler UnhandledException + =(CurrentDomain_UnhandledException);

in my forms constructor. Now the program would start and actually throw an error. I then just had to fix the bug in my code.

我在形式的构造函数。现在程序会启动并抛出一个错误。然后我只需要修正代码中的错误。

I hope this can help you or anyone else out there.

我希望这能帮助你或其他任何人。

#3


0  

I had a program in vb running on four machines but one. After remote debugging I found I had a DataGridView showing different columns on different machines. For this machine one columnname was misspelled. This caused the above error.

我在vb中运行了一个程序,运行在4台机器上。在远程调试之后,我发现我有一个DataGridView,它显示了不同机器上的不同列。对于这台机器,一个columnname是拼错的。这导致了上述错误。

#1


6  

Exception 0xE0434F4D is an unhandled CLR exception. Most likely the KERNELBASE stuff was just the library function to raise the exception - RtlRaiseException or similar. You'll need to either catch the exception in your CLR code, create a crash dump, or attach a debugger (such as windbg) to get details, such as a stack trace. This MSDN blog post has an example of using windbg to diagnose a CLR crash.

异常0xE0434F4D是一个未处理的CLR异常。最可能的是,KERNELBASE的内容仅仅是库函数来引发异常——RtlRaiseException或类似的。您需要在CLR代码中捕获异常,创建一个崩溃转储,或者附加一个调试器(比如windbg)来获取详细信息,比如堆栈跟踪。这个MSDN博客文章有一个使用windbg来诊断CLR崩溃的例子。

#2


3  

I just encountered this issue in a Windows form App I created. Apparently there is a plethora of issues that can cause this. In my case you could open the Task Manager, click the application, see it open in the task manager, and immediately close. The only way to see what the issue was, was to look at the event viewer and find the error.

我在我创建的Windows窗体应用程序中遇到了这个问题。显然,有太多的问题可以导致这种情况。在我的情况下,您可以打开任务管理器,单击应用程序,在任务管理器中看到它打开,然后立即关闭。查看问题的唯一方法是查看事件查看器并找到错误。

I had a method running in the constructor of Program.cs which is the first thing instantiated when you start a windows form app. I had a bug in code that was causing an exception before any exception handling was created. To fix the problem I moved the code to a point after I create an unhandled exception method as such:

我有一个在程序构造函数中运行的方法。当你启动一个windows窗体应用程序时,它是第一个实例化的东西。在创建任何异常处理之前,我有一个代码错误导致异常。为了解决这个问题,我在创建了一个未处理的异常方法之后将代码移动到一个点:

AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

AppDomain.CurrentDomain。新UnhandledExceptionEventHandler UnhandledException + =(CurrentDomain_UnhandledException);

in my forms constructor. Now the program would start and actually throw an error. I then just had to fix the bug in my code.

我在形式的构造函数。现在程序会启动并抛出一个错误。然后我只需要修正代码中的错误。

I hope this can help you or anyone else out there.

我希望这能帮助你或其他任何人。

#3


0  

I had a program in vb running on four machines but one. After remote debugging I found I had a DataGridView showing different columns on different machines. For this machine one columnname was misspelled. This caused the above error.

我在vb中运行了一个程序,运行在4台机器上。在远程调试之后,我发现我有一个DataGridView,它显示了不同机器上的不同列。对于这台机器,一个columnname是拼错的。这导致了上述错误。