Error : Keyword not supported: 'metadata'

I was trying to use Hangfire.IO in my MVC ASP.NET boilerplate application and pasted this code in Startup.cs as explained here in tutorial

               .UseSqlServerStorage("bwavenueEntities"); //getting error here


But I am getting an error in above code

Server Error in '/' Application.

Keyword not supported: 'metadata'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentException: Keyword not supported: 'metadata'.

Source Error: 

Line 75: 
Line 76:             app.MapSignalR();
Line 77:             GlobalConfiguration.Configuration
Line 78:                .UseSqlServerStorage("bwavenueEntities");
Line 79: 

Source File: E:\bwavenue\src\bwavenue.Web\App_Start\Startup.cs    Line: 77 

Can you explain how to resolve it? and why it is throwing this error here is my connection string

    <add name="bwavenueEntities" connectionString="metadata=res://*/Model.DbModel.csdl|res://*/Model.DbModel.ssdl|res://*/Model.DbModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=Test-PC;initial catalog=bwavenue;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />


Asked by:- manish
: 12578 At:- 8/18/2017 12:24:24 PM
C# ASP.NET Keyword-not-supported

3 Answers
profileImage Answered by:- vikas_jk

The error, Keyword not supported: 'metadata' is because you are not passing correct connection string, you are passing Entity framework Connection string that contains a SQL Server connection string in its provider connection string parameter. WebSecurity.InitializeDatabaseConnection expects a valid database connection string.

If you will pass connection string like this

<add name="bwavenueEntities" connectionString="data source=*****;initial catalog=*****;User ID=****;password=*****;MultipleActiveResultsets=True" providerName="System.Data.EntityClient" />

It should work after the changes

At:- 8/19/2017 6:02:23 AM
Thanks, I see there was issue with connection string as you have explained above 0
By : manish - at :- 8/21/2017 7:53:12 AM

profileImage Answered by:- jaiprakash

Another possible answer, If you're developing/maintaining an Azure WebApp, using a connection string saved in Azure's Application Settings.

Other than 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.

Or In some cases, it just works by changing provider name in connection string  from 




as it is an EF connection string.

At:- 9/15/2017 3:54:32 PM

profileImage Answered by:- bhanu

If you are using Entity framework type connection string, then you need to skip "metadata"

if (connectionString.ToLower().StartsWith("metadata=")) 
    System.Data.Entity.Core.EntityClient.EntityConnectionStringBuilder efBuilder = new System.Data.Entity.Core.EntityClient.EntityConnectionStringBuilder(connectionString);

    connectionString = efBuilder.ProviderConnectionString; 

Hope it helps.

At:- 5/20/2021 2:34:19 PM

Login/Register to answer
Register directly by posting answer/details

Full Name *

Email *

By posting your answer you agree on privacy policy & terms of use