Assembly reference in Silverlight class library and used only in xaml is not packaged in XAP

Posted by Brandon Copeland on Stack Overflow See other posts from Stack Overflow or by Brandon Copeland
Published on 2010-06-17T20:55:54Z Indexed on 2010/06/18 0:23 UTC
Read the original article Hit count: 499

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?

© Stack Overflow or respective owner

Related posts about visual-studio

Related posts about Silverlight