Windows Azure Entity Framework Keyword not supported: "metadata".

This was asked several times, but I could not make any suggestions for me.

I have a website and SQL database that I created locally and now deployed to Azure. A database is a related resource to a website. I can browse the website, and I can even connect and run database queries using ADO.Net and the standard connection string.

The problem is that when I try to connect using the Entity Framework, I keep getting a keyword that is not supported: "metadata". I deleted some active recordsets and tried to replace 'c' but this does not work. I am fully committed to the ideas.

+7
source share
2 answers

Here is my connection string defined on the Azure portal for the DatabaseFirst approach:

metadata=res://*/mySuperModel.csdl|res://*/mySuperModelModel.ssdl|res://*/mySuperModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=tcp:myServerName.database.windows.net,1433;Initial Catalog=myDatabaseName;User ID=myUserName@myServerName ;Password=myPasswordHere;" 

Compare with yours and note that the connection type is β€œnormal” on the azure portal.

+18
source

I had the same problem as the OP, but its solution did not work for me.

This was a problem with the connection string, but not with quotation marks.

Since it took me two days to decide, maybe this will help someone else:

A connection string that works [for my ASP.NET MVC 4.5 / Entity Framework 5.0 application when hosted on Azure (I develop locally with SQL Server 2012, but transfer the database to the Azure SQL database (using the SQL Database Migration Wizard )) . First, I use the database to create my .edmx file (I generate a data model from the database):

 <add name="MYPROJECTENTITIES" connectionString="**metadata=**res://*/MODELS.MYPROJECTMODEL.csdl|res://*/MODELS.MYPROJECTMODEL.ssdl|res://*/MODELS.MYPROJECTMODEL.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=tcp:B6JD5K5EP4.database.windows.net,1433;Initial Catalog=MYPROJECT_DB;Integrated Security=False;User ID=MYPROJECT@B6JD5K5EP4 ;Password=MYPASSWORDABC123;**MultipleActiveResultSets=True**;Encrypt=True;TrustServerCertificate=False&quot;" providerName="System.Data.EntityClient"/> 

Text in UPPERCASE is my Azure info. Obviously, you will need to use your own.

This part of the connection string gave me nightmares, and this may cause your problem too:

 res://*/Models.MyProjectModel.csdl|res://*/Models.MyProjectModel.ssdl|res://*/Models.MyProjectModel.msl 

These links must be exactly correct. Let me repeat: these links must be exactly correct!

After reading this article from 2008 ("Troubleshooting Entity Framework Connection Strings"), I used the .NET Reflector to look inside MyProjectModel.dll (my .dll name (probably different from your project), as it suggests, and, of course, the connection string (which was automatically created for me by the Entity Framework!) was incorrect. It did not include the prefix. soon when I added Models. prefix (this is how .csdl / .msl / .ssdl are named inside my .dll (rather everything, different from you)), everything worked fine. your .dll and see if the names match. If not, change them to they corresponded to what appeared in the .dll. (Read the article above if what I say is not clear enough.)

+2
source

All Articles