473,407 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

How to fix Type initializer exception during runtime

I'm having this System.TypeInitializerException problem but only during runtime in a separate environment than its own build environment.

Win7x64 is the build environment. I'm testing the project on various WinXPx86 computers using a Setup Deployment and am noticing the error.

The portion of the code that comes to question is:

Expand|Select|Wrap|Line Numbers
  1. public static SettingsSingleton Instance { get { return Nested.instance; } }
  2.  
  3. ...
  4.  
  5. class Nested
  6. {
  7.  Nested() { }
  8.  static readonly SettingsSingleton instance = new SettingsSingleton();
  9.  }
  10.  
I've tried and tested this suggested solution:

http://blog.wouldbetheologian.com/2009/03/type-initializer-for-someclass-threw.html

Still no luck.

I have since installed MVS2008 (same as dev environment) on the XP machine and ran debugger. The error does not come up. I've built the Setup/Deployment and sent it to Win7, WinVista machines and they work fine. Any suggestions are greatly appreciated.
Nov 2 '10 #1
1 2500
It turns out that it's just not WinXP; but all machines that did not have this software suite previously installed.
Nov 2 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Jonathan G. | last post by:
I'm writing my first windows service. I have a class called 'mainprocess' whose constructor is called by the service class. Within mainprocess, I declare an instance of another class I wrote,...
3
by: Newbie | last post by:
hi! i am able to upload files successfully. but i have one minor problem. files are uploaded correctly if the directory exists, it is throwing an exception if the directory doesnt exist. but the...
0
by: Viraptor | last post by:
Hello I've got a problem with .net2 There's a form with dataGridView. I want to add some items to ....ComboBoxCell in ...DefaultValuesNeeded event. When I add them with...
1
by: ibiza | last post by:
Hi all, I have this class: Public Class KanaConverter Private Shared kana As ArrayList Private Shared romanji As ArrayList Shared Sub New() kana = New ArrayList
0
by: Rod | last post by:
I've got Crystal Reports XI Release 2, for development with Visual Studio ..NET 2005. I've taken a VS .NET 2003 WinForms application that I wrote in C#, and upgraded it to VS .NET 2005. It has...
0
by: =?Utf-8?B?YmlqYXk=?= | last post by:
The type initializer for 'Microsoft.ApplicationBlocks.Cache.CacheService' threw an exception. We migrated our windows application from 1.1 to 2.0. The debug and Release mode of the application...
4
by: =?Utf-8?B?YmlqYXk=?= | last post by:
We migrated our windows application from 1.1 to 2.0. The debug and Release mode of the application work fine with some tweaking. But when the setup project is migrated to 2.0 the installation gives...
0
by: Schadrach | last post by:
I'm having a strange problem, I have a small executable that runs a backup for a some data nightly, and as of September 22, 2007 it has ceased to function with the following error: Unhandled...
2
by: tshad | last post by:
I got the following error message when I had set a static string value to "" or " "; "The type initializer for "theSettings" threw an exception." "The path is not of a legal form." The...
1
by: =?Utf-8?B?UGhpbGlwIFdhZ2VuYWFy?= | last post by:
I have an ASP.NET application that is showing throwing an strange exception in my Virtual PC environment. We have encoutered this error at a customer running our product on Virtual Server. At the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.