1

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.

Annie
  • 3,090
  • 9
  • 36
  • 74

1 Answers1

1

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.

Jason Malinowski
  • 18,148
  • 1
  • 38
  • 55