I am working on a Visual Studio extension that should directly modify the project's MSbuild file (e.g. * .csproj). Unfortunately, the Visual Studio SDK does not seem to publicly disclose any objects that support this.
If all else fails, I can always create a Microsoft.Build.Evaluation.Project based on the file after the save event, making my changes there, then save again. However, this will force the user to reload their project, which I would rather avoid.
The best partial solution is described in this thread . Visual Studio stores some of the evaluated objects in ProjectCollection.GlobalProjectCollection and smoothly detects any changes that I make using my extension. Unfortunately, this does not work for all types of projects; it works fine for C #, but the global collection remains empty when loading a C ++ project.
Does anyone know of a good, supported way to access evaluated project objects? If this is not the case, is there a solution that does not require reloading the project?
The extension should be compatible with Visual Studio 2013+, but should not support older versions.
source
share