-1

Our web application mysteriously started intermittently throwing this error a couple days ago:

System.TypeInitializationException: The type initializer for 'XXXXXXXXXXXXXX' threw an exception. ---> System.Runtime.InteropServices.COMException: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
at SBStringList.TElStringList..ctor()

We've spoken with the creators of the SBStringList.TElStringList class and it doesn't use COM. I've inspected it in a decompiler and confirmed their assertion.

How can I figure out what COM class the system is trying to create?

Once we start getting this error in our web application, we start to get it almost everywhere. If we clear the temporary ASP.NET files the error goes away until it mysteriously goes away again.

Aaron Jensen
  • 25,861
  • 15
  • 82
  • 91
  • Obfuscating the stack trace doesn't help us help you. But you are surely looking in the wrong corner for this problem, it is the exception handler that fails. You lose the original exception that was raised in the TEIStringList constructor. And sure, high odds that the exception handler keeps failing over and over again on the same problem. – Hans Passant Aug 29 '15 at 09:25
  • @HansPassant The stack trace I took out was two or three calls deep, all in our company's code. There are no COM components being referenced/used in the stack trace. – Aaron Jensen Sep 10 '15 at 17:45

1 Answers1

0

Perhaps you have a bit more detailed stack trace and/or related messages from the Windows Application/System log and/or related messages from IIS log..

There are quite many possible causes of this type of exception:

[1] wrong platform setting at build time x86 or x64 instead of Any CPU

[2] COM class not registered (regsvr may be helpful here, but it seems SecureBlackbox® is not registering any COM objects..)

[3] if there is indeed COM involved it could also be access denied for the registry settings

Just in case you haven't see it already here are some good tips to troubleshoot this nasty one https://stackoverflow.com/a/17000027/920557. I would also try an idea with SysInternals' ProcMon.. and may the force be with you.

Community
  • 1
  • 1
Eugene Komisarenko
  • 1,533
  • 11
  • 25
  • I took out the stack trace from our internal code. There are no messages in the event log. I've already checked for platform mismatches. I want to know how I can find out what COM class can't be found. – Aaron Jensen Aug 28 '15 at 23:05
  • To figure out the exact COM class you would need full stacktrace from the exception and stacktrace around CoCreateInstance. Check out this answer too http://stackoverflow.com/a/18758873/920557 it may be worth trying. SecureBlackbox may also be hidding the details of the exception from you in their code. – Eugene Komisarenko Aug 30 '15 at 14:09
  • There is no COM object in the stack trace. It is pure .NET all the way up. – Aaron Jensen Sep 10 '15 at 17:44