Visual studio by default copies all dlls' to each project's bin folder. This also includes system dlls' (with the exception of mscorlib.dll and System.dll), such as System.Xml.Linq, System.ComponentModel.Composition (included since SL4) etc.
Since these files are included in each XAP, XAP sizes grow considerably. In my limited testing, setting "Copy local" to false doesn't seem to break anything. Why does Visual Studio add these files to the bin path? Since a user would already have Silverlight, can I assume that these assemblies are already installed in the GAC of each user or am I missing something?
The Copy Local property (corresponding to CopyLocal) determines whether a reference is copied to the local bin path. At run time, a reference must be located in either the Global Assembly Cache (GAC) or the output path of the project.
The use of DLLs helps promote modularization of code, code reuse, efficient memory usage, and reduced disk space. So, the operating system and the programs load faster, run faster, and take less disk space on the computer.
A Dynamic Link library (DLL) is a library that contains functions and codes that can be used by more than one program at a time. Once we have created a DLL file, we can use it in many applications.
The files you mention are not included in the runtime install of Silverlight. A Silverlight application that uses these libraries must supply them to the user as part of the download.
You can minimise some of the impact by setting the "Reduce XAP size by using library caching" option in the Silverlight tab of the project properties pages.
This option causes each of these files to be placed in separate Zip files that will be placed in the same folder as the XAP.
This helps in the scenarios where your site may have multiple Xaps for various applications or where you release new versions frequently. For a single app that changes rarely or is hit by many unique visitors its not so helpful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With