Hi,
I'm using Silverlight 4, with the latest Silverlight Telerik library.
When I try to add RadCharts to a UserControl in Visual Studio I get the following error:
[Line: 0 Position: 0]
"Method not found: 'System.Delegate System.Reflection.MethodInfo.CreateDelegate(System.Type, System.Object)'."
I can successfully add them in Blend.
If I add one in Blend, and then view the UserControl in Visual Studio everything is fine. But if I add more than one to the UserControl and try to view it in Visual Studio I get the this error when I open the xaml file:
MissingMethodException was thrown on "RadChart": [Line: 0 Position: 0]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.Charting.DataBindingHelper.CreateExpressionGetter(Type itemType, String propertyName) in c:\Builds\135\WPF_Scrum\Release_SL\Sources\Development\Controls\Charting\Chart\Data\DataBindingHelper.cs:line 716 at Telerik.Windows.Controls.Charting.DataBindingHelper.RecreateExpressionGetters(IEnumerable`1 descriptors) in c:\Builds\135\WPF_Scrum\Release_SL\Sources\Development\Controls\Charting\Chart\Data\DataBindingHelper.cs:line 645 at Telerik.Windows.Controls.Charting.DataBindingHelper.GenerateDataSeries(Object originalData, SeriesMappingCollection seriesMappings, ISeriesDefinition defaultSeriesDefinition, ChartFilterDescriptorCollection globalFilterDescriptors, ChartSortDescriptorCollection globalSortDescriptors, SamplingSettings samplingSettings, ZoomScrollSettings zoomScrollSettings, AxisRangeState axisXRangeState) in c:\Builds\135\WPF_Scrum\Release_SL\Sources\Development\Controls\Charting\Chart\Data\DataBindingHelper.cs:line 64 at Telerik.Windows.Controls.RadChart.GenerateDataSeries(Object originalData, SeriesMappingCollection seriesMappings, ChartArea chartArea) in c:\Builds\135\WPF_Scrum\Release_SL\Sources\Development\Controls\Charting\Chart\RadChart.cs:line 1335 at Telerik.Windows.Controls.RadChart.GenerateDataSeries(Object originalData) in c:\Builds\135\WPF_Scrum\Release_SL\Sources\Development\Controls\Charting\Chart\RadChart.cs:line 1305 at Telerik.Windows.Controls.RadChart.Rebind(Object originalData) in c:\Builds\135\WPF_Scrum\Release_SL\Sources\Development\Controls\Charting\Chart\RadChart.cs:line 918 at Telerik.Windows.Controls.RadChart.ItemsSourcePropertyChanged(DependencyObject target, DependencyPropertyChangedEventArgs args) in c:\Builds\135\WPF_Scrum\Release_SL\Sources\Development\Controls\Charting\Chart\RadChart.cs:line 1030 at Telerik.Windows.PropertyMetadata.PropertyChangeHook.OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) in c:\Builds\135\WPF_Scrum\Release_SL\Sources\Development\Core\Controls\Common\System.Windows\PropertyMetadata.cs:line 262 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.RadChart.set_ItemsSource(Object value) in c:\Builds\135\WPF_Scrum\Release_SL\Sources\Development\Controls\Charting\Chart\RadChart.cs:line 499 at Telerik.Windows.Controls.RadChart.InitializeDesignTimeData() in c:\Builds\135\WPF_Scrum\Release_SL\Sources\Development\Controls\Charting\Chart\RadChart.cs:line 1409 at Telerik.Windows.Controls.RadChart.OnApplyTemplate() in c:\Builds\135\WPF_Scrum\Release_SL\Sources\Development\Controls\Charting\Chart\RadChart.cs:line 807 at System.Windows.FrameworkElement.OnApplyTemplate(IntPtr nativeTarget)
Am I doing something wrong? I don't remember this happening before.
18 Answers, 1 is accepted
Have you installed Silverlight 5 recently? We were able to reproduce similar problematic design-time behavior in our local tests, however, we believe it is related to the Microsoft Silverlight 5 framework itself as reported here and here.
Unfortunately, for the time being we cannot suggest you a viable workaround though you can try the somewhat weird solution suggested on the Microsoft site to install Visual Studio 11 developer preview side-by-side in order to resolve the issue in Visual Studio 2010.
Regards,
Giuseppe
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
http://msdn.microsoft.com/en-us/library/system.reflection.methodinfo_methods%28v=VS.110%29.aspx Have a look for details.
On When you switch
I Think some silvelight controls such as RadChart need MVVM (Model View View Model) structure. I appriciate it's very well, but manageing Microsofts future plan is hard. I have also other problems on silverlight versions. When I install SL 5 some silverlight features fixed well ok.
But when I turn back to 4.0 Teleriks component works fine!
Now I decided to choose Telerik! And I'm removing 5 and installing 4 again. I spent 2 days just for this uncompatibility. Install silverlight, developer ,tools and toolkit uff! When I was a java developer everything was better! Microsoft must solve these compatibility problems. But without SP1..N :)
Here is my previos post,
http://www.telerik.com/community/forums/silverlight/general-discussions/data-binding-problems-after-updating-to-blend-4-1-10819-0-sl-5-preview.aspx
Good Coding Brother!
Sincerely,
There must be some changes for CreateDelegate method then catastrophe!
System.Windows.Controls.ItemsControl.NotifyAllItemsAdded(IntPtr nativeItemsControl)-> at Telerik.Windows.Controls.RadComboBox.OnItemsChanged-->Telerik.Windows.Controls.BindingExpressionHelper-->at at System.Linq.Expressions.Compiler.LambdaCompiler.CreateDelegate()-->
And Finally -->System.Delegate System.Reflection.MethodInfo.CreateDelegate(System.Type, System.Object)
Here is the stackTrace
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)
I guess meanwhile I'll modify that xaml file in Blend.
The changes that cause the exception are caused by Silverlight 5 framework itself and as far as we know the problem is reproducible on x64 machines only. Microsoft is aware of the issue and we hope new Silverlight Tools version will become available to fix this design-time issue.
Kind regards,
Giuseppe
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Thanks,
As far as we are aware there is no fix from Microsoft on that matter. The only solution that currently works is to install VS 11 Dev Preview (or VS 11 Beta) as the problem is actually related to a number of undisclosed places where Silverlight 5 internally calls upon .NET 4.5 methods that do not exist in .NET 4.0 (and VS 11 installs .NET 4.5).
Greetings,
Giuseppe
the Telerik team
This isn't very encouraging. I can't say I'm keen on installing beta software on my development machine. I have VS11 beta on another machine, but that's only for testing and experimenting purposes.
What's even worse is that your own stuff now requires SL5, so I can't even look at your demos as I don't have the SL5 run time installed.
However, I'm a bit confused about your reply. If SL5 makes calls to .NET4.5, then that means that it must install .NET4.5 when you install SL5. I don't remember seeing .NET4.5 on my machine when Sl5 was installed. Also, the SL5 download was pretty small if it included a new version of .NET. I don't understand how this can be the problem. If it is, won't installing .NET4.5 on its own sort it out? Why would I need the whole of the VS11 beta?
Thanks again
Silverlight 5 itself (being technology for the Web) does no calls to the full .NET framework but its design-time support (as the one in WPF) does. Also, Silverlight 5 does not install .NET 4.5 and it should not install it -- the problem here is that some Microsoft design-time method calls erroneously rely on .NET 4.5 implementation and resolve properly only when .NET 4.5 is installed (crashing with MissingMethodException on earlier versions of .NET).
And yes -- you are correct that installing .NET4.5 Beta only is enough to solve the design-time problem, sorry for not explicitly stating this in our previous reply. You can find the download here.
Kind regards,
Giuseppe
the Telerik team
Thanks for the clarification. Maybe I'll just install .NET4.5 and see how I go
I spent some time researching this last week, and decided against it. One of the main reasons was because 4.5 is not a side-by-side installation, it actually overwrites your installation of .NET 4.0, so you run the risks of existing code breaking. It's hard to tell how widespread the issues are, but there were reports of people having problems.
I can't risk the amount of time it's likely to take to fix my machine, so I'm holding off. I've wasted enough time with this already. Maybe when 4.5 goes into RTM, I'll install it and try SL5 again.
I can confirm that installing .NET45 fixed the issue in my project. As for old 4.0 projects -- they will still be compiled against .NET4 framework so they should work as they used to.
Greetings,
Bart.
Just as a point of interest, if you have .NET 4.5 installed on your machine, then your old projects will be compiled against this, and not .NET 4.0. The reason for this is that 4.5 is not a side-by-side installation as previous versions were, it completely overwrites version 4.0.
This may not be an issue for you, but in some cases can cause serious problems. See this MSDN forum thread for more details.
Hope this helps