简体   繁体   中英

How can I generate plain old code from a text file on save with visual studio?

Many of the features in visual studio rely on editing a markup file and then saving it to auto-generate POC in C#.

For example, editing and saving a database *.dbml file will generate a *.designer.cs file that you can call from POC. It's also seen with ASP.Net *.aspx files, generating an *.aspx.designer.cs upon save so that the controls can be accessed in the codebehind files.

Is it possible to leverage this functionality in my own software so that I can define my own text files in CSV, JSON, or XML format and specify rules for generating code upon saving the file?

用于生成代码的Visual Studio功能称为T4模板化

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM