Click here to Skip to main content
15,886,763 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I made a web application which is going fine on local host of my system but when i uploaded it on vps n tried to run it its throwing an exception that is "the type initializer exception ". the exception has trowed because of class name which i have taken statin in app_code folder.
Please somebody help me for resolve that problem.
Posted

Add try..Catch block to constructor of target class i.e. the class from app_code foler. Log the exception to some .txt file and see what is actual root cause.

one possibility is if the constructor has some code statement(s) throwing exception you will get this exception. check for any dependency on VPS system for example Config settings or third party resources etc.

For details you can post code of the your class. specially the constructor.
 
Share this answer
 
Thanks Hemant, I already put try catch block with constructor but but control is not entering in constructor body and throwing the exception.
 
Share this answer
 
Comments
Hemant__Sharma 30-Nov-11 3:46am    
Can you post full exception you are getting?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900