Entity framework metadata exception - No csdl, ssdl, msl in dll resources

你。 提交于 2020-01-21 07:49:47

问题


I have DAL (model first entity framework 4.1) and Service which is using it in separate projects. Everything was working fine, but after some minor changes (for example I generated model from database) it stoppedd working. I am now getting metadata exception. After many hours of research I downloaded ILSpy and checked that inside DAL.dll there are no resources. My connection string looks like:

metadata=res://*/DataModel.TerminalRegistryModel.csdl|
         res://*/DataModel.TerminalRegistryModel.ssdl|
         res://*/DataModel.TerminalRegistryModel.msl;

ANd in EDMX file metadata artifact processing is set to Embed in Output Assembly. What can cause my problem?


回答1:


The standard metadata string looks like this:
metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl
And this works fine in most cases. However, in some Entity Framework get confused and does not know which dll to look in. Therefore, change the metadata string to:
metadata=res://nameOfDll/Model.csdl|res://nameOfDll/Model.ssdl|res://nameOfDll/Model.msl



来源:https://stackoverflow.com/questions/10803930/entity-framework-metadata-exception-no-csdl-ssdl-msl-in-dll-resources

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!