1

got an interesting little problem that I can't seem to find an answer to on here.

My project in visual studio 2013 contains lots of language resource files Resources.en-GB.resx etc for the different languages that it can be used in. They compile to dlls in bin\debug\en-GB\Projecty.Wojecty.resources.dll etc.

I also have different build configurations that change a few things for when in different countries.

My question is how do I only build certain language resource dlls for certain build configurations. For example for a deployment in Russia I only want the russian and english language dlls. For deployment in Germany I only want german and english

dibs487
  • 1,294
  • 4
  • 21
  • 36
  • I answered a similar question [here](http://stackoverflow.com/questions/32323273/how-do-i-prevent-foreign-language-resource-generation-by-overriding-msbuild-targ/32326251#32326251). Please make sure to read Alexey Shcherbak's comments for a more compact alternative. – Jenszcz May 02 '16 at 07:42

1 Answers1

0

Thanks to Jenszcz answer and Alexey Scherbaks comments I've discovered a whole new world of msbuild condition statements. Edited the csproj file to add conditions to all the EmbeddedResources

<ItemGroup>
    <EmbeddedResource Include="Localisation\Resources.en-GB.resx" />
    <EmbeddedResource Condition=" '$(Configuration)' == 'Debug' OR '$(Configuration)' == 'Germany' " Include="Localisation\Resources.de-DE.resx" />
    <EmbeddedResource Condition=" '$(Configuration)' == 'Debug' OR '$(Configuration)' == 'Russia' " Include="Localisation\Resources.ru-RU.resx" />
</ItemGroup>
dibs487
  • 1,294
  • 4
  • 21
  • 36