Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Aspect Oriented Programming with Roslyn

Does roslyn or visual studio 2015 provide API to rewrite IL or "something like that"? Let me explain...

I've read in msdn magazine's article Use Roslyn to Write a Live Code Analyzer, that it is possible to write custom code analyzers distributed via nuget packages, without need for visual studio plugins.

I'm really curious, if roslyn compiler and visual studio 2015 will allow to implement e.g. Code Cotracts such way, that no plugin is required to build it correctly.

Also, I would like to gain productivity and readability of my code with aspects like [NotifyPropertyChanged] data annotation on properties, but again, if it won't build correctly on every machine with visual studio 2015, it's not a good idea.

like image 785
Liero Avatar asked Feb 13 '15 09:02

Liero


1 Answers

It is possible to use DispatchProxy from System.Reflection.DispatchProxy package. Unfortunately I haven't found any examples how to use it, but it looks like a replacement for RealProxy class with some differences (examples how to use RealProxy: hear and here).

like image 142
Valerii Avatar answered Oct 14 '22 13:10

Valerii