HighTechTalks DotNet Forums  

TypeInitializeException

Dotnet VJSharp microsoft.public.dotnet.vjsharp


Discuss TypeInitializeException in the Dotnet VJSharp forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Roger Garrett
 
Posts: n/a

Default 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

Reply With Quote
  #2  
Old   
Roger Garrett
 
Posts: n/a

Default Re: TypeInitializeException - 04-17-2005 , 08:46 PM






I did as you suggested and installed the .NET and J# redistributables on my
other computer, and restarted the computer, but I still getthe exact same
errors when I attempt to run the J# program.

Suggestions?

- Roger

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.