Skip to content

Fixing the "TypeInitializationException was unhandled" exception

Robert Greiner
Robert Greiner
1 min read

I ran into this issue today so I thought I'd share.

According to the docs:

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 TypeInitializationException holds the underlying exception. TypeInitializationException uses the HRESULT COR_E_TYPEINITIALIZATION, that has the value 0x80131534. For a list of initial property values for an instance of TypeInitializationException, see the TypeInitializationException constructors.

This error occured in my project because I had elements in my App.config file that were not recognized. This is most commonly caused by using an invalid setting in the config file.

Once I removed the invalid elements, everything worked fine again.

If you are having this problem, double-check your App.config file and make sure you haven't included anything wrong.

Happy debugging, I hope this solves your problem.

Please consider subscribing, it's free.
Technology

Robert Greiner Twitter

Professional optimist. I write a weekly newsletter for humans at the intersection of business, technology, leadership, and career growth.


Related Posts

Members Public

AI Rule #1 - Customer First

In 1985, Warren Buffett wisely said, "The first rule of investment is don't lose. And the second rule of investment is don't forget the first rule, and that's all the rules there are." Similarly, the first rule of AI investment is to

AI Rule #1 - Customer First
Members Public

Navigating the Upside Down as a Technology Leader

Ideas for leading technology organizations with confidence and creativity.

Navigating the Upside Down as a Technology Leader
Members Public

Artist for a Day

The future of creative output is multiplied by AI.

Artist for a Day