TypeInitializeException -
04-15-2005
, 12:09 PM
I've written a J# program that runs just fine on my computer (where my Visual
Studio .NET IDE resides).
I try to run the program on another computer (it has Windows 2000) and I get
a dialog that says it has encountered an unhandled exception. Clicking
Cancel on that dialog causes a DOS window to pop up that reports:
Unable to determine existence of prolog, if any.
Unhandled exception generated: <System.TypeInitializationException>
(in the FormaMain part of my program)
_message="The type initializer for "_MyProgram.FormMain" threw an exception
_innerException= <System.io.FileNotFoundException>
Thread 0x364 R --- Class initialization ---
I figured I needed to at least catch that TypeInitializationException so I
put a try/catch around main part, as follows:
public static void main(String[] args)
{
try
{
Application.Run(new FormMain());
}
catch (System.TypeInitializationException typeInititializationException)
{
MessageBox.Show("Caught the initialization exception");
}
}
but that had no effect, it still caused the above problem, reporting the
same exception.
Any suggestions?
- Roger |