System.TypeInitializationException may occur in ElliottService if you log onto the server using the same user account configured to run Elliott Service.
You configured a user account to run the Elliott Service in IIS. You log onto the machine hosting Elliott Service using the same user account. While Elliott Service is running, you log off the server. After you log off, you start getting exceptions like the one shown below. You will continue to encounter exceptions in subsequent calls until you restart IIS.
System.TypeInitializationException: The type initializer for '[NAME]' threw an exception. ---> System.Runtime.InteropServices.COMException: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
The user log off likely interferes with the normal operation of Elliott Service
Configure a dedicated login to run Elliott Service. Do not use the same login to log on the machine hosting Elliott Service.
The following steps were used to reproduce this problem in a test environment running Windows 2008 R2 server and IIS 7.
- Set up Elliott Service in IIS.
- Configure Elliott Service to run as a predefined user account. (e.g., DomainName\ElliottServiceUser)
- Log onto the machine using the same user account. (e.g., DomainName\ElliotServiceUser)
- Ensure Elliott Service is in a clean state by running the next two commands:
iisreset -stop then
iisreset - start
- Ensure the transaction component is running. This can be done by making a call to any ElxxxxxxService methods. For example, make a call to ElicustmService ViewCustomer.
- Start sending traffic to the Elliott Service. If you have a test website or application that calls the web service, you can use it to send traffic. In our test environment, we have a test program that calls various web services.
- Log off the server
- ElliottService will start having System.TypeInitializationException.
updated on 2018-04-04