0

I get this error: "Unable to load the specified metadata resource"

i'm stuck for hours, and can't get the solution.

this is the connectionstring from App.config:

  <connectionStrings>
    <add name="SystemDBEntities" connectionString="metadata=res://*/ModelSystem.csdl|res://*/ModelSystem.ssdl|res://*/ModelSystem.msl;provider=System.Data.SqlClient;provider connection string='data source=(LocalDB)\v11.0;attachdbfilename=&quot;c:\users\Shalom\documents\visual studio 2013\Projects\MvcStorageManagment\MvcStorageManagment\App_Data\SystemDB.mdf&quot;;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework'" providerName="System.Data.EntityClient" />
  </connectionStrings>

and this is the code in Web.config:

  <connectionStrings>
    <add name="SystemDBEntities" connectionString="metadata=res://*/Models.ModelDB.csdl|res://*/Models.ModelDB.ssdl|res://*/Models.ModelDB.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(LocalDB)\v11.0;attachdbfilename=|DataDirectory|\SystemDB.mdf;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>

the App.config is in the BusinessLogic where the Model and the Db is in other project, that's the reason i placed the connection path Hard Codded in App.config

thank you

Yalin
  • 345
  • 2
  • 9

1 Answers1

0

i got the answer.

when the database and entity in business logic, you need to sets connection string in web.config Models.ServiceModel.csdl instead ServiceModel.csdl the same to all metadata files.

Yalin
  • 345
  • 2
  • 9