I've run into a snag with a ADO.NET Entity Framework model and a ADO.NET Data Service that is making it available. The model and data service are compiling without any problems or warnings when they come out of source control. However when I run the service I get the following error:
Unfortunately there are no server logs (that I am aware of) since this is VS 2008 web dev server and there really isn't any code to debug..... Through some trial and error it would appear that the generated code (model.Designer.cs) is out of date in some manner. If I perform some trivial update to the EDM that forces it to regenerate the code file, when I rerun the service it works just fine.
I've tried to delete the model.designer.cs file in the hopes that during the build the project/entity builder would detect the missing file and regenerate it for me. That didn't happen..... Does anyone know how to force this code to be regenerated? (It would also make me a bit happier about not having to keep generated code under source control.)
Thanks
edmx file is an XML file that defines an Entity Data Model (EDM), describes the target database schema, and defines the mapping between the EDM and the database. An . edmx file also contains information that is used by the ADO.NET Entity Data Model Designer (Entity Designer) to render a model graphically.
For updating right click on the edmx icon on Model Browser and select Update Model From Database. This will open a new window where you can see three tabs. Add, Refresh, Delete. If you would like to add a newly created entity then select Add.
Right click on the EDMX file and select Run Custom Tool.
There is also a command line code generation tool called edmgen (available from a VS Command Prompt).
In Visual Studio 2017, it looks like just saving the .tt
file automatically re-runs the template, updating the entity class files.
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