'System.InvalidOperationException'

J

JoeM

An unhandled exception of type 'System.InvalidOperationException' occurred

I am getting this error when running the built executable directly from the
bin folder -- however, it doesn't give me the error when I run from within
the IDE
(DEBUG or RELEASE).

It does seem to run fine on another computer.

System.InvalidOperationException was unhandled Message="An error occurred
creating the form. See Exception.InnerException for details. The error is:
The type initializer for 'Falcon.PrintConsole.modGlobal' threw an
exception."
Source="Falcon.PrintConsole"
StackTrace:
at Falcon.PrintConsole.My.MyProject.MyForms.Create__Instance__[T](T
Instance)
at Falcon.PrintConsole.frmMain.Main()


Help?
 
B

Brian Gideon

JoeM,

Compile a debug build and try running it from the bin folder again.
When you get the error there should be an option to debug the
application. The Visual Studio IDE should open and break where the
error occurred. You should be able to examine the values of the
different variables at this point. Also, do you know what the
InnerException is?

Brian
 
J

JoeM

I think this is the innerexception. I can't seem to get any deeper. I've
turned off the option for Just My Code in the debugger - but the deepest I
can seem to get is having the debugger stop at Public Class frmMain (frmMain
is highlighted), with a dialog box showing "InvalidOperationException was
unhandled" in the title bar - and "..type initializer for
'Falcon.PrintConsole.modGlobal threw an exception.' in the msg portion.

I do love the new troubleshooting tips however!

Clicking View Detail I get the following:

{"An error occurred creating the form. See Exception.InnerException for
details. The error is: The type initializer for
'Falcon.PrintConsole.modGlobal' threw an exception."}


I've run this on two different machines, and it works fine on them. What is
it about my box that is setting this off??

Thanks!




Brian Gideon said:
JoeM,

Compile a debug build and try running it from the bin folder again.
When you get the error there should be an option to debug the
application. The Visual Studio IDE should open and break where the
error occurred. You should be able to examine the values of the
different variables at this point. Also, do you know what the
InnerException is?

Brian
An unhandled exception of type 'System.InvalidOperationException'
occurred

I am getting this error when running the built executable directly from
the
bin folder -- however, it doesn't give me the error when I run from
within
the IDE
(DEBUG or RELEASE).

It does seem to run fine on another computer.

System.InvalidOperationException was unhandled Message="An error occurred
creating the form. See Exception.InnerException for details. The error
is:
The type initializer for 'Falcon.PrintConsole.modGlobal' threw an
exception."
Source="Falcon.PrintConsole"
StackTrace:
at
Falcon.PrintConsole.My.MyProject.MyForms.Create__Instance__[T](T
Instance)
at Falcon.PrintConsole.frmMain.Main()


Help?
 
J

JoeM

Thanks Brian - for encouraging me to dig deeper into the exceptions - I love
the way VS2005 helps on this and provides a LOT of details that I never
expected to be there. I was able to find a line number in the stack - went
to the line in code and found the problem:
Private DETAIL2 As String = readValue("Detail2")

There was no Try block and the file readValue was looking for didnt' exists.
I was running directly from the DEBUG folder - so the file wasn't there.

Thanks a ton for the help!

JoeM said:
I think this is the innerexception. I can't seem to get any deeper. I've
turned off the option for Just My Code in the debugger - but the deepest I
can seem to get is having the debugger stop at Public Class frmMain
(frmMain is highlighted), with a dialog box showing
"InvalidOperationException was unhandled" in the title bar - and "..type
initializer for 'Falcon.PrintConsole.modGlobal threw an exception.' in the
msg portion.

I do love the new troubleshooting tips however!

Clicking View Detail I get the following:

{"An error occurred creating the form. See Exception.InnerException for
details. The error is: The type initializer for
'Falcon.PrintConsole.modGlobal' threw an exception."}


I've run this on two different machines, and it works fine on them. What
is it about my box that is setting this off??

Thanks!




Brian Gideon said:
JoeM,

Compile a debug build and try running it from the bin folder again.
When you get the error there should be an option to debug the
application. The Visual Studio IDE should open and break where the
error occurred. You should be able to examine the values of the
different variables at this point. Also, do you know what the
InnerException is?

Brian
An unhandled exception of type 'System.InvalidOperationException'
occurred

I am getting this error when running the built executable directly from
the
bin folder -- however, it doesn't give me the error when I run from
within
the IDE
(DEBUG or RELEASE).

It does seem to run fine on another computer.

System.InvalidOperationException was unhandled Message="An error
occurred
creating the form. See Exception.InnerException for details. The error
is:
The type initializer for 'Falcon.PrintConsole.modGlobal' threw an
exception."
Source="Falcon.PrintConsole"
StackTrace:
at
Falcon.PrintConsole.My.MyProject.MyForms.Create__Instance__[T](T
Instance)
at Falcon.PrintConsole.frmMain.Main()


Help?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top