Building Silverlight applications: remove unused cultures

Author: Sergey Sorokin

Published: 2010-12-07 13:46:00

Last update: 2013-10-21 09:51:39

Tags: silverlight

Slug: Building-Silverlight-applications-remove-unused-cultures

When building Silverlight projects, msbuild puts a lot of internationalized resource content to the intermediate folder (obj) and output folder (ClientBin or bin): look at all those ar, bg, ca folders. In 99% of cases, these files are just waste of build time and disk space. In 1% of cases - when you are building an application that actually supports all those cultures - those files will end up in your XAPs and your app will use them.

It's always a good idea to have a good internationalization plan and explicitly support only a number of cultures. An additional reason to do that is saving build time and disk space by eliminated unnecessary culture files. You can remove unused cultures from "Program Files\Microsoft SDKs\Silverlight\v4.0\Libraries\Client\" (or better move them to "UnusedCultures" folder). This will save you a lot of space on the build machine and improve your building time.

Three things to keep in mind:

1. Do not forget to put correspondent cultures back when you add a new supported culture to your project.

2. Do not forget to re-arrange your culture libraries after every Silverlight SDK refresh.

3. I doubt this approach is recommended by Microsoft, so use it at your own risk :)