user1379417
user1379417

Reputation:

The connection string in the application's configuration file does not contain the required providerName attribute

I have a WorkerRole in Azure that's connecting to an MSSQL database (also in Azure, on its own virtual machine -- in other words not an Azure SQL database). The WorkerRole is using EntityFramework (code first).

My connection string looks like this and connections from the worker role works just fine in my development environment:

<add name="MyConnectionString" connectionString="Data Source=mydatabaseserver.cloudapp.net;Initial Catalog=MyDatabase;User ID=MyUser;Password=ThePassword;" providerName="System.Data.SqlClient" />

However, the application throws the error:

The connection string MyConnectionString in the application's configuration file does not contain the required providerName attribute

As you can see, it clearly does contain the providerName attribute. I have checked the obj/Release folder to see the actual configuration file that is published to Azure, and it does contain the attribute as well.

What am I doing wrong?

Upvotes: 5

Views: 6039

Answers (1)

user1379417
user1379417

Reputation:

Never mind. It is in fact working now.

The reason I thought it wasn't working is that there is a delay in how Azure writes Trace data to TableStorage. This led me to believe that the WorkerRole was still throwing the error after updating the connection string, even though it wasn't.

Upvotes: 4

Related Questions