views:

371

answers:

1

I've created a control in blend (xaml and code behind), saved it, and rebuilt the entire project. Now, not only does this new control not appear in the Assets tab in blend, none of the other user controls i've created appear either. I've rebuilt several times, blown away the obj and bin directories and rebuilt again, to no avail. How do I get my user controls to appear in the Assets pane so I can use them in my project?

thanks, brian

Blend: 3.0.1927.0

VS: 9.0.30729.4108 QFE

.NET: 3.5 SP1

+1  A: 

Sweeney,

I don't have the specifics of your install environment or applications installed, but using what I have, I can create a custom user control in blend and compile, pull it from my assets library, and put it on my page. Here are my specs, maybe you can check to see if you're running a different version or such:

  • Microsoft Expression Blend 2 Service Pack 1 - Version 2.1.1760.0
  • Microsoft Visual Studio 2008 - Version 9.0.30729.1 SP
  • Microsoft .NET Framework - Version 3.5 SP1

Here is what I did to create my custom control:

  1. Open Blend.
  2. Create new project (File > New Project..., Then named my Silverlight 2 Application, and clicked OK.)
  3. Create new UserControl (File > New Item..., Then named my UserControl, and clicked OK.)
  4. Create something like a colored background and text so that the control can be seen.
  5. Build the application.
  6. Add my custom control to the Page.xaml file from the Asset Library. (This may be where you got tripped up, please see below).
  7. Size my new control.

Final product:


Screen Shot


Accessing Custom Controls in Asset Library

  1. Click the Asset Library icon (left side by default):
    Asset Library
  2. Click the Custom Controls tab (top of Asset Library window):
    Custom Controls
  3. Select your custom control:
    Custom Control
  4. Place them on your page to your hearts content.


I hope this helps you,

Thanks!

Scott
Nice walk-through, thanks! Unfortunately that's pretty much just what I've done. The problem is very difficult to reproduce and repeated attempts to build the project seem to fix it. We seem to have slightly different versions of Blend - maybe mine has a bug in it?
sweeney
If you'd like, you can send me a copy of your code to try on my system, and possibly diagnose further. I can put up an SVN copy of this so that you can download and try on your system, or make a repository that you can commit your code. Maybe it is a version issue, that we can figure out and send off to M$. Have you tried to repair the install of visual studio / blend in the add/remove programs dialog? Thanks!
Scott