Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Visual J# / May 2005

Tip: Looking for answers? Try searching our database.

TypeInitializeException

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Roger Garrett - 15 Apr 2005 17:09 GMT
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
Lars-Inge T?nnessen [VJ# MVP] - 17 Apr 2005 00:37 GMT
Does you Windows 2000 have the .NET and the J# redists installed?

.NET redist:
Please do a Windows Update on your Win2000 computer, or go to:
http://msdn.microsoft.com/netframework/downloads/updates/default.aspx

Or as a download for IT pros:
http://www.microsoft.com/downloads/details.aspx?FamilyId=262D25E3-F589-4842-8157
-034D1E7CF3A3&displaylang=en


J# redist::
http://www.microsoft.com/downloads/details.aspx?FamilyId=E3CF70A9-84CA-4FEA-9E7D
-7D674D2C7CA1&displaylang=en


Regards,
Lars-Inge T?nnessen
Roger Garrett - 18 Apr 2005 01:46 GMT
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
Lars-Inge Tønnessen [VJ# MVP] - 19 May 2005 21:52 GMT
Maybe you should open a support incident?

http://support.microsoft.com/oas/default.aspx?&c1=501&gprid=7611&

Regards,
Lars-Inge Tønnessen

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.