With EnvDTE.ProjectItem
, is it possible to parse an in-memory C#-code string to get the FileCodeModel
?
I don't want to alter the project file in this course by adding a temporary file to project, get its ProjectItem
, do stuff and then delete the file. It will further alert the source control to observe the changes.
There's simply no good way to do this with CodeModel. This is why we're building Roslyn to make this sort of operation trivial -- it operates with an immutable model where you can take a solution, fork it to a separate copy and do analysis, without every modifying the original. There's previews out you might be able to use, depending upon your scenario.