C# HRESULT 0x80070057 是什么意思,为什么我的程序崩溃了?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14148543/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What does HRESULT 0x80070057 mean, and why is my program crashing?
提问by David Legg
I've written a program that takes two images, then runs an algorithm on them to isolate a hand in the "foreground" and match the gesture to a known one.
我编写了一个程序,它拍摄两张图像,然后在它们上运行算法以隔离“前景”中的一只手,并将手势与已知的手势相匹配。
A few days ago, I ran the program with some test parameters, just to test a few tweaks I had made, and it all worked fine. I have not touched the code since then.
几天前,我用一些测试参数运行了程序,只是为了测试我所做的一些调整,一切正常。从那以后我就没有碰过代码。
Today, I ran the program with two new images, and it crashed, giving me the error code 0x0
and HRESULT=0x80070057
. Beyond this, when I stopped debugging from C# Visual Studio 2010 Express, somehow, the debugging stopped, according to studio. But the form is still up, unresponsive, and unable to be closed, even from Task Manager. I can't run the program, because it says another instance is still running.
今天,我用两个新图像运行程序,它崩溃了,给了我错误代码0x0
和HRESULT=0x80070057
. 除此之外,根据工作室的说法,当我停止从 C# Visual Studio 2010 Express 调试时,不知何故,调试停止了。但是表单仍然启动,没有响应,并且无法关闭,即使从任务管理器中也是如此。我无法运行该程序,因为它说另一个实例仍在运行。
What could be causing this? And what can I try to fix it? I'd be happy to provide any other details that might be helpful; I'm relatively inexperienced and don't really know what is and isn't helpful.
什么可能导致这种情况?我可以尝试解决什么问题?我很乐意提供可能有帮助的任何其他详细信息;我相对缺乏经验,真的不知道什么是有帮助的,什么是没有帮助的。
Addition:I stopped and started studio, and that seems to have fixed the problem. Still, if someone can explain what may have happened, it would be much appreciated.
另外:我停止并启动了工作室,这似乎解决了问题。不过,如果有人能解释可能发生的事情,我们将不胜感激。
Another detail:The program crashed near the end of what it was supposed to do. I was able to start, load both pictures, and run the algorithm, but in the last step, it crashed on me.
另一个细节:程序在它应该做的接近尾声时崩溃了。我能够启动,加载两张图片并运行算法,但在最后一步,它在我身上崩溃了。
回答by jAC
From what I know the error code means, that an assembly couldn't be loaded. It is corrupt or not avaliable.
据我所知,错误代码意味着无法加载程序集。它已损坏或不可用。
Clear the \bin
folder of your project and the AppData (Temp) folder (located at C:\Users\your_username\AppData\Local\Temp\Temporary ASP.NET
) and see if the error still happens.
清除\bin
您的项目文件夹和 AppData (Temp) 文件夹(位于C:\Users\your_username\AppData\Local\Temp\Temporary ASP.NET
)并查看错误是否仍然发生。
Source MSDN
源MSDN
E_INVALIDARG
:One or more arguments are not valid (0x80070057
)
E_INVALIDARG
:一个或多个参数无效 (0x80070057
)
回答by Roberto Luis Bisbé
You may be using an assembly that couldn't be loaded correctly. For checking which one may fail I would recommend you this utility: http://www.dependencywalker.com/
您可能正在使用无法正确加载的程序集。为了检查哪一个可能失败,我会向您推荐这个实用程序:http: //www.dependencywalker.com/
It scans your app for dependencies and highlight the ones that were not found. In my case was a C++ assembly that was missing.
它会扫描您的应用程序的依赖项并突出显示未找到的那些。就我而言,缺少一个 C++ 程序集。