In the project, use unity as the IOC to concatenate the entire project and integrate WCF and ADO. NET Entity Framework, initially showed that unity could not construct the object. After being ruled out, it was found that ADO was used. the following exception occurs when the NET Entity Framework constructs the application: Unable to load the specified metadata resource.
Exception information:
System. Data. metadataexception was unhandled
Message = "unable to load the specified metadata resource ."
Source = "system. Data. Entity"
Stacktrace:
At system. Data. Metadata. EDM. metadataartifactloadercompositeresource. loadresources (string assemblyname, string resourcename, icollection '1 uriregistry, metadataartifactassemblyresolver resolver)
At system. Data. Metadata. EDM. Metadata. createresourceloader (string path, extensioncheck, string validextension, icollection '1 uriregistry, metadataartifactassemblyresolver resolver)
At system. Data. Metadata. EDM. metadataartifactloader. Create (string path, extensioncheck, string validextension, icollection '1 uriregistry, metadataartifactassemblyresolver resolver)
At system. Data. entityclient. entityconnection. splitpaths (string paths)
At system. Data. entityclient. entityconnection. getmetadataworkspace (Boolean initializeallcollections)
At system. Data. entityclient. entityconnection. initializemetadata (dbconnection newconnection, dbconnection originalconnection, Boolean closeoriginalconnectiononfailure)
At system. Data. entityclient. entityconnection. open ()
Throw an exception-unable to load the specified metadata resource. After checking, the problem occurs in the app. config configuration file (this configuration file is used in ADO. NET Entity Data Model wizard automatically added), when moving the EDM file location will modify the app. the connection string information in config. Therefore, when moving the EDM file, remember to update the database connection string information.