简体   繁体   English

C#在x64上崩溃

[英]C# Crash on x64

I have a DLL created in VS 2008 and written in C#. 我有一个在VS 2008中创建的DLL并用C#编写。 The dll project builds with the "Any CPU" flag. dll项目使用“Any CPU”标志构建。

When it is deployed and run on a Dell/Intel Windows 7 x64 machine it starts up OK, but it crashes when it tries to start using cryptography -- TDESAlgorithm.CreateDecryptor(); 当它在Dell / Intel Windows 7 x64计算机上部署并运行时,它启动正常,但在尝试开始使用加密时崩溃 - TDESAlgorithm.CreateDecryptor();

This is part of the mscorlib.dll. 这是mscorlib.dll的一部分。

I've built the app as targeting x64, but it also crashes in the same place. 我已经将应用程序构建为针对x64,但它也会在同一个地方崩溃。 It runs fine on 32 bit machines. 它在32位机器上运行良好。

How can I get this to run successfully on x64? 如何才能在x64上成功运行?

The solution I got is to compile as x86 and then run it (as 32 bits) application on the 64 bits machine. 我得到的解决方案是编译为x86,然后在64位机器上运行它(作为32位)应用程序。 This could be a solution as long as you don't need 64bits to run your app. 只要您不需要64位运行您的应用程序,这可能是一个解决方案。 - Gaël Mo - GaëlMo

I'd just like to point out that compiling and running for x86 on a 64 bit machine is NOT an answer... Joe would like to know why its crashing in x64 mode... obviously running in x86 mode works on x64 machines. 我只想指出在64位机器上编译和运行x86 并不是一个答案...... Joe想知道为什么它在x64模式下崩溃...显然在x86模式下运行可以在x64机器上运行。 If you couldn't get your car to run with a certain after-market part, would you consider it a valid answer if I told you to simply run the car without the part in it? 如果你不能让你的车在某个售后部分运行,如果我告诉你只是在没有零件的情况下运行汽车,你会认为这是一个有效的答案吗? Obviously not... Think carefully about your answers before posting them ok? 显然不是......在发布之前仔细考虑一下你的答案吗?

Does it run on the x64 machine if you build it for x86? 如果你为x86构建它,它是否在x64机器上运行? If so, they something isn't 64-bit ready. 如果是这样,他们的东西不是64位准备好的。 – sgmoore - sgmoore

I agree... I'd like to add that if you do not have the source code (you probably don't) then you are out of luck I'm afraid... I found THIS article that explains more fully... Apart from that, you may need to look into a different DES decryption library... OpenSSL/SSH perhaps? 我同意......我想补充一点,如果你没有源代码(你可能没有),那么你很运气我害怕......我发现这篇文章更全面地解释了......除此之外,你可能需要研究一个不同的DES解密库......也许是OpenSSL / SSH?

I ran into similar problem with windows services created in .NET. 我遇到了与.NET中创建的Windows服务类似的问题。 It was throwing exception and the Windows log file indicated errors in mscorlib.dll and kernel32.dll (if I remember correctly). 它抛出异常并且Windows日志文件指示mscorlib.dll和kernel32.dll中的错误(如果我没记错的话)。 No external 32 bits dll or special codes was used, only plain .NET. 没有使用外部32位dll或特殊代码,只有普通的.NET。

The solution I got is to compile as x86 and then run it (as 32 bits) application on the 64 bits machine. 我得到的解决方案是编译为x86,然后在64位机器上运行它(作为32位)应用程序。 This could be a solution as long as you don't need 64bits to run your app. 只要您不需要64位运行您的应用程序,这可能是一个解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM