Here is a list of my references in my silverlight project.
Microsoft.Practices.Unity.Silverlight<br/>
mscorelib<br/>
Prospector.ProviderMatching.LinkedDataObjects<br/>
Prospector.ProviderMatching.SLDataObjects<br/>
System<br/>
System.ComponentModel.DataAnnotations<br/>
System.Core<br/>
System.Net<br/>
System.ServiceModel<br/>
System.Windows<br/>
System.Windows.Browser<br/>
System.Windows.Controls<br/>
System.Windows.Controls.Data.Input<br/>
System.Windows.Controls.Toolkit<br/>
System.Windows.Data<br/>
System.Xml<br/>
When I build the project localy the contence of my xap file looks like the following.
AppManifest.xaml
Microsoft.Practices.Unity.Silverlight.dll
Prospector.ProviderMatching.DataObjects.SL.dll
Prospector.ProviderMatching.Silverlight.dll
Prospector.ProviderMatching.SLDataObjects.dll
ServiceReferences.ClientConfig
System.ComponentModel.DataAnnotations.dll
System.Windows.Controls.Data.dll
System.Windows.Controls.Data.Input.dll
System.Windows.Controls.dll
System.Windows.Controls.Toolkit.dll
System.Windows.Controls.Toolkit.Internals.dll
System.Windows.Data.dll
When this is checked in and the build server kicks off it creates a xap file with the following contence.
AppManifest.xaml
Microsoft.Practices.ServiceLocation.dll
Microsoft.Practices.Unity.Silverlight.dll
Prospector.ProviderMatching.DataObjects.SL.dll
Prospector.ProviderMatching.Silverlight.dll
Prospector.ProviderMatching.SLDataObjects.dll
ServiceReferences.ClientConfig
System.ComponentModel.DataAnnotations.dll
System.Windows.Controls.Data.dll
System.Windows.Controls.Data.Input.dll
System.Windows.Controls.dll
System.Windows.Controls.Toolkit.dll
System.Windows.Controls.Toolkit.Internals.dll
System.Windows.Data.dll
As you can see I have gained a code block in the xap file that the application does not use. However not only is this a waste of bandwidth, it actually prevents the silverlight app from doing anything, it is downloaded but does not run.
If I remove the offending Microsoft.Practices.ServiceLocator.dll from the xap file and the manifest.xml the silvlight app then functions as intended.
Has anyone got any ideas why the build server is including this library and how to prevent it from doing so…?
I think Microsoft.Practices.ServiceLocation.dll keeps getting added as you have a reference to Microsoft.Practices.Unity.Silverlight.dll I have a feeling that they are dependent on each other. Do you need to use Unity? As to why your app fails when Microsoft.Practices.ServiceLocation.dll is included in the XAP; I have a suspicion that you may be using the wrong version of the Microsoft.Practices.Servicelocation.dll (WPF version?)