1
Vote

“Unable to load the specified metadata resource”

description

Help Im getting that error in my machine...

Im following the steps of tailspin spyworks, im connecting to the entity data source and
the error
“Unable to load the specified metadata resource”

http://www.asp.net/web-forms/tutorials/tailspin-spyworks/tailspin-spyworks-part-3[^]

this is my connection string in web config

Collapse | Copy Code
<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />

<add name="CommerceEntities" connectionString="metadata=res:///App_Code.EDM_Commerce.csdl|res:///App_Code.EDM_Commerce.ssdl|res://*/App_Code.EDM_Commerce.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Commerce.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />

file attachments

comments

basba wrote Jan 24, 2014 at 9:56 AM

I believe that it is pointing to a non existent directory (App_Code), from your attched pic I could see that it does not exist in your project, though Data_access directory does and your code is not pointing to it.

Try this string or modify it to suit the application

<add name="CommerceEntities" connectionString="metadata=res:///Data_Access.EDM_Commerce.csdl|res:///Data_Access.EDM_Commerce.ssdl|res://*/Data_Access.EDM_Commerce.msl;provider=System.Data.SqlClient;provider connection string="data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\Commerce.mdf;integrated security=True;user instance=True;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />

This one should work fine.

Good luck
basba