指定输出程序集中 .csdl / .ssdl / .msl 元数据文件的位置
我有一个 EF 项目,其中包含我已成功使用的数据模型。 “元数据工件处理”选项设置为“嵌入输出程序集中”。
由于 .edmx 文件位于项目的根文件夹中,EntityConnectionStringBuilder 中使用的元数据字符串设置为:
res://*/myProject.csdl|res://*/myProject.ssdl|res:/ /*/myProject.msl
当我重组项目时,我将 .ecdm 文件移动到一个子文件夹中: /DataLayer/myProject/
并将元数据字符串更改为:
res://*/DataLayer/myProject/myProject.csdl|res://*/DataLayer/myProject/myProject.ssdl |res://*/DataLayer/myProject/myProject.msl
这现在会导致错误(“指定的元数据路径无效”),但我看不到文件夹路径有什么问题我已在元数据中指定。
我知道我可以将 .ecdm 文件移回根目录,但我以前遇到过这个问题并且无法修复它 - 是否有一些明显的我丢失的东西?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我终于解决了。
文件夹应以“.”分隔不是 '/'。
元数据的正确格式是:
希望这能让某人暂时不用用头撞墙!
I finally worked it out.
The folders should be separated with '.' not '/'.
The correct format for the metadata is:
Hopefully this will save someone from banging their head against the wall for a while!