If you are using entity framework and gets the following error message “Unable to load the specified metadata resource” while trying to fetch some data from a database. You can see what cause this message and how to solve it.
(Additional error message)
System.Data.Entity.Core.Metadata.Edm.MetadataArtifactLoaderCompositeResource.LoadResources(String assemblyName, String resourceName, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver)
The error message says that it can’t read the meta data that is used by entity framework. The meta data is specified in the connection string like this: “metadata=res://*/[NAME].[NAME].csdl|res://*/[NAME].[NAME].ssdl|res://*/[NAME].[NAME].msl”. If any of the names / paths have changed or doesn’t match the DB Entity model name the meta data can’t be read.