C# 在 x64 上崩溃
我有一个在 VS 2008 中创建并用 C# 编写的 DLL。 该 dll 项目使用“Any CPU”标志构建。
当它在 Dell/Intel Windows 7 x64 计算机上部署和运行时,它启动正常,但当它尝试开始使用加密时崩溃 - TDESAlgorithm.CreateDecryptor();
这是 mscorlib.dll 的一部分。
我已经将应用程序构建为针对 x64,但它也在同一位置崩溃。它在 32 位机器上运行良好。
我怎样才能让它在 x64 上成功运行?
I have a DLL created in VS 2008 and written in C#.
The dll project builds with the "Any CPU" flag.
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();
This is part of the mscorlib.dll.
I've built the app as targeting x64, but it also crashes in the same place. It runs fine on 32 bit machines.
How can I get this to run successfully on x64?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在 .NET 中创建的 Windows 服务中遇到了类似的问题。它抛出异常,Windows 日志文件指示 mscorlib.dll 和 kernel32.dll 中存在错误(如果我没记错的话)。没有使用外部 32 位 dll 或特殊代码,仅使用纯 .NET。
我得到的解决方案是编译为 x86,然后在 64 位机器上运行它(作为 32 位)应用程序。只要您不需要 64 位来运行您的应用程序,这可能是一个解决方案。
I ran into similar problem with windows services created in .NET. It was throwing exception and the Windows log file indicated errors in mscorlib.dll and kernel32.dll (if I remember correctly). No external 32 bits dll or special codes was used, only plain .NET.
The solution I got is to compile as x86 and then run it (as 32 bits) application on the 64 bits machine. This could be a solution as long as you don't need 64bits to run your app.
我只是想指出,在 64 位机器上编译并运行 x86 不是一个答案...Joe 想知道为什么会这样在 x64 模式下崩溃...显然在 x86 模式下运行可以在 x64 机器上运行。如果您无法让您的汽车配备某个售后零件来运行,那么如果我告诉您只需运行不带该零件的汽车,您会认为这是一个有效的答案吗?显然不是...在发布答案之前仔细考虑一下您的答案好吗?
我同意...我想补充一点,如果你没有源代码(你可能没有)那么你恐怕运气不好...我发现 这篇文章更全面地解释了... 除此之外,您可能需要研究一下不同的 DES 解密库...也许是 OpenSSL/SSH?
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. 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?
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?