Can I use Roslyn for compile time code rewriting?

牧云@^-^@ 提交于 2019-11-27 21:20:28

Compile time re-writing isn't directly supported by Roslyn today, but syntactic and semantic transformations definitely are. In fact, take a look at the "ImplementNotifyPropertyChanged" sample included in the CTP to see something of what you want to do. The sample is implemented as a design time transformation in and IDE feature, but you can extract the logic and make it into something like a pre-build task that rewrites files before compilation.

I don't think this is possible in the current CTP that has been released as the compiler is there as service but there is no such thing which allows you to plug into the compilation process as you can do in Nemerle.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!