System.InvalidOperationException on program startup.

kinar
08-22-2007, 02:22 PM
I've got an app that was originally written in vb6 and partially converted to .NET (compiled with VS2k5). The only thing it still uses from VB6 is the winsock control (in an array).

Everything works fine on my development machine and every machine I have tried testing it on works as well. However, one of the people who use this app is getting the follwoing error when launching the app on 2 of his machines (error message taken from the event log).

EventType clr20r3, P1 appname.exe, P2 1.2.0.0, P3 46a6476c, P4 appname. P5 1.2.0.0, P6 46a6476c, P7 e, P8 ca, P9 system.invalidoperationexception, P10 NIL.

Everything I can find on Google (which isnt much) about this error indicates it is due to a missing file on the machine but I added code to the project to output all the modules loaded and they all exist.

I tried searching these forums for the error but either I'm too stupid to use the search feature or it just plain sucks. The results that were returned had nothing to do with this error or even errors in general. (and a search for InvalidOperationException didn't return anything)

Does anyone have any ideas as to how to go about further troubleshooting this error?

While Typing up this post, I finally realized that the P# in the event log, are separate information about the crash.

For example,

P1 = executablename.exe
P2 = executableversion
P3 = memory address of crash?
P4 = appname
P5 = appversion
P6 = same as P3?
P7 = not sure...perhaps the variable name? the default .net event handlers frequenly use an e as System.EventArgs so that could be what this is.
P8 = no idea, not sure what ca could refer to in my app
P9 = unhandled exception type
P10 = No idea here either.

Anyone know where I can find out for sure what these P# codes mean?

reboot
08-22-2007, 02:24 PM
Do these machines have the framework installed on them?

kinar
08-22-2007, 03:28 PM
Yes. That was the first thing I had them check since prior to this case, the only time I'd ever seen that error outside the debugger was when the correct version fo the framework wasn't installed.

BTW, just noticed the double post. Not sure how that happened, please remove the other one.

Thanks

PrOpHeT
08-22-2007, 06:28 PM
Is the winsock control installed and properly registered?

Remember it does not come with the CLR, it is a legacy VB6 component.

It could be crashing while trying to reference a non existent component.

kinar
08-29-2007, 11:19 AM
Thanks Prophet. I'm fairly certain that the winsock control was properly registered since this was one of the first things I thought of as well...

However, after having them run a batch file that registers all of the the registerable modules that the application uses, everything works so your suggestion certainly lead to the solution.

Thanks again everyone.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum