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

Adding RadChart in Visual Studio Designer

18 Answers 367 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Ali Rafiee
Top achievements
Rank 1
Ali Rafiee asked on 09 Jan 2012, 09:07 PM

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

Sort by
0
Giuseppe
Telerik team
answered on 12 Jan 2012, 12:50 PM
Hello Ali,

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 >>

0
Ali Rafiee
Top achievements
Rank 1
answered on 12 Jan 2012, 06:50 PM
That's I'll give that a try.
0
Davut
Top achievements
Rank 1
answered on 13 Jan 2012, 04:04 PM
I'm also following this issue because Telerik's Ribbon Components WYSWYG editors doesnt work even you handle DesignerProperties.IsInDesignTool . So I can't install Silverlight 5 developer .

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 There is a difference there is no such method System.Reflection.MethodInfo.CreateDelegate(System.Type, System.Object) defined on .Net Framework 4.0.
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,
0
Davut
Top achievements
Rank 1
answered on 13 Jan 2012, 04:18 PM
When you follow the stackTrace I see that problem cause is System.Linq.Expressions.Compiler.LambdaCompiler.CreateDelegate()
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)
0
Ali Rafiee
Top achievements
Rank 1
answered on 17 Jan 2012, 08:49 PM
I was hoping that uninstalling Silverlight 5 SDK would solve the issue but it didn't.
I guess meanwhile I'll modify that xaml file in Blend.
0
Giuseppe
Telerik team
answered on 18 Jan 2012, 09:34 AM
Hello Davut,

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 >>

0
Peter
Top achievements
Rank 2
answered on 02 Feb 2012, 03:08 PM
I'm having the same issue.  Can anyone confirm that installing Visual Studio 11 Developer Preview corrects the issue? 

Thanks,
0
Scott
Top achievements
Rank 1
answered on 05 Feb 2012, 06:04 PM
I had the same issue and installing VS 11 Dev Preview did work for me.
0
Avrohom Yisroel
Top achievements
Rank 1
answered on 27 Feb 2012, 11:58 PM
Does anyone know if this bug ever got fixed? I am not installing anything to do with Silverlight5 until I know it's been sorted. I lost two working days trying to sort it out and don't want to go through that again! The annoying thing is that my problems started when I installed the SL5 run time (for the browser, not the dev tools). Some sites, including Telerik's use SL5, so you can't see the online demos without it.
0
Giuseppe
Telerik team
answered on 01 Mar 2012, 01:23 PM
Hello Avrohom,

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
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Avrohom Yisroel
Top achievements
Rank 1
answered on 01 Mar 2012, 04:16 PM
Hello Giuseppe, thanks for the reply.

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
0
Giuseppe
Telerik team
answered on 01 Mar 2012, 05:01 PM
Hello Avrohom,

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
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Avrohom Yisroel
Top achievements
Rank 1
answered on 01 Mar 2012, 05:31 PM
Hello,

Thanks for the clarification. Maybe I'll just install .NET4.5 and see how I go
0
Al
Top achievements
Rank 1
answered on 13 May 2012, 08:40 PM
I am having the same issue. Did anyone find the resolution for this issue? Please help
0
Avrohom Yisroel
Top achievements
Rank 1
answered on 13 May 2012, 08:45 PM
As far as I know, the only resolution is to install .NET4.5, but you should be aware that it's in beta.

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.
0
Martin
Top achievements
Rank 1
answered on 19 Sep 2012, 09:47 PM
Can somebody confirm if installing .NET Framework 4.5 or VS2012 solves the issue??... also, does this affects the old 4.0 framework projects?? As far as I know, .NET Framework 4.5 installation overrides all .NET 4.0 assemblies.
0
Bartholomeo Rocca
Top achievements
Rank 1
answered on 24 Sep 2012, 08:01 AM
Hello Martin,

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.
0
Avrohom Yisroel
Top achievements
Rank 1
answered on 24 Sep 2012, 01:37 PM
Hello 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
Tags
Chart
Asked by
Ali Rafiee
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Ali Rafiee
Top achievements
Rank 1
Davut
Top achievements
Rank 1
Peter
Top achievements
Rank 2
Scott
Top achievements
Rank 1
Avrohom Yisroel
Top achievements
Rank 1
Al
Top achievements
Rank 1
Martin
Top achievements
Rank 1
Bartholomeo Rocca
Top achievements
Rank 1
Share this question
or