Owen Pierce
Owen Pierce

Reputation: 41

"Unable to load the specified metadata resource"

I am getting the error "Unable to load the specified metadata resource". I am new to asp.net and am following this tutorial:
http://www.asp.net/web-forms/tutorials/tailspin-spyworks/tailspin-spyworks-part-2

I created a entity data source control and then created a ADO.NET entity data entry with the database provided. then when i try to use the control i get the error.

I read it could be the connection string so here is mine. I have spent hours trying to fix it, can someone help?

Here is my connection string:

<add name="Entities" 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=OWEN;initial catalog=Commerce.mdf;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework';" providerName="System.Data.EntityClient" />

thanks.

Upvotes: 3

Views: 3502

Answers (1)

m.edmondson
m.edmondson

Reputation: 30862

Personally when I've come across this problem it has meant the application was unable to load the EDMX file which contains the model for your database.

Usually the reason for this is that the the metadata parameter isn't quite correct in your config file:

metadata=res://*/Data_Access.EDM_Commerce.csdl| res://*/Data_Access.EDM_Commerce.ssdl| res://*/Data_Access.EDM_Commerce.msl;

another reason is that you've modified the wrong config file which can happen when you have multiple projects in your solution.

I've found this excellent blog post that I think will point you in the right direction.

Upvotes: 2

Related Questions