4
votes

I recently added a control library project to my Silverlight app's solution, so the solution now has three projects:

  • SLClient
  • SLClient.Controls
  • SLClient.Web

SLClient has a project reference to SLClient.Controls, which contains the following:

  • Themes
    • Generic.xaml (contains default CustomTextBox template)
    • Templates.xaml (contains additional template used by CustomTextBox)
  • CustomTextBox.cs (Descended from System.Windows.Controls.Control)

The xaml files above have Build Action of "Resource" and an empty Custom Tool property. Everything builds fine, but when the XAML files (a view, and my App.xaml that merges in SLClient.Controls's Templates.xaml) in SLClient that reference SLClient.Controls are open, Visual Studio tells shows an error in the "xmlns:SLClient_Controls="clr-namespace:SLClient.Controls;assembly=SLClient.Controls" line:

Assembly "SLClient.Controls" was not found. Verify that you are not missing an assembly reference [...]

Update: The page not loading, which I had previously mentioned, was caused by a different error in my XAML. I still get this error though, and would still like to know what's causing it. Is it a bug in the XAML compiler? The code generated from the XAML compiles fine.

2

2 Answers

1
votes

If you have added references in SLClient.Controls's project , then currently those assemblies are not automatically referenced in SLClient as expected as they do in normal .NET 2.0 projects.

So please verify that all the references in SLClient.Control's project are also manually added in SLClient project as well. For example if you add System.Windows.Toolkit reference in SLClient.Control, then you will also have to add the same reference in SLClient.

This is known bug and I have already reported this bug to Microsoft. And its still under processing.

0
votes

sounds like a hokey reference. Try this:

  • Delete the reference in the project and the xmlns ref in the XAML.
  • Clean and rebuild all the projects
  • Re-add the project reference.
  • Build
  • Re-add the XAML xmlns reference
  • Rebuild

HTH,
Mark