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.
source
share