Problem in Silverlight Designer (client) constructor

Stimulsoft Reports.Silverlight discussion
LuisC.Costa
Posts: 13
Joined: Tue Nov 16, 2010 11:24 am

Problem in Silverlight Designer (client) constructor

Post by LuisC.Costa »

Hi,

I have been fighting with an error creating an instance of the Silverlight Designer (client only).
After several tests I have came up with what seams to be the reason for this.

It seams that the Designer (and maybe also the Viewer) manipulates the values on the System.IO.IsolatedStorage.IsolatedStorageSettings.ApplicationSettings dictionary in some way (probably trying to serialize them for some reason).
The problem occurs when the application using the designer has added to that dictionary some entries whose value Type is not Serializable.
In this case the constructor throws the error:

The invocation of the constructor on type 'Stimulsoft.Report.SLDesign.StiSLDesignerControl' that matches the specified binding constraints threw an exception.

Looking at the InnerException of this error, we can see this:

Type 'SilverlightApplication1.MainPage+NotSerializableExampleClass' cannot be serialized.

Any chance you can correct this behaviour?

Thank you very much in advance for your help.
Anton Lozovskiy
Posts: 135
Joined: Tue Aug 11, 2009 9:38 am

Problem in Silverlight Designer (client) constructor

Post by Anton Lozovskiy »

Hello,

We can not reproduce the problem. Please send us video which step-by-step demonstrates how the problem can be reproduced.

Thank you.
LuisC.Costa
Posts: 13
Joined: Tue Nov 16, 2010 11:24 am

Problem in Silverlight Designer (client) constructor

Post by LuisC.Costa »

Hi,

I was not able to attach a sample application (I get an IE error).
Anyway, the steps are really simple:
- Create a New Silverlight Application in VS 2010 (e.g. named SilverlightApplication1)
- Add a reference to the Assemblies Stimulsoft.Base.SL, Stimulsoft.Controls.SL Stimulsoft.Report.SL, Stimulsoft.Report.SLDesign on your SilverlightApplication1 project
- Modify the MainPage.xaml file so it looks something like this:

Code: Select all



    
        
    

- Modify the MainPage.xaml.cs file so it looks something like this:

Code: Select all

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Reflection;

namespace SilverlightApplication1
{
    public partial class MainPage : UserControl
    {
        private class NotSerializableExampleClass
        {
            public Assembly assembly;
            public String aString;
        }
    
        public MainPage()
        {
            System.IO.IsolatedStorage.IsolatedStorageSettings.ApplicationSettings["Dummy"] = new NotSerializableExampleClass();
           
            InitializeComponent();
        }
    }
}
- Compile and Run the application. When the InitializeComponent is called it throws the exception I have mentioned in the initial post.

Please let me know if you are able to reproduce it following these steps.

Best Regards,
Luis
Anton Lozovskiy
Posts: 135
Joined: Tue Aug 11, 2009 9:38 am

Problem in Silverlight Designer (client) constructor

Post by Anton Lozovskiy »

Hello,

The problem is fixed. The patch is available in prerelease build of on 23.11.2010.

Thank you.
LuisC.Costa
Posts: 13
Joined: Tue Nov 16, 2010 11:24 am

Problem in Silverlight Designer (client) constructor

Post by LuisC.Costa »

Hi,

Great to hear
I will try it out.

Must say I am impressed with your responde time.

Keep up the good work.

Best Regards
Anton Lozovskiy
Posts: 135
Joined: Tue Aug 11, 2009 9:38 am

Problem in Silverlight Designer (client) constructor

Post by Anton Lozovskiy »

Hello,

Let us know if you need any additional help.

Thank you.
LuisC.Costa
Posts: 13
Joined: Tue Nov 16, 2010 11:24 am

Problem in Silverlight Designer (client) constructor

Post by LuisC.Costa »

Hi,

Unfortunately due to Business priority changes, I was working on another project for the last few weeks, so only now I had the chance to come back to this issue and test it.

Therefore I am not sure if this was working before, but in the Pre-Release build of 2010-12-15, the problem has not gone away.
I get the same error as I had reported.

Can you please have a look again?

Note: The code sample I have posted before still applies for reproducing the error.

Thank you.

Best Regards
Andrew
Posts: 4108
Joined: Fri Jun 09, 2006 3:58 am

Problem in Silverlight Designer (client) constructor

Post by Andrew »

Hello,

We removed our changes that we have made according to this topic. The IsolatedStorageSettings class is used to store the serialized values which the browser can easily save for further use. If you want to store some specific data, you can create a normal static array.

Thank you.
LuisC.Costa
Posts: 13
Joined: Tue Nov 16, 2010 11:24 am

Problem in Silverlight Designer (client) constructor

Post by LuisC.Costa »

Hi,

I am not sure I understand what you mean. Are you suggesting that on my side I do not add the non Serializable objects?
If that is the case, unfortunately that is not something that can be easily done as it is part of the Framework that my application is built on top of.

Changing that is not under my direct control, would be a huge amount of changes and would have impact on other applications.
So, I am afraid that that would probably be a show stopper for selecting Stimulsoft Reports.Silverlight as the base for this module.

Is their no chance you can overcome this on your side?

Thank you.

Best Regards,
Luis
Andrew
Posts: 4108
Joined: Fri Jun 09, 2006 3:58 am

Problem in Silverlight Designer (client) constructor

Post by Andrew »

Hello,

Unfortunately, we cannot use anything else because we cannot save data as in .NET project. You need to make changes in you projects.

Thank you.
Locked