views:

124

answers:

1

I'm using MEF with my Silverlight 4 app to dynamically load xap files. To optimize this process, I've removed various assemblies from my xaps since I know they've already been loaded by the base xap. This reduces the size of my dynamically loaded xaps. I accomplished this by setting the "Copy Local" flag for each assembly reference to "false".

This all seems to work fine when I build in Visual Studio 2010 - my xaps are much smaller. However, when the same projects are built by the build server, all the excluded references are once again in the xap file hence tripling the size of the xap.

I've read several blogs/articles regarding similar experiences but no resolution. Very frustrating - any help is appreciated.

A: 

Xap files are just Zip files with a different extension. So if you can't figure out why the build server is including the assemblies you don't need, you could create a post-build step that treats the Xap as a Zip and removes those assemblies from it.

Daniel Plaisted
Hi Daniel - thank you for your suggestion. I thought about doing this but it seems like treating the symptom instead of curing the disease. Plus managing a post-build process for several xaps each of which may change dependent assemblies at any time seems like a last resort. The real question is why does msbuild ignore the projects "Copy Local" flag. There seems to be a real flaw in the build process.
arch