I am working on a Visual Studio 2010 extension and I want to add an attribute to an MSBuild Item, as follows:
<EmbeddedResource Include="SomeFile.xml">
<FooAttribute>%(Filename)%(Extension)</FooAttribute>
</EmbeddedResource>
So, far the only way I found is using the method IVsBuildPropertyStorage.SetItemAttribute
. This works fine for simple strings, but when i try to use characters that are special to MSBuild, I get this result:
<EmbeddedResource Include="SomeFile.xml">
<FooAttribute>%29%25%28Filename%29%25%28Extension%29</FooAttribute>
</EmbeddedResource>
This means that SetItemAttribute
automatically escapes from MsBuild characters and I don't want that.