Error on creating sample data : Blend Preview for Silverlight 5

Dec 10, 2012 at 12:14 AM

Hi Tony,

I am using your latest version with VS2012 and Blend Preview for Silverlight 5.

When I tried creating a sample data source from a class in Blend, I get an error - 

"Could not load the assembly SimpleMvvmToolkit-SL5 because the following errors occured: GenericArguments[1], 'TModel', on 'SimpleMVVMToolkit.ViewModelDetailBaseCore`2 [TViewModel,TModel]' violates the constraint of type parameter 'TModel'.

Could you please let me know why this is happening?

Dec 14, 2012 at 1:01 PM

You can't use any old class for a ViewModel.  They need to derive from a base class in the toolkit, either ViewModelBase or ViewModelDetailBase.  To get such a class, all you have to do is right-click on the project in the Visual Studio solution explorer, then select Add New Item.  Then find the ViewModelDetail item under the Mvvm category for whatever type of project you are creating (Silverlight, WPF, etc).

Dec 14, 2012 at 2:48 PM

Hi Tony,

Apologies not not being clear. When I said I was trying to create a sample data source from a class in Blend, I meant I was trying to create it from a viewmodel.

But when I click on create sample data from existing object, it throws the error mentioned above. It doesn't even let me choose the viewmodel. If I cancel on the error, it displays other classes but none of the classes in my project.

I am not sure what is happening here. It was working fine with VS2010.

Dec 14, 2012 at 2:56 PM
Which version of Blend are you using? It sound like you're using v4 of the toolkit, which is compatible only with .NET 4.5 and VS 2012. This version uses Portable Class Libraries and generates two assemblies, one of which is .Common. It sounds like you may be missing the Common reference.
Dec 14, 2012 at 2:58 PM
Edited Dec 14, 2012 at 3:46 PM

I am using Blend Preview for Silverlight 5.

I am NOT using Blend that came with VS2012 as the documentation said that for Silverlight 5 projects, use Blend Preview for Silverlight 5.


I just figured out that there is another version of Blend released for VS2012 called Blend + SketchFlow for VS 2012. But this does not have production license. I might download this and give it a try. 

Dec 17, 2012 at 12:29 AM
Edited Dec 17, 2012 at 12:46 AM

OK, I tried out the Blend + Sketchflow for Visual Studio 2012 with my project and I can confirm that there was NO issue in creating sample data using my viewmodel class. (Does not have the Go Live License)

I cannot do this is Blend Preview for Silverlight 5. (Has the Go live License)

I guess I will have to use the 2012 just to create the sample data.

Tony, do you think you can work some magic here so that I can create sample data in the Blend Preview for Silverlight 5?


NB: I have the reference to the Common library - SimpleMvvmToolkit-Common (version

Dec 22, 2012 at 11:40 AM

As you can see, the Blend story from Microsoft is less than satisfying, because the current version compatible with VS 2012 is just a "Preview" and does not contain a go-live license.  If you don't want to use it, you have to use VS 2012 to create the sample data.