Adding RadChart in Visual Studio Designer

19 posts, 0 answers
  1. Ali Rafiee
    Ali Rafiee avatar
    23 posts
    Member since:
    May 2010

    Posted 09 Jan 2012 Link to this post

    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.

  2. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 12 Jan 2012 Link to this post

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

  3. DevCraft banner
  4. Ali Rafiee
    Ali Rafiee avatar
    23 posts
    Member since:
    May 2010

    Posted 12 Jan 2012 Link to this post

    That's I'll give that a try.
  5. Davut
    Davut avatar
    11 posts
    Member since:
    Jul 2011

    Posted 13 Jan 2012 Link to this post

    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,
  6. Davut
    Davut avatar
    11 posts
    Member since:
    Jul 2011

    Posted 13 Jan 2012 Link to this post

    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)
  7. Ali Rafiee
    Ali Rafiee avatar
    23 posts
    Member since:
    May 2010

    Posted 17 Jan 2012 Link to this post

    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.
  8. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 18 Jan 2012 Link to this post

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

  9. Peter
    Peter avatar
    22 posts
    Member since:
    Nov 2007

    Posted 02 Feb 2012 Link to this post

    I'm having the same issue.  Can anyone confirm that installing Visual Studio 11 Developer Preview corrects the issue? 

    Thanks,
  10. Scott
    Scott avatar
    13 posts
    Member since:
    Jul 2012

    Posted 05 Feb 2012 Link to this post

    I had the same issue and installing VS 11 Dev Preview did work for me.
  11. Avrohom Yisroel
    Avrohom Yisroel avatar
    35 posts
    Member since:
    Jan 2011

    Posted 27 Feb 2012 Link to this post

    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.
  12. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 01 Mar 2012 Link to this post

    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 >>
  13. Avrohom Yisroel
    Avrohom Yisroel avatar
    35 posts
    Member since:
    Jan 2011

    Posted 01 Mar 2012 Link to this post

    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
  14. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 01 Mar 2012 Link to this post

    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 >>
  15. Avrohom Yisroel
    Avrohom Yisroel avatar
    35 posts
    Member since:
    Jan 2011

    Posted 01 Mar 2012 Link to this post

    Hello,

    Thanks for the clarification. Maybe I'll just install .NET4.5 and see how I go
  16. Al
    Al avatar
    1 posts
    Member since:
    Sep 2011

    Posted 13 May 2012 Link to this post

    I am having the same issue. Did anyone find the resolution for this issue? Please help
  17. Avrohom Yisroel
    Avrohom Yisroel avatar
    35 posts
    Member since:
    Jan 2011

    Posted 13 May 2012 Link to this post

    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.
  18. Martin
    Martin avatar
    19 posts
    Member since:
    Feb 2012

    Posted 19 Sep 2012 Link to this post

    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.
  19. Bartholomeo Rocca
    Bartholomeo Rocca avatar
    247 posts
    Member since:
    May 2006

    Posted 24 Sep 2012 Link to this post

    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.
  20. Avrohom Yisroel
    Avrohom Yisroel avatar
    35 posts
    Member since:
    Jan 2011

    Posted 24 Sep 2012 Link to this post

    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
Back to Top
DevCraft banner