1

I am developing a visual studio extension, and I need to set some msbuild properties in .csproj file. The IVsBuildPropertyStorage interface is able to set properties, but it does not support un-evaluated value, such as $(Configuration). So, I want to get an IVsBuildPropertyStorage2 instance, but I don't know how to get this.

Is there someone can help me?

nobodyiam
  • 11
  • 3
  • Have you seen that https://social.msdn.microsoft.com/Forums/vstudio/en-US/ca326b23-7c8e-4df2-96cf-f2412c42eecc/how-to-retrieve-a-ivsbuildpropertystorage2?forum=vsx it looks like this interface is not really usable the way one thinks. – Simon Mourier Dec 28 '18 at 08:57

1 Answers1

1

IVsBuildPropertyStorage is typically implemented by object that implements the project hierarchy (IVsHierarchy). If you can retrieve the IVsHierarchy interface for the given project, you can probably cast it to IVsBuildPropertyStorage or IVsBuildPropertyStorage2.

A quick search on GitHub should result in a good number of examples.

Sincerely,

Ed Dore
  • 2,013
  • 1
  • 10
  • 8
  • This doesn't really answer the question. The question was how to get an instance of `IVsBuildPropertyStorage2`, not how to get an instance of `IVsBuildPropertyStorage`. The GitHub search is for the wrong type. [This search](https://github.com/search?l=C%2B%2B&q=IVsBuildPropertyStorage2&type=Code) for `IVsBuildPropertyStorage2` only finds ~250 XML documentation files and ~30 C++ header files. There are no actual examples of how to use it. – reduckted Dec 16 '19 at 03:43