I have an EF project that containing my data model that I have been successfully using. The "Metadata Artifact Processing" option is set to "Embed in Output Assembly".
As the .edmx file was in the root folder of the project the metadata string used in the EntityConnectionStringBuilder was set to:
res://*/myProject.csdl|res://*/myProject.ssdl|res://*/myProject.msl
When I was restructuring the project, I moved the .ecdm file into a subfolder:
/DataLayer/myProject/
and I changed the metadata string to:
res://*/DataLayer/myProject/myProject.csdl|res://*/DataLayer/myProject/myProject.ssdl|res://*/DataLayer/myProject/myProject.msl
This now causes an error ("The specified metadata path is not valid") but I can't see what's wrong with the folder path I've specified in the metadata.
I know that I can just move the .ecdm file back to the root but I've had this problem before and couldn't fix it - is there something obvious I'm missing?
I finally worked it out.
The folders should be separated with '.' not '/'.
The correct format for the metadata is:
res://*/DataLayer.myProject.myProject.csdl|res://*/DataLayer.myProject.myProject.ssdl|res://*/DataLayer.myProject.myProject.msl
Hopefully this will save someone from banging their head against the wall for a while!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With