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:
- Generate-on-save is missing in SDK-style projects both when I have created the project from scratch and when I have converted old projects to SDK-style.
- In converted projects, the behavior is the same whether I use automatic file inclusion or not. So both of these do not generate-on-save:
- Delete the list of .cs files from the project and let it auto-determine
- Set EnableDefaultCompileItems = false and leave the list from the original pre-SDK project which includes the DependentUpon attributes.