Entity structure metadata exception - no csdl, ssdl, msl in dll resources

I have a DAL (model of the first entity structure 4.1) and a Service that uses it in separate projects. Everything works fine, but after some minor changes (for example, I created a model from the database), it stopped working. Now I get a metadata exception. After many hours of research, I downloaded ILSpy and verified that there were no resources inside DAL.dll. The connection string looks like this:

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

ANd in the metadata of the EDMX file for processing the artifact is set to "Insert into the results assembly." What could cause my problem?

+4
source share
1 answer

The standard metadata line is as follows:
metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl
And it works great in most cases. However, in some Entity Framework it gets confused and does not know which DLL to look for. Therefore, change the metadata line to:
metadata=res://nameOfDll/Model.csdl|res://nameOfDll/Model.ssdl|res://nameOfDll/Model.msl

+2
source

Source: https://habr.com/ru/post/1414946/


All Articles