How do I make the ADO.NET Entity Framework regenerate code?

entity-framework wcf-data-services

Question

With an ADO.NET Entity Framework model and the ADO.NET Data Service that makes it accessible, I've hit a roadblock. When the model and data service are released from source control, they compile without any errors or warnings. However, I see the following error when I execute the service: Request Error - The server encountered an error processing the request.  See server logs for more details.

Since this is a VS 2008 web dev server and there isn't actually any code to debug, there are sadly no server logs (that I am aware of). It would seem from some trial and error that the produced code (model.Designer.cs) is outdated in some way. When I restart the service, it works well if I make a little edit to the EDM that makes it regenerate the code file.

In an effort to have the project/entity builder rebuild the missing file for me during the build, I've tried deleting the model.designer.cs file. That didn't take place. Anyone with knowledge on how to make this code be created again? The fact that I wouldn't have to maintain created code under source control would also make me a little happy.

Thanks

1
15
2/26/2019 8:00:15 PM

Accepted Answer

Run Custom Tool by performing a right-click on the EDMX file.

Additionally, there is a program for creating command-line code called edmgen (available from a VS Command Prompt).

22
1/26/2009 4:23:25 AM

Popular Answer

When using Visual Studio 2017, it seems that just saving the.tt file re-runs the template automatically, updating the entity class files.



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow