Click here to Skip to main content
15,306,369 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
When I try to run my 2010 project I get the error.

"System.InvalidOperationException occured in PCDoctor.exe

Additional Inormation: An error occured creating the form. See Exception.InnerException for details. The error is: Conversion from string "" to type Double is not valid.

I even tried placing break points in the startup form but this error happens before any of the startup form code is excecuted.

The project was working fine before I added code to a form. I even removed this new code and tried to run the project. but still doesn't work.

Please help!!!
Updated 13-May-21 3:11am
Sergey Alexandrovich Kryukov 13-Sep-11 19:27pm
Not enough information. What makes you using PCDoctor at all? Why are you so sure this is an exception in PCDoctor.exe? Did you debug this application? And how?
TRK3 13-Sep-11 19:38pm
Is PCDoctor.exe the name of your program -- or is that something else in your system? If it's something else in your system, turn it off, disable it, or uninstall it and try again.
obhasha07 13-Sep-11 20:07pm
In the error message there are two buttons. Continue and Break. When I press break. It opens a tab in VS saying no source available. In that tab there is Call Stack location: mscoreei.dll!6f0455ab()
obhasha07 13-Sep-11 19:39pm
Yeah. PC doctor is the project. When I try to run it using Visual Studio I get this error. The proejct builds fine. So this error is a runtime error. But I can't determine where it's coming from.
Sergey Alexandrovich Kryukov 13-Sep-11 20:00pm
You should understand that without seeing your code it's too hard to fix it :-). The error comes from System.Double.Parse or equivalent Convert method. Do you use one of those? It can implicitly come from, say, serialization, but... it probably happens when you have no data, right? Maybe some data file is assumed?
obhasha07 13-Sep-11 20:18pm
Well, this error comes even before I can display the startup form. In the startup form there are no code that has anything to do with double. Well, it doesn't even have a single double variable or conversion. I cleared the whole bin directory and rebuilt the project but still gives the same error. You know, all of this was working fine and this error start poppin up out of nowhere. And I forgot to say. This error is actually an unhandled exception.
TRK3 13-Sep-11 20:17pm
SAKryukov's suggestion that the error could be coming implicitly from serialization might actually be the case.

Does your project use some framework that saves window positions or form data when the application is closed and then restore them on startup?

If so, and you changed something in the form or window layout, the de-serialization might be crashing because what's being de-serialized doesn't match the new code. Look for data being saved to the registry or a configuration file somewhere and delete that configuration file or those registry entries and try again.
obhasha07 13-Sep-11 20:39pm
Well, I've deleted some registry entries but it still has the same error. Also, there's no configuration file. What about that Call Stack location: mscoreei.dll!6f0455ab() when I press the break button?
TRK3 13-Sep-11 20:45pm
The location is somewhere in a Microsoft core library. It doesn't really help you unless you can get a stack trace that shows you something related to your code.

Sometimes you can continue from an exception by hitting continue or single step. Usually you'll be prompted to "pass exception to program / don't pass exception to program" -- try single stepping or stepping out of the function and not passing the exception. Most of the time you just end up with more errors, but sometimes the program continues from there without error and you can step your way out to a point where the stack trace makes sense or you get some clue about what call caused the problem.
obhasha07 13-Sep-11 21:12pm
I fixed it!!!! Damn, you know, I didn't create this project from scratch. The previous developer has done some weird thing where he has created new instances of all the forms in the startup form. And I just added a calculation which involves a double variable in a text box text changed event in another form. So, when this form is initialized it fires up the text changed event which then gives the error. HAHAHAHAHA. Oh man, life is strange. Thanks for all the advise guys!!!
Prerak Patel 14-Sep-11 1:32am
Added [Solved] in subject line as OP has solved it on his own.

1 solution

This problem occurs because multiple threads in the application call the Hashtable.Insert method at the same time.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900