views:

556

answers:

3

When you build a silverlight application, it always outputs a whole bunch of localization resource dlls into \bin\de\ \bin\es\ \bin\fr\ etc (which can end up packaged in the .xap). This is wonderful but I'm not using these, they aren't required for the app to operate and they are cluttering up the root of our TFS build server.

I realise there's a little bug with TFS 2K8 which is easily fixable to ensure these files don't get dumped in the build server's root, however what I would ideally like is to PREVENT these files from ever being generated.

I've tried everything under the sun to stop these files from being created. Because they don't actually exist until build time, I can't tell them to not output.

I've found tons of information on localization / globalization, how these files work and lots of ways to manipulate them, but nothing on preventing them building in the first place.

Does anyone know of a way that I can stop these from appearing in \bin\ on build ? Is there an switch I can use in the build options or something similar?

Edit. I want a way to PREVENT this happening. It can be cleaned up with post-build events but that is far from ideal.

A: 

How about using a post build step to clean up what you don't need? To do that: right click the project -> Properties -> Build Events Than in the post build you can use the standard windows command line commands.

Ohad Horesh
Hi, I can do it with a post build action but I really would prefer for it to not happen at all, if possible.
pezi_pink_squirrel
A: 

In the Post-built event :

rmdir /Q /S $(TargetDir)de
rmdir /Q /S $(TargetDir)fr
rmdir /Q /S $(TargetDir)it
rmdir /Q /S $(TargetDir)ja
rmdir /Q /S $(TargetDir)ko
rmdir /Q /S $(TargetDir)zh-Hans
rmdir /Q /S $(TargetDir)zh-Hant
rmdir /Q /S $(TargetDir)es
tucod
Hi, like I replied to the other answer, yes I can do this with post events, the question was about PREVENTING the files being created in the first place, cleaning up afterward is not an ideal solution.
pezi_pink_squirrel
A: 

If you look in those folders after you build your project you will see a bunch of dlls and/or resource files in them. The dlls/resources you see in the folder are what are causing the folders themselves to be generated. Since you are referencing these dlls in your project, when you build the project the reference grabs those files from the SDK folder (or wherever they are referenced from).

So, as an example, if you look at the System.Windows.Controls.dll which will be installed in the %ProgramFiles%\MicrosoftSDKs\Silverlight\v3.0\Libraries\Client folder. In that folder you will see the same folders that get generated when you build (de,fr,it,etc). So to keep those from being generated you can do a couple of things.

1) Copy the dll to a seperate folder and reference that file. I had to actually remove the dll from the sdk folder for the reference to work in VS 2010, not sure if just the reference will be fixed in 2008.

2) Rename or remove the global folders and files from the SDK itself. This would affect all the projects, not just your single project, but it may solve the issue for you.

Good luck!

Bryant