Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specifying location of .csdl / .ssdl / .msl Metadata files within the output assembly

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?

like image 276
GrandMasterFlush Avatar asked Feb 21 '12 09:02

GrandMasterFlush


1 Answers

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!

like image 81
GrandMasterFlush Avatar answered Sep 19 '22 22:09

GrandMasterFlush