How to prevent IVsBuildPropertyStorage.SetItemAttribute from escaping special characters?

I am working on a Visual Studio 2010 extension and want to add an attribute to an MSBuild element as follows:

 <EmbeddedResource Include="SomeFile.xml">
      <FooAttribute>%(Filename)%(Extension)</FooAttribute>
 </EmbeddedResource>

So, far from the only way to find a method IVsBuildPropertyStorage.SetItemAttribute. This works fine for simple strings, but when I try to use characters that are special for MSBuild, I get this result:

 <EmbeddedResource Include="SomeFile.xml">
      <FooAttribute>%29%25%28Filename%29%25%28Extension%29</FooAttribute>
 </EmbeddedResource>

This means that it is SetItemAttributeautomatically removed from the MsBuild characters, and I do not want this.

+5
source share
1 answer

, . VS2010, , , .

IVsBuildPropertyStorage2

, MSBuild. , IVsBuildPropertyStorage. .

SetPropertyValueEx: http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.shell.interop.ivsbuildpropertystorage2.setpropertyvalueex.aspx

+2

All Articles