locked
Blend crashes when accessing Asset library RRS feed

  • Question

  • Hi,

    i developped a silverlight 3 application in Visual Studio 2008 and Expression Blend 3. Some weeks ago I ported the app to silverlight 4 and upgraded my tools to Expression Blend 4 and Visual Studio 2010.

    All works fine in Visual Studio. I can select my custom controls (which are defined in the application, it's not a foreign assembly) from the toolbox and place them in the designer. But if I do this in Expression Blend 4 by using the asset library, Expression Blend crashes without an error message on opening the asset library. The same when I write a "<" in the xaml code (normally Expression Blend should show the Intellisense).

    With the help of Process Monitor I discovered that Blend is crashing because it doesn't find the assembly of my silverlight app at C:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0. Why does Blend search there? When I copy the assembly to that location all works fine. But that can't be the solution?!

    Thanks for any hints and suggestions!
    Levi

    Saturday, April 9, 2011 9:36 AM

Answers

  • This looks like a bug. In general, Blend 4 tries to instantiate much more from your project to have a better design time editing experience. Sometimes this can break. It shouldn't ever crash Blend however, it should result in an exception on the artboard at worst if the types can't be created due to something happening in the constructor or elsewhere.

    I'll be sure we have a bug report internally for this issue, thanks much for reporting it.

    • Marked as answer by Levis1984 Thursday, April 14, 2011 4:15 PM
    Wednesday, April 13, 2011 5:58 PM
    Moderator

All replies

  • Have you built the project in Blend before trying to instantiate it?

    Which version are you using? RTM or SP1?

    Monday, April 11, 2011 1:49 PM
    Moderator
  • Yes, I built it in Visual Studio and in Blend, too. No success.

    I use Blend SP1.

    Tuesday, April 12, 2011 10:40 PM
  • Would you be able to share the project so I can investigate? If possible send the project to me at first.last@microsoft.com using my name.

    Please run the clean command on your solution before zipping it, otherwise it may get rejected by email filters.

    Wednesday, April 13, 2011 2:04 PM
    Moderator
  • Hi Chuck,

    thanks for your offer! But I can't send the code...

    But good news: I found the error. In a Page I defined an ObservableCollection<MyObject>[] as DependencyProperty:

    public ObservableCollection<MyObject>[] OfficeHoursViewModelCollection
    {
      get { return (ObservableCollection<MyObject>[])GetValue(OfficeHoursViewModelCollectionProperty); }
      set { SetValue(OfficeHoursViewModelCollectionProperty, value); }
    }
    public static readonly DependencyProperty OfficeHoursViewModelCollectionProperty =
      DependencyProperty.Register("OfficeHoursViewModelCollection", typeof(ObservableCollection<MyObject>[]), typeof(InstallationHolidayOfficeHours),
      new PropertyMetadata(new ObservableCollection<MyObject>[7]));
    

    This is the problem for Blend 4 (Blend 3 didn't crash). By deleting this property, Blend 4 doesn't crash any more.

    Do you have an explanation for that behavior? Blend bug?

    Thanks for your help
    Levis

    Wednesday, April 13, 2011 5:33 PM
  • This looks like a bug. In general, Blend 4 tries to instantiate much more from your project to have a better design time editing experience. Sometimes this can break. It shouldn't ever crash Blend however, it should result in an exception on the artboard at worst if the types can't be created due to something happening in the constructor or elsewhere.

    I'll be sure we have a bug report internally for this issue, thanks much for reporting it.

    • Marked as answer by Levis1984 Thursday, April 14, 2011 4:15 PM
    Wednesday, April 13, 2011 5:58 PM
    Moderator
  • I had the same problem. I had a solution for it. It's working fine. But I don't know it is eligible to use. Delete files inside bin folder. (Debug and Release). Then Run the project using Expression Blend. Then build the project. This might work. Thank you.
    Saturday, September 24, 2011 2:00 PM
  • I have the same issue. Cleaning up bin folder in each project didnot work for me. Is there any workaround for this?

    Monday, February 20, 2012 8:08 AM
  • Hi Benedictus.

    Are you by chance creating a Silverlight application?

    I recently had a similar issue after I had downloaded the Silverlight 5 preview tools.  My ultimate problem ended up being related to the Silverlight SDK.  I had to uninstall and reinstall it several times to finally clear up the mess.

    You could also try to delete the bin folder all together, clean the project and then rebuild.

    I hope you get it worked out.

    ~Christine

    Monday, February 20, 2012 4:48 PM