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?

Re: 'System.InvalidOperationException' by Brian

Brian
Wed Aug 23 19:34:09 CDT 2006

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

JoeM wrote:
> 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?


Re: 'System.InvalidOperationException' by JoeM

JoeM
Thu Aug 24 10:48:37 CDT 2006

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" <briangideon@yahoo.com> wrote in message
news:1156379649.088360.123470@74g2000cwt.googlegroups.com...
> 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
>
> JoeM wrote:
>> 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?
>



Re: 'System.InvalidOperationException' by JoeM

JoeM
Thu Aug 24 11:21:32 CDT 2006

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" <jom@nohostanywhere.com> wrote in message
news:Oet6FT5xGHA.3632@TK2MSFTNGP03.phx.gbl...
>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" <briangideon@yahoo.com> wrote in message
> news:1156379649.088360.123470@74g2000cwt.googlegroups.com...
>> 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
>>
>> JoeM wrote:
>>> 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?
>>
>
>



Re: 'System.InvalidOperationException' by Brian

Brian
Thu Aug 24 13:02:14 CDT 2006


JoeM wrote:
> Thanks a ton for the help!
>

No problem. I'm glad you figured it out.