February 2008
M T W T F S S
« Jan   May »
 123
45678910
11121314151617
18192021222324
2526272829  

Archive for February, 2008

01
Feb

Embedding EF models in assembly

I have been dealing with a problem for while in Entity Framework. When I compile the EF models the ssdl, msl, csdl files are put in the solution. Then I put my connection strings to those files in my web.confg. The issue I have is that we do a lot of work on MS Terminal Server. Since we have a lot of other people on there, I force the users to save the models to a separate and unique folder. They then reference the models in their web.config. Once in a while the user will accidentally check in that web.config into TFS. That causes chaos because now I am using their models in my running environment. Any change they make breaks my project. Any change I make I don’t see. Then I have to go in and change my web.config to reference my models locations. Simple but a pain.

Well thanks to Jonathan Carter  I have now solved that problem. With a small change to the model properties the schema files get embedded into the assembly. Then you change reference in your web.config to the compiled versions. Tada no more head aches.

You can read all about it in  Julie Lerman’s post.