Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

d:DesignData issue, Visual Studio 2010 cant build after adding sample design data with Expression Blend 4

VS 2010 solution and Silverlight project builds fine, then:

  1. I open MyView.xaml view in Expression Blend 4
  2. Add sample data from class (I use my class defined in the same project)

after I add new sample design data with Expression blend 4, everything looks fine, you see the added sample data in the EB 4 fine, you also see the data in VS 2010 designer too.

Close the EB 4, and next VS 2010 build is giving me this errors:

 Error 7 XAML Namespace http://schemas.microsoft.com/expression/blend/2008 is not resolved. C:\Code\source\...myview.xaml

and:

Error 12 Object reference not set to an instance of an object. ... TestSampleData.xaml

when I open the TestSampleData.xaml I see that namespace for my class used to define sample data is not recognized.

However this namespace and the class itself exist in the same project!

If I remove the design data from the MyView.xaml:

d:DataContext="{d:DesignData /SampleData/TestSampleData.xaml}"

it builds fine and the namespace in TestSampleData.xaml is recognized this time?? and then if add:

d:DataContext="{d:DesignData /SampleData/TestSampleData.xaml}" 

I again see in the VS 2010 designer sample data, but the next build fails and again I see studio cant find the namespace in my TestSampleData.xaml containing sample data.

That cycle is driving me crazy. Am I missing something here, is it not possible to have your class defining sample design data in the same project you have the MyView.xaml view??

cheers Valko

like image 348
Valko Avatar asked May 21 '10 18:05

Valko


1 Answers

I know this is and old question, but do you have the line mc:Ignorable="d" in your xaml? Without this line you will get this error.

like image 100
Justin Avatar answered Oct 23 '22 04:10

Justin