私は Visual Studio 2010 拡張機能に取り組んでおり、次のように MSBuild アイテムに属性を追加したいと考えています。
<EmbeddedResource Include="SomeFile.xml">
<FooAttribute>%(Filename)%(Extension)</FooAttribute>
</EmbeddedResource>
したがって、私が見つけた唯一の方法は、メソッドを使用することIVsBuildPropertyStorage.SetItemAttribute
です。これは単純な文字列では問題なく機能しますが、MSBuild にとって特別な文字を使用しようとすると、次の結果が得られます。
<EmbeddedResource Include="SomeFile.xml">
<FooAttribute>%29%25%28Filename%29%25%28Extension%29</FooAttribute>
</EmbeddedResource>
これは、SetItemAttribute
が MsBuild 文字から自動的にエスケープすることを意味し、私はそれを望んでいません。