Teradata .Net app deploy on azure type initializer error

Connectivity
Fan

Teradata .Net app deploy on azure type initializer error

Hi,

 

We've built an app in .Net framwork that connects to a TeraData database.

We want to deploy this to Azure as a webjob (webapp) but get the following error there but not locally: 

 

Unhandled Exception: System.TypeInitializationException: The type initializer for 'Teradata.Client.Provider.RuntimeStatisticsFactory' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Teradata.Client.Provider.UtlPerformanceCounters' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object.

 

[08/09/2018 08:14:49 > 403103: ERR ] Unhandled Exception: System.TypeInitializationException: The type initializer for 'Teradata.Client.Provider.RuntimeStatisticsFactory' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Teradata.Client.Provider.UtlPerformanceCounters' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object.
[08/09/2018 08:14:49 > 403103: ERR ] at Teradata.Client.Provider.UtlPerformanceCounters..ctor()
[08/09/2018 08:14:49 > 403103: ERR ] at Teradata.Client.Provider.UtlPerformanceCounters..cctor()
[08/09/2018 08:14:49 > 403103: ERR ] --- End of inner exception stack trace ---
[08/09/2018 08:14:49 > 403103: ERR ] at Teradata.Client.Provider.RuntimeStatisticsFactory..cctor()
[08/09/2018 08:14:49 > 403103: ERR ] --- End of inner exception stack trace ---
[08/09/2018 08:14:49 > 403103: ERR ] at Teradata.Client.Provider.ConnectionFactory.ValidateParams(Object owningObject, UtlConnectionString connStr)
[08/09/2018 08:14:49 > 403103: ERR ] at Teradata.Client.Provider.ConnectionFactory.GetConnection(Object owningObject, UtlConnectionString connStr)
[08/09/2018 08:14:49 > 403103: ERR ] at Teradata.Client.Provider.TdConnection.Open()

 

Has anyone seen this error before? 

 

Thanks. 

Tags (2)
5 REPLIES
Teradata Employee

Re: Teradata .Net app deploy on azure type initializer error

Please open an incident with Teradata customer service. We will release a fix for this issue. 

 

There are three workarounds:

1- Use the .NET Data Provider version 16.20.1; you are using 16.20.2.

 

2- Install the .NET Data Provider 16.20.2 on the server. Installation will register the Performance Counters and the Data Provider will not throw the exception

 

3- Manually register the Performance Counters. Use InstallUtil.exe (usually in C:\Windows\Microsoft.NET\Framework\v4.0.30319 directory) with Teradata.Client.Provider.Install.dll assembly (in c:\Program Files (x86)\Teradata\NET Data Provider for Teradata\16.20\PrivateAssemblies).

 

To display help: InstallUtil /help Teradata.Client.Provider.Install.dll

To register the Data Provider: InstallUtil /InstallStateDir=C:\junk /VSIntegration=No /MachineConfig=No Teradata.Client.Provider.Install.dll   

 

Note that you must run InstallUtil as administrator.

Fan

Re: Teradata .Net app deploy on azure type initializer error

Hi

Thanks for the answer!

But since we're running this an app service in Azure we're not allowed to these changes that you suggest. 

So when do you think you will release a fix for this issue?

Teradata Employee

Re: Teradata .Net app deploy on azure type initializer error

Most likely by the end of the week.

Fan

Re: Teradata .Net app deploy on azure type initializer error

Thanks a lot for that answer!
Can you please update here when you’ve released the updates Nuget package?
Once again thanks!
Teradata Employee

Re: Teradata .Net app deploy on azure type initializer error

.NET Data Provider for Teradata v 16.20.3 is available now from nuget.org.