user221592
user221592

Reputation: 403

How to set up SDK-style C# project to automatically generate classes when EDMX file is saved

In Visual Studio 2022, when using the pre-SDK-style C# projects, when I save a change to an EDMX file, it automatically runs the T4 template generator on the model and context TT files to generate the appropriate class files (as witnessed by getting the popup security warnings about running the templates). When I have an EDMX file in an SDK-style project, it does not automatically run the T4 generators - I have to manually right-click on each of the two TT files and choose "Run custom tool". Given that my team is accustomed to the automatic generation, I would be concerned that they may forget to manually run the generators and the code wouldn't be updated. (Plus who wants to manually do it.) How do I properly configure an SDK-style project to generate on save? Or does Visual Studio simply not support generate-on-save in SDK-style projects?

Some additional notes:

Upvotes: 2

Views: 262

Answers (0)

Related Questions