I'm working on project where we recently upgraded to Entity Framework 5. After we upgraded I created a new .edmx model and moved all out entities over to the new model.
From what I can tell Entity Framework 5 runs of POCO objects. The problem I'm having is that POCO objects don't seem to be included in source control. If a new developer opens the solution it doesn't include any generated POCO objects. To get around this we can right click "MyModel.Context.tt" and "MyModel.tt" and click "run custom tool" to generate the POCO objects. So is there a way to include the POCO objects in tfs so we don't have to generate them when a new dev opens the solution?
UPDATE
So I tried what a few people have suggested and use "include in project" but if I look at the the folder that contains the model in visual studio with the show all files options on none of the classes show up. BUT if I look at the folder with windows explorer it shows all the files... what give?
Further to Saml's Answer above...
For Visual Studio 2012, in order to add your POCO's do the following;
Now Check In your Solution again, and your POCO's should now be included.
First open the Team Explorer window:
Then expand your project and double click "Source Control".
In the Source Control Explorer window, browse to the folder that the POCO files should be located in, right click the explorer window or directory and select "Add Items to Folder" (or something similar... it's been a few months since I've used TFS)
Finally select the files that were auto generated and include them. Don't forget to check in!
Something to note, when including auto generated files into TFS it is possible to have issues in the future if you ever try to re-generate those files. You may end up with ReadOnly access issues. This can be solved by manually checking out the files to unlock them. Once checked out, re-generate to your heart's content!
This is a little late, but I just ran into the same problem.
I could not add the missing files to TFS. Instead of trying to add each file, I was able to right click on the EDMX file in the Solution Explorer then click 'run custom tool', then right click the EDMX file again and click Add To Source Control. This added all the missing files and I was able to check them in.
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