roslyn - How to read the source code of active document using DTE/DTE2 in visual studio project -
i trying generate assembly file (dll) current active document in editor.
ex. have 3 c# source files - file1.cs, file2.cs, file3.cs , if opened file2.cs in editor. need build assembly dll single file file2.dll using roslyn compiler api.
you can current document text following code:
envdte.textdocument textdocument = (envdte.textdocument)dte.activedocument.object("textdocument"); envdte.editpoint editpoint = textdocument.startpoint.createeditpoint(); string result = editpoint.gettext(textdocument.endpoint);
Comments
Post a Comment