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

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -