type initializer for 'XXX.CustomerDataContext' threw an exce
Posted: Fri 04 Feb 2011 20:23
I am very intermittently getting the error "The type initializer for 'XXX.CustomerDataContext' threw an exception."
When I look at the logs in the event viewer I find the below two logs:
2011-02-04 10:53:53.510 /LM/W3SVC/1/ROOT/XXX/2.13-1-129413156227617160 9160:2 XXX.Adapter
AddCustomer
EXCEPTION (LEVEL 1): System.TypeInitializationException
EXCEPTION OUTPUT: The type initializer for 'XXX.CustomerDataContext' threw an exception.
STACK TRACE:
at XXX.CustomerRepository.get_Context() in d:\DS\Builds\XXX\CustomerRepository.cs:line 41
at XXX.CustomerRepository.get_CurrentDate() in d:\DS\Builds\XXX\CustomerRepository.cs:line 55
at XXX.AddCustomer(Customer customer) in d:\DS\Builds\XXX\CustomerRepository.cs:line 88
at XXX.AddCustomer(AddCustomerRequest request) in d:\DS\Builds\XXX\CustomerManagementAdapter.cs:line 105
at ICustomerManagementAdapterProxy86dbb599e20340d4879bc6a16ef74bde.InvocationAddCustomer_1.InvokeMethodOnTarget()
at XXX.AdapterActivityDetailLoggingInterceptor.Intercept(IInvocation invocation) in d:\DS\Builds\XXX\AdapterActivityDetailLoggingInterceptor.cs:line 32
-----------------------------------
EXCEPTION (LEVEL 2): System.NullReferenceException
EXCEPTION OUTPUT: Object reference not set to an instance of an object.
STACK TRACE:
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Devart.Data.Linq.CompiledQueryCache.RegisterDataContext(Type dataContextType)
at XXX.CustomerDataContext..cctor() in d:\DS\Builds\XXX\CustomerModel.Designer.cs:line 30
-----------------------------------
Location: 352BF105-6FE7-4CFC-9153-0DB890328FAD
Assembly Name: XXX
Assembly Version: 2.13.1.0
Assembly File Version: 2.1301.0000.166
Source File: d:\DS\Builds\XXX\AdapterActivityDetailLoggingInterceptor.cs:32
Current Activity: c6445667-8435-4b8c-9581-37a9c15c01bb
Parent Activity: 430e24a3-d8d9-4b81-bab4-9576ddaacc35
Root Activity: 70b9cc51-4b1e-41a6-91cf-2db608ed8652
--- Tenant Data ---
Client: XXX
Environment: XXX
Database: XXX
-------------------------------------------------------------------------------------
Error Log 2:
2011-02-04 10:53:53.510 /LM/W3SVC/1/ROOT/XXX/2.13-1-129413156227617160 9160:2 XXX
AddCustomer
EXCEPTION (LEVEL 1): System.TypeInitializationException
EXCEPTION OUTPUT: The type initializer for 'XXX.CustomerDataContext' threw an exception.
STACK TRACE:
-----------------------------------
EXCEPTION (LEVEL 2): System.NullReferenceException
EXCEPTION OUTPUT: Object reference not set to an instance of an object.
STACK TRACE:
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Devart.Data.Linq.CompiledQueryCache.RegisterDataContext(Type dataContextType)
at XXX.CustomerDataContext..cctor() in d:\DS\Builds\XXX\CustomerModel.Designer.cs:line 30
-----------------------------------
Location: 352BF105-6FE7-4CFC-9153-0DB890328FAD
Assembly Name: XXX
Assembly Version: 2.13.1.0
Assembly File Version: 2.1301.0000.166
Source File: d:\DS\Builds\XXX\AdapterActivityDetailLoggingInterceptor.cs:32
Current Activity: f6f308f9-ba39-435e-8a40-fdd00fb09977
Parent Activity: c489a4ff-e610-4671-b600-e3e4c0c6943b
Root Activity: 1a053057-f6c9-473b-8e2a-4903063e46c5
--- Tenant Data ---
Client: XXX
Environment: XXX
Database: XXX
----------------------------------------------------------------------------------
Is this an issue with the dot connect or might be any issue with my code?
Thanks,
Sandeep
When I look at the logs in the event viewer I find the below two logs:
2011-02-04 10:53:53.510 /LM/W3SVC/1/ROOT/XXX/2.13-1-129413156227617160 9160:2 XXX.Adapter
AddCustomer
EXCEPTION (LEVEL 1): System.TypeInitializationException
EXCEPTION OUTPUT: The type initializer for 'XXX.CustomerDataContext' threw an exception.
STACK TRACE:
at XXX.CustomerRepository.get_Context() in d:\DS\Builds\XXX\CustomerRepository.cs:line 41
at XXX.CustomerRepository.get_CurrentDate() in d:\DS\Builds\XXX\CustomerRepository.cs:line 55
at XXX.AddCustomer(Customer customer) in d:\DS\Builds\XXX\CustomerRepository.cs:line 88
at XXX.AddCustomer(AddCustomerRequest request) in d:\DS\Builds\XXX\CustomerManagementAdapter.cs:line 105
at ICustomerManagementAdapterProxy86dbb599e20340d4879bc6a16ef74bde.InvocationAddCustomer_1.InvokeMethodOnTarget()
at XXX.AdapterActivityDetailLoggingInterceptor.Intercept(IInvocation invocation) in d:\DS\Builds\XXX\AdapterActivityDetailLoggingInterceptor.cs:line 32
-----------------------------------
EXCEPTION (LEVEL 2): System.NullReferenceException
EXCEPTION OUTPUT: Object reference not set to an instance of an object.
STACK TRACE:
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Devart.Data.Linq.CompiledQueryCache.RegisterDataContext(Type dataContextType)
at XXX.CustomerDataContext..cctor() in d:\DS\Builds\XXX\CustomerModel.Designer.cs:line 30
-----------------------------------
Location: 352BF105-6FE7-4CFC-9153-0DB890328FAD
Assembly Name: XXX
Assembly Version: 2.13.1.0
Assembly File Version: 2.1301.0000.166
Source File: d:\DS\Builds\XXX\AdapterActivityDetailLoggingInterceptor.cs:32
Current Activity: c6445667-8435-4b8c-9581-37a9c15c01bb
Parent Activity: 430e24a3-d8d9-4b81-bab4-9576ddaacc35
Root Activity: 70b9cc51-4b1e-41a6-91cf-2db608ed8652
--- Tenant Data ---
Client: XXX
Environment: XXX
Database: XXX
-------------------------------------------------------------------------------------
Error Log 2:
2011-02-04 10:53:53.510 /LM/W3SVC/1/ROOT/XXX/2.13-1-129413156227617160 9160:2 XXX
AddCustomer
EXCEPTION (LEVEL 1): System.TypeInitializationException
EXCEPTION OUTPUT: The type initializer for 'XXX.CustomerDataContext' threw an exception.
STACK TRACE:
-----------------------------------
EXCEPTION (LEVEL 2): System.NullReferenceException
EXCEPTION OUTPUT: Object reference not set to an instance of an object.
STACK TRACE:
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Devart.Data.Linq.CompiledQueryCache.RegisterDataContext(Type dataContextType)
at XXX.CustomerDataContext..cctor() in d:\DS\Builds\XXX\CustomerModel.Designer.cs:line 30
-----------------------------------
Location: 352BF105-6FE7-4CFC-9153-0DB890328FAD
Assembly Name: XXX
Assembly Version: 2.13.1.0
Assembly File Version: 2.1301.0000.166
Source File: d:\DS\Builds\XXX\AdapterActivityDetailLoggingInterceptor.cs:32
Current Activity: f6f308f9-ba39-435e-8a40-fdd00fb09977
Parent Activity: c489a4ff-e610-4671-b600-e3e4c0c6943b
Root Activity: 1a053057-f6c9-473b-8e2a-4903063e46c5
--- Tenant Data ---
Client: XXX
Environment: XXX
Database: XXX
----------------------------------------------------------------------------------
Is this an issue with the dot connect or might be any issue with my code?
Thanks,
Sandeep