none
ProviderManifestToken=2012 in edmx causes metadata load errors

    Question

  • When using Designer in Visual Studio 2013:

    I add a edmx via the interface Add New Item --> ADO.NET Entity Data Model

    I added a table from the Database to the Model and the Model code was generated.

    Then default.aspx I add an EntityDataSource  and then click  ConfigureDataSource and select the Named Connection for the edmx, I get an error saying "The metadata specified in the connectionstring could not be loaded ......"

    If in the edmx xml I change from ProviderManifestToken="2012" to ProviderManifestToken="2008" the error disappears.

    So I can not have the value ProviderManifestToken="2012" in my edmx.

    The edmx was generated by Visual Studio and the ProviderManifestToken="2012" is part of that.

    So What is the problem here?


    • Edited by Jakes Malakes Tuesday, October 22, 2013 9:51 AM Changed Version of Visual Studio and included the fact that I did add a table to the Model.
    Sunday, October 20, 2013 1:48 PM

Answers

  • Hi Jakes,

    Thanks for clarifying what you question was about and for reporting this. Certainly, the EntityDataSource that is part of .NET framework does not support EF6. When you get the error it is because the control is trying to load the model in the EF5 runtime, which does not support 2012 as the value for ProviderManifestToken.We have an updated version of the EntityDataSource in the works that supports the EF6 runtime, and the current plan is to make it available in a NuGet package.

    In the meanwhile, it seems that there are two workarounds:

    - Editing your edmx file and replacing 2012 with 2008 then using EF5 instead of EF6

    - Using model binding for WebForms instead of a DataSource control.

    Hope this helps,

    Diego


    This posting is provided "AS IS" with no warranties, and confers no rights.


    Tuesday, October 22, 2013 11:53 AM
    Moderator

All replies

  • Hello,

    Thanks for posting to this forum.

    For the error message “The metadata specified in the connectionstring could not be loaded ......”, as far as I know, it will occur when we have generate an empty model like below:

    For fix this, we should choice one entity at least like below:

    And then clean the solution and rebuild it.

    If this does not work for you, please let me know.

    Thanks&Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, October 21, 2013 3:18 AM
    Moderator
  • Hi Jakes,

    We only added support for having ProviderManifestToken = "2012" in EF6, but it doesn't really add much as EF6's SQL Server provider treats SQL Server 2012 and SQL Server 2008 mostly the same. You should leave it as ProviderManifestToken="2008" for any previous version of EF.

    Hope this helps,

    Diego


    This posting is provided "AS IS" with no warranties, and confers no rights.

    Monday, October 21, 2013 11:56 PM
    Moderator
  • Hello I just updated the question to reflect that did add a table and the Model code was generated.
    Tuesday, October 22, 2013 9:52 AM
  • Hello,

    I just updated the question to show that I am using Visual Studio 2013 not 2012.

    So I am using EF6.

    I have a basic sample project that I could upload but I do not see how to attach it to this thread.

    It seems like there is a problem with VS2013 as I can reproduce this error by simply setting up a new project, creating a Entity Data Model with a table from a database in SQL server 2012 Express and then trying to use that Model with an EntityDataSource.

    Is there any way I can attach a sample project here?

    Tuesday, October 22, 2013 9:57 AM
  • Hi Jakes,

    Thanks for clarifying what you question was about and for reporting this. Certainly, the EntityDataSource that is part of .NET framework does not support EF6. When you get the error it is because the control is trying to load the model in the EF5 runtime, which does not support 2012 as the value for ProviderManifestToken.We have an updated version of the EntityDataSource in the works that supports the EF6 runtime, and the current plan is to make it available in a NuGet package.

    In the meanwhile, it seems that there are two workarounds:

    - Editing your edmx file and replacing 2012 with 2008 then using EF5 instead of EF6

    - Using model binding for WebForms instead of a DataSource control.

    Hope this helps,

    Diego


    This posting is provided "AS IS" with no warranties, and confers no rights.


    Tuesday, October 22, 2013 11:53 AM
    Moderator
  • Hi Diego,

    Thanks for the Answer.


    Tuesday, October 22, 2013 3:49 PM
  • I'm working in VS2012 and I get this error with a new project. I'm using SQL 2012, but it doesn't working.

    Using ProviderManifestToken="2008" seems to work for now. 

    • Edited by Peter_D503 Friday, June 27, 2014 6:26 AM
    Friday, June 27, 2014 6:23 AM