Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entity Framework EDMX Copy to Output Directory

I have my edmx Metadata Artifact Processing set to Copy to Output Directory. The csdl/msl/ssdl get copied fine to the bin directory of the project with the model, but none of the other projects which reference this project get the artifacts copied into the bin directories.

I have several end exes/services/etc that require these files and I don't want to add a post build task for all of them. Is there any way I can get these resources deployed correctly? Or can I just use the raw edmx file somehow (not the csdl/msl/ssdl)?

Thanks.

like image 286
Jeff Avatar asked Nov 13 '22 22:11

Jeff


1 Answers

Shame I couldn't find a better answer...but I just ended up leaving them set as Metadata Artifact Processing and then in a static constructor for my ObjectContext type I extracted the csdl/msl/ssdl using Assembly.GetExecutingAssembly().GetManifestResourceStream() and wrote them to disk in the executing assembly's location.

like image 172
Jeff Avatar answered Dec 18 '22 19:12

Jeff