1
votes

I have a problem running a C# application(WPF, .Net 4.0, Visual Studio 2010) targeted to x64 and uses 64bit dll (3rd party).

The problem appear when I run the 64bit version with 64bit dll(on 64bit Win7/WindowsServer2003). The application start OK. But when I hit start button on the app, where the app create thread and start interacting with the dll, the thread will crash/stop at the first call to dll function. Below is the error generated, when I close the app.

Problem signature:

Problem Event Name: APPCRASH

Application Name: DelayServer.exe

Application Version: 1.0.0.0

Application Timestamp: 52092104

Fault Module Name: KERNELBASE.dll

Fault Module Version: 6.1.7601.17965

Fault Module Timestamp: 506dcae6

Exception Code: e0434352

Exception Offset: 000000000000bccd

OS Version: 6.1.7601.2.1.0.272.7

Locale ID: 2057

Additional Information 1: 7315

Additional Information 2:
73159f4fb34892aabcc4ba245f14f64e

Additional Information 3: d5ec

Additional Information 4:
d5ec134b8e354c23783e48c0e2e572da

I understand that this is possible if there is a mismatch between the EXE and DLL i.e. EXE being a 32bit and DLL being 64bit or vice versa. Attached is the screenshot of my settings. I didn't find a way to verify/edit my x64 platform settings.

x64 Project Build Settings screenshot

My Development computer is Win Vista 32bit and I have installed 64bit compilers.

I have 32bit targeted application using 32bit dll working OK on 32bit comupters. The crash happens when I run 64bit targeted application with 64bit dll on 64bit computer

I tried dependencywalker, but I can't expland further to find any dependencies.

Can someone please help me with this.

Many Thanks Sam

1
So your trying to build an x64 app on a x32 machine? - sa_ddam213
Yes. Is that wrong?? I believe I am building for x64 as.I selected this in platform target, but I dont know how to edit/verify the settings for x64 platform. - SamVen
You gave us a description of the compile environment, now give us a description of the execution environment. What version of Windows is that, what versions of .NET are installed? - Ben Voigt
Actually, and if you have no unmanaged dependencies - you should try to avoid assigning bitness to managed dlls and exes. The runtime will handle this issue for you. - Arielr
@BenVoigt: The execution is on 64bit (Win7/Windows Server 2003). I checked .Net ennvironment is 4.0+. The app starts OK when I open. But when I click a start button on the app, It should make a 64bit dll function calls. The app crash right there.. I can't open the app on 32bit computer as it complain that "version of the file is not compatible with version of windows running" - SamVen

1 Answers

2
votes

I have finally resolved the problem.

When I used Microsoft Debug Diagnostic Tool (from http://www.microsoft.com/en-gb/download/details.aspx?id=26798) the crash dump shows that there is a problem loading my external dll or its dependencies. I then loaded the my external dll into Dependency Walker (http://dependencywalker.com/) it shows that it can't find a dependency "msvcp100.dll" which is linked to Microsoft VC++.

So I installed Microsoft re-distributable package (x64) and my app doesn't crash any more.

Thanks every one for your help...