1

How do I go about resolving this issue? What other information can I look at?

An unhandled exception of type 'System.TypeInitializationException' occurred in Microsoft.VisualStudio.HostingProcess.Utilities.dll

Additional information: The type initializer for 'SpaceShip.Program' threw an exception.

2
  • 3
    You should look at the full stack trace to see where in your code the exception is coming from. Commented Nov 5, 2010 at 21:19
  • This is a runtime error, not a compiler error... Commented Nov 6, 2010 at 1:13

3 Answers 3

7

From the documentation....

When a class initializer fails to initialize a type, a TypeInitializationException is created and passed a reference to the exception thrown by the type's class initializer. The InnerException property of the TypeInitializationException holds the underlying exception.

So look at the inner exception to find out where the real problem is.

http://msdn.microsoft.com/en-us/library/ms242144%28VS.80%29.aspx

And I assume you know this, but JUST in case.. How to check the Inner Exception: http://msdn.microsoft.com/en-us/library/hdwz4c0s%28VS.80%29.aspx

Sign up to request clarification or add additional context in comments.

Comments

1

Look for errors that might occur in either SpaceShip.Program's static constructor, or in static variables that are initialized outside of any methods (e.g., private static Foo foo = new Foo();).

Comments

0

Exactly what the error says: The Type Initialiser (aka the Constructor) threw an error. Check the constructor of SpaceShip.Program. Perhaps run it through the debugger.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.