none
vs 2013 and "Unable to load the specified metadata resource"

    Question

  • I'm using VS 2013 and SQL Svr 2012 and trying use EF to populate a gridview.  As this is a very simple test, I have one table with a key and a couple of data fields.  The process of creating the model seems to work fine - it shows as expected in the designer view, the files are created in app_code, a bin folder is created with 2 dlls, and the config file is updated with a connection string and other entries.

    When I try to select the "named connection" I get the error "Unable to load the specified metadata resource" and it talks about rebuilding the project to get the assemblies.

    I've spent hours reading other cases like this and I can't understand:

    1.  Why this is happening when it was never a problem with VS 2010

    2.  How do I fix the connection string to point to the resources it wants.  I'm totally lost with all the technical advice about fully qualified assembly names - nothing I try works.

    3.  How do I set some parameter to force the resources to be in the proper place?  All the advice I've read doesn't seem to relate very well with VS 2013.

    Here is how the App_Code folder appears

    <configuration>
      <configSections>
        <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
        <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
      </configSections>
      <system.web>
        <compilation debug="true" strict="false" explicit="true" targetFramework="4.5.1">
          <assemblies>
            <add assembly="System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
            <add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
          </assemblies>
          <buildProviders>
            <add extension=".edmx" type="System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider" />
          </buildProviders>
        </compilation>
        <httpRuntime targetFramework="4.5.1" />
      </system.web>
      <connectionStrings>
        <add name="TinyDBEntities" connectionString="metadata=res://*/App_Code.Model.csdl|res://*/App_Code.Model.ssdl|res://*/App_Code.Model.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=xxx\sqlexpress;initial catalog=TinyDB;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
      </connectionStrings>
      <entityFramework>
        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
        <providers>
          <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
        </providers>
      </entityFramework>
    </configuration>

    here is the error:

    If the suggestion is to change the connection string, please be specific as I'm not sure what people mean when the suggest dll names, assembly names, etc.

    Thanks


    Dave Harney

    Friday, October 25, 2013 9:52 PM

Answers