Кто-нибудь имел опыт выполнения преобразования xml в файлах resx раньше? Я хотел бы преобразовать файл resx для каждой конфигурации. Файл преобразования каждой конфигурации может заменить некоторые строковые значения в файле ресурсов. Например:
<None Include="Resources\Label.Release.resx.config">
<DependentUpon>Label.resx</DependentUpon>
</None>
<EmbeddedResource Include="Resources\Label.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Label.Designer.cs</LastGenOutput>
</EmbeddedResource>
Я пытаюсь преобразовать некоторые значения данных в файле resx. В Label.Release.resx.cofing:
<?xml version="1.0" encoding="utf-8" ?>
<root xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<data name="Title" xml:space="preserve" xdt:Locator="Match(name)">
<value xdt:Tranform="Replace">CEO</value>
</data>
</root>
Я попытался поиграть с этим в задаче BeforeBuild:
<Target Name="BeforeBuild">
<MakeDir Directories="$(IntermediateOutputPath)\Resources"
Condition="!Exists('$(IntermediateOutputPath)\Resources')"/>
<TransformXml Source="Resources\Label.resx" Transform="Resources\Label.$(Configuration).resx.config" Destination="$(IntermediateOutputPath)\Resources\Label.resx" />
The Label.resx that results in $(IntermediateOutputPath)\Resources folder after has had no transformation. I'm also not sure if that's the location that I would output the transformation result to because Lable.resx should be an embedded resorce in the end.
любая помощь приветствуется