Frage

I heard lots about Roslyn, and I just thought is it possible to generate code dynamically from an xml file so that for the developer it will be transparent and he could enumerate the code with IntelliSense as if the code is written in the project.

I am writing a framework with a lot of customization done via config files, and would really like to use such feature if it's possible.

War es hilfreich?

Lösung

What you want is what F# calls type providers and it probably is possible to do by hacking the Roslyn compiler but I think it will be a lot of work. You may want to have a look at the related question Could F# type providers be incorporated in C#. Your best bet may be to use the F# type providers in a F# project and then reference this project and its types from C# projects but I can not tell if this is viable because I am lacking F# experience.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top