This is a migrated thread and some comments may be shown as answers.

Data binding problems after updating to Blend 4.1.10819.0 (SL 5 Preview)

3 Answers 123 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jeremy
Top achievements
Rank 1
Jeremy asked on 05 Oct 2011, 07:46 PM
I recently updated my copy of Blend to the latest Silverlight 5 preview and am now having "blendability" issues with RadChart data binding. I am running the latest version of Silverlight 5 RC and the Telerik SL controls.

This did not occur before I updated Blend. The project builds and runs fine in VS2010. This problem only occurs in Blend 4.1.10819.0.

The specific design-time error that I get is:

Method not found: 'System.Delegate System.Reflection.MethodInfo.CreateDelegate(System.Type, System.Object)'.
at System.Linq.Expressions.Compiler.LambdaCompiler.CreateDelegate()
at System.Linq.Expressions.Compiler.LambdaCompiler.Compile(LambdaExpression lambda, DebugInfoGenerator debugInfoGenerator)
at Telerik.Windows.Controls.Charting.DataBindingHelper.CreateExpressionGetter(Type itemType, String propertyName)
at Telerik.Windows.Controls.Charting.DataBindingHelper.RecreateExpressionGetters(IEnumberable`1 descriptors)
at Telerik.Windows.Controls.Charting.DataBindingHelper.GenerateDataSeries(Object originalData, SeriesMappingCollection seriesMappings, ISeriesDefinition defaultSeriesDefinition, ...)
at Telerik.Windows.Controls.RadChart.GenerateDataSeries(Object originalData, SeriesMappingCollection seriesMappings, ChartArea chartArea)
at Telerik.Windows.Controls.RadChart.GenerateDataSeries(Object originalData)
at Telerik.Windows.Controls.RadChart.Rebind(Object originalData)
at Telerik.Windows.Controls.RadChart.InternalRebind()
at Telerik.Windows.Controls.RadChart.OnApplyTemplate()
at System.Windows.FrameworkElement.OnApplyTemplate(IntPtr nativeTarget)

I thought perhaps it was my code that was causing the issue, so I created a new Telerik Silverlight RadControls project from VS and copied the PieChart code from the demo, which binds the chart to a view model. 

I suspected that the problem was due to MVVM-style data binding, so I initially set the data source declaratively in XAML. No problem. It built and ran fine in Blend. 

However, when I converted it to MVVM as in the demo, I get the exception. Any ideas what's going on? 

3 Answers, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 11 Oct 2011, 12:29 PM
Hello Jeremy,

We haven't faced such issue with our controls in Expression Blend up to now. However you may review this forum post where a discussion for similar issue has been started. It seems that this is a Framework problem that Microsoft should deal with.
However I sent your feedback to our developers for further investigation.

Kind regards,
Evgenia
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Davut
Top achievements
Rank 1
answered on 06 Jan 2012, 03:07 PM
Hi All,
Actuall I got this error, too.
Have a look this link It says This method

MethodInfo.CreateDelegate supported in Silverlight 5,also .Net Framework 4.5.

http://msdn.microsoft.com/en-us/library/hh194376%28v=VS.95%29.aspx
My Teory: Here is the stacktrace and I'm seeing Telerik namespaces, So maybe a Telerik component developer used this MethodInfo.CreateDelegate function and people getting this error who uses  below .net framework 4.5 or Silverlight 5.


StackTrace:

System.Reflection.TargetInvocationException
Exception has been thrown by the target of an invocation.
   at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

 
Microsoft.Windows.Design.Platform.InvalidDesignerUpdateException
An unhandled exception was encountered while trying to render the current silverlight project on the design surface. To diagnose this failure, please try to run the project in a regular browser using the silverlight developer runtime.
   at Microsoft.Windows.Design.Platform.SilverlightViewProducer.OnUnhandledException(Object sender, ViewUnhandledExceptionEventArgs e)
   at Microsoft.Windows.Design.Platform.SilverlightViewProducer.SilverlightContentHost.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Designer.ZoomableViewPresenter.DesignerBackground.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at Microsoft.Windows.Design.Interaction.DesignerView.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Designer.Viewport.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Interop.HwndSource.SetLayoutSize()
   at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
   at MS.Internal.DeferredHwndSource.ProcessQueue(Object sender, EventArgs e)

 
System.MissingMethodException
Method not found: 'System.Delegate System.Reflection.MethodInfo.CreateDelegate(System.Type, System.Object)'.
   at System.Dynamic.Utils.TypeExtensions.CreateDelegate(MethodInfo methodInfo, Type delegateType, Object target)
   at System.Linq.Expressions.Compiler.LambdaCompiler.CreateDelegate()
   at System.Linq.Expressions.Compiler.LambdaCompiler.Compile(LambdaExpression lambda, DebugInfoGenerator debugInfoGenerator)
   at Telerik.Windows.Controls.BindingExpressionHelper.CreateGetValueFunc(Type itemType, String propertyPath)
   at Telerik.Windows.Controls.TextSearch.GetPrimaryText(Object item, String primaryTextPath)
   at Telerik.Windows.Controls.RadComboBox.SelectedItemUpdated()
   at Telerik.Windows.Controls.RadComboBox.OnSelectionChanged(SelectionChangedEventArgs e)
   at Telerik.Windows.Controls.Selector.OnSelectionChanged(Object sender, SelectionChangedEventArgs e)
   at Telerik.Windows.Controls.Selector.SelectionChanger`1.InvokeSelectionChangedEvent()
   at Telerik.Windows.Controls.Selector.SelectionChanger`1.End()
   at Telerik.Windows.Controls.Selector.SelectionChanger`1.SelectJustThisItem(T item)
   at Telerik.Windows.Controls.Selector.OnSelectedIndexChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at Telerik.Windows.PropertyMetadata.<>c__DisplayClass1.<Create>b__0(DependencyObject d, DependencyPropertyChangedEventArgs e)

   at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
   at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
   at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isBindingInStyleSetter)
   at Telerik.Windows.Controls.Selector.OnItemsChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Controls.RadComboBox.OnItemsChanged(NotifyCollectionChangedEventArgs e)
   at System.Windows.Controls.ItemsControl.OnItemCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Windows.Controls.ItemCollection.NotifyCollectionChanged(NotifyCollectionChangedEventArgs e)
   at System.Windows.Controls.ItemCollection.NotifyCollectionReady()
   at System.Windows.Controls.ItemsControl.NotifyAllItemsAdded(IntPtr nativeItemsControl)

Some other links
https://connect.microsoft.com/VisualStudio/feedback/details/708140/silverlight-forum-mefedmvvm-design-time-feature-doesnt-work-in-silverlight-5

http://forums.silverlight.net/p/239857/616191.aspx/1?Re+I+am+using+MEFedMVVM+for+my+silverlight+project+but+the+design+time+features+don+t+work+correctly

http://www.telerik.com/community/forums/silverlight/general-discussions/data-binding-problems-after-updating-to-blend-4-1-10819-0-sl-5-preview.aspx
0
Davut
Top achievements
Rank 1
answered on 06 Jan 2012, 04:12 PM
Finally,
I removed installation of silverlight developer 5 from my pc. Then solved.
Maybe MethodInfo.CreateDelegate method which supported on just sl 5 & .net framework 4.5 has a bug in it.
Who knows?
Tags
General Discussions
Asked by
Jeremy
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Davut
Top achievements
Rank 1
Share this question
or