Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

How to get the Import elements for a given EnvDTE.Project?

$
0
0
I need to determine whether a given EnvDTE.Project imports a particular .targets file. I also need to add and remove Imports from projects.

Currently, because I couldn't find a way to do this in the VS Extensibility API, I resorted to using the Microsoft.Build.Evaluation API to read/edit the project file on disk.

There is an obvious down-side to this: I am reading and writing a version of the project that doesn't contain any in-memory edits, so could be out of date. Secondly, when I make a change, I trigger a fairly nasty "reload project" message box.

So, I'm wondering where project imports info is exposed so I can read/modify the in-memory version of the loaded project. Does anyone know? I need to be able to read Imports that are not currently 'enabled' (i.e. their Condition may evaluate to false)



Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>