Wednesday, January 12, 2011

ASP.NET MVC 3 Error: Unable to load the specified metadata resource

If you look up any posts about using the POCO T4 template, and you place your entity model in a different project, your POCO's in a different project, and your site in a different project, you probably came across this error:

"Unable to load the specified metadata resource"

I overcame this issue by changing my connection string to point to the dll where my Entity framework "chinook.edmx" file was located. In my case, I placed my edmx file in a project called "Models". In your website, you will need to change the metadata portion of your connectionstring to:

metadata=res://Models/chinook.csdl|res://Models/chinook.ssdl|res://Models/chinook.msl;

Hope this works for you.

0 comments: