Share via

The type initializer for 'Microsoft.Data.SqlClient.SqlAuthenticationProviderManager' threw an exception.

Anonymous
2022-03-17T08:47:43+00:00

We have System.Configuration.ConfigurationManager 5.0.0 nuget package and Microsoft.Data.SqlClient 4.1.0 nuget package configured in an azure function to establish the connection with database. For that we are trying to run  await sqlConnection.OpenAsync(); however we are getting an error

"The type initializer for 'Microsoft.Data.SqlClient.SqlAuthenticationProviderManager' threw an exception. Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified."

We have .net core 3.1 with azure function and mssql as database.

Microsoft 365 and Office | Subscription, account, billing | For business | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Anonymous
    2022-04-17T10:44:50+00:00

    I had same error. I tried change Microsoft.NET.Sdk.Functions version to 4.0.1. Now I have this error: System.Private.CoreLib: Exception while executing function: <Function> Core Microsoft SqlClient Data Provider: Login failed for user <usr>.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2022-03-17T09:27:45+00:00

    Hi Rakesh Surve,

    Thank you for posting into the forum community. We will highly appreciated your kind cooperation and patience in our forum community.

    Regarding your mentioned description concern, we have dedicated expert Microsoft Q&A forum community. for Azure or SQL database related concern or issue query. So, I'd recommend you please kindly contact and raise your motioned concern into this mentioned forum community. Our related expert forum community member will further assist you and provide you information there accordingly.

    Stay safe and healthy.

    Regards,

    Darpan

    Was this answer helpful?

    0 comments No comments