Keyword Not Supported: Metadata Keyword Not Supported: Metadata sql-server sql-server

Keyword Not Supported: Metadata


The string you passed is not a valid database connection string, it's an EF connection string that contains a SQL Server connection string in its provider connection string parameter. WebSecurity.InitializeDatabaseConnection expects a valid database connection string

To avoid parsing the connection string yourself, you can use the EntityConnectionStringBuilder class to parse the string and retrieve the database connection string from its ProviderConnectionString property


When this happened to me it was because the connection string had:

providerName="System.Data.SqlClient"

but it should be:

providerName="System.Data.EntityClient"

because as was said by the other answer, it is an EF connection string.


Just to add another possibility (which I encountered) - which might be the case if you're developing/maintaining an Azure WebApp, using a connection string saved in Azure's Application Settings.

Beside each connection string in the Application Settings is a dropdown for the connection string type - it's very easy to forget to set this to 'Custom' for Entity Framework values and leave it at the default (SQL Database) - which also causes the above error.