Assembly reference in Silverlight class library and used only in xaml is not packaged in XAP
- by Brandon Copeland
I have a 3rd party library (A). That library is referenced in my Silverlight class library (B). That Silverlight class library is referenced in my Silverlight application (C). The 3rd party library is not explicitly referenced in the Silverlight application.
It seems that "A" is added to my XAP if "A" is used in any class in "B" because of a chain in dependencies (C - B - A). This is the behavior I would expect and need.
If "A" is never explicitly used in a C# class but only defined in Xaml, the assembly is not packaged to the XAP. Maybe "A" includes a control that is only used declaratively and never referenced otherwise.
Is this behavior by design? Am I missing a property somewhere that controls this? I would prefer to not explicitly reference the third party library in my Silverlight application. What's to best practice to ensure all necessary assemblies are packaged in the XAP?