0

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.

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.

H. Pauwelyn
  • 13,575
  • 26
  • 81
  • 144
David Legg
  • 271
  • 1
  • 4
  • 12
  • possible duplicate of [Could not load file or assembly ... The parameter is incorrect](http://stackoverflow.com/questions/8269386/could-not-load-file-or-assembly-the-parameter-is-incorrect) – Yuck Jan 03 '13 at 22:54
  • I don't think It's not a duplicate because this is not ASP.net related. – Roberto Luis Bisbé Jan 03 '13 at 22:57
  • IIRC there are one or two error codes (HResults) that are relatively generic, and that is one of them - i.e. it cannot be traced to a specific error. (I used to strike that reasonably frequently back when doing WinAPI on VB6). – slugster Jan 03 '13 at 22:59
  • @rlbisbe: I googled for the code and it seems that it's asp.net related, maybe the poster wasn't tagging the thread correctly. – jAC Jan 03 '13 at 23:00
  • The only way the program uses ASP.net would be if that is included in the standard C#, Windows, or Microsoft Visual C# studio packages. I have never explicitly done something involving ASP. And after restarting Studio, I could run the same pictures which gave me a problem the first time, with no problem. – David Legg Jan 03 '13 at 23:31
  • Does this answer your question? [Could not load file or assembly ... The parameter is incorrect](https://stackoverflow.com/questions/8269386/could-not-load-file-or-assembly-the-parameter-is-incorrect) – 273K Mar 01 '23 at 22:43

2 Answers2

3

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.

Source MSDN

E_INVALIDARG: One or more arguments are not valid (0x80070057)

H. Pauwelyn
  • 13,575
  • 26
  • 81
  • 144
jAC
  • 5,195
  • 6
  • 40
  • 55
  • 2
    This answer is a total copy of http://stackoverflow.com/questions/8269386/could-not-load-file-or-assembly-the-parameter-is-incorrect/8269493#8269493 – Yuck Jan 03 '13 at 22:53
0

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/

It scans your app for dependencies and highlight the ones that were not found. In my case was a C++ assembly that was missing.

Roberto Luis Bisbé
  • 2,080
  • 1
  • 15
  • 22