none
error in FilterControl: the data contract type "lightswitchfilter.Client.FilterControls.Clause" cannot be serialized because the member "_clauseType" is not public.

All replies

  • Is that my sample from: Using The LightSwitch Filter Extension ?

    If so, does it give you an error by just running it? I just did a test on a new computer and downloaded the filter extension from:

    http://code.msdn.microsoft.com/Filter-Control-for-Visual-90fb8e93

    I notice that it does not have the Save report feature like your screen shot. Perhaps it was updated since you last downloaded it?

     


    Make Them Ask: That's a LightSwitch App?

    http://LightSwitchHelpWebsite.com


    Saturday, October 15, 2011 5:35 AM
  • Hello, It is indeed the extension downloaded from http://code.msdn.microsoft.com/Filter-Control-for-Visual-90fb8e93

    I tested again on a new computer last week so the version is the same

    In order to see the save button, you should check the "Display report save options" (see below)

    is the same. Thanks in advance

    jan

    Tuesday, October 18, 2011 9:02 AM
  • Same error for me. Filtering works fine but when I click the [Save...] button I get the '_clauseType' is not public message.

    Interestingly enough the feature works OK even after the error mesage!!! If I select from the drop-down of 'Existing Reports' my newly created filter is returned and it works as expected :-)

     

    Is it just me or is the term 'Report' in this context confusing? Why not Save 'Filter' and select an 'Existing Filter'?

     

    BTW I'm running against a single SQL table filtered down to just active records on local named instance of SQLEXPRESS using SQL authentication.

     

    BTW nice job on the Custom Filter. Much appreciated.


    Z A R D O Z
    Monday, October 31, 2011 2:41 AM
  • You should open the solution of the filter control wich came with the download.

    • Open the following file: LightSwitchFilter.Client=>LightSwitchFilterControls=>Clause.vb.
    • Search for the member _clauseType (line 47 in my case). The problem is the line above where the datamember attribute is declared. This attribute needs to be declared before the public property ClauseType and is not needed for the private member _clauseType.
    • Cut the line (46 in my case) and paste it before the public property.
    • Build the solution (release configuration in my case)
    • Grab the .vsix from the output directory of the LightSwitchFilter.Vsix project and save it somewhere convenient.
    • Uninstall the filter control and restart visual studio.
    • Run the new .vsix file

    Everything should be working ok now.

    • Proposed as answer by Dytiscus_ Thursday, November 24, 2011 8:21 AM
    Wednesday, November 23, 2011 1:18 PM
  • That error is the same one I reported a few weeks back (ZARDOZ below). I wasn't even the first to report the error so it does seem to be a bug. My version was the latest and it occurs when to try to save a report. Another quirk I've noticed is that sometimes the Save Report line completely disappears (as in the screen shot). I haven't figured out a consistent pattern but these two bugs mean that the control could not, in it's current form, be included in an application release. The ugly error message for one but because it's flakey too.

    I'd really appreciate a bug-fix or a suggestion on what might be causing the random behvour because it's a control that I really love and want to use.


    Z A R D O Z
    Wednesday, November 23, 2011 9:14 PM
  • You should open the solution of the filter control wich came with the download.

    • Open the following file: LightSwitchFilter.Client=>LightSwitchFilterControls=>Clause.vb.
    • Search for the member _clauseType (line 47 in my case). The problem is the line above where the datamember attribute is declared. This attribute needs to be declared before the public property ClauseType and is not needed for the private member _clauseType.
    • Cut the line (46 in my case) and paste it before the public property.
    • Build the solution (release configuration in my case)
    • Grab the .vsix from the output directory of the LightSwitchFilter.Vsix project and save it somewhere convenient.
    • Uninstall the filter control and restart visual studio.
    • Run the new .vsix file

    Everything should be working ok now.


    Brilliant. Thank you very much. By following your steps above I fixed the bug and the 'Report' now saves without the ugly error message. Well done. Maybe this will also fix the random loss of that whole Report List line from the control. Time will tell.

    I'm still not quite sure why you call a 'Filter' a 'Report' though. When I've written the logic for a user Custom Filter I would say 'Save Filter Group' or 'Save Custom Filter'. A 'Report' here in NZ (and Australia too because I mentioned this to Andrew Coates from MS-AUS last week) has a different meaning which is a formatted display capable of rendering on a printer. IOW more than just a filtered grid. Perhaps someone could explain why the label is 'Existing Report' and you Save a 'Report Name'. Great if you could save the Filter and use it to run a custom report but that's not what's happening here IMO.


    Z A R D O Z
    Wednesday, November 23, 2011 9:50 PM
  • I have downloaded the latest version dated 2/23/2012 and I am still getting the same error.

    Even when I deselect the 'show save' option it still shows up.

    There appears to be an issue with the resource file as it displays as $(ShowSaveOptionsDisplayName) in the properties.

    yes it does save the query but only 1 query gets saved should it be able to save more than 1, the dropdownlist implies this.

    Friday, February 24, 2012 6:24 PM
    • Run the new .vsix file

    Everything should be working ok now.

     Any chance you can share your working version?
    Friday, February 24, 2012 6:34 PM
  • The version dated 2/28/2012 has the same problem, both with the option not working and with saving the report.

    Monday, March 12, 2012 9:03 PM
  • Hi!

    I hace some problem, what's exactly i need to change?

    #Region
    "Shared Properties"
    'Potentially null for first item in tree
        <DataMember()> _
    Public Property Parent As Clause
        <DataMember()> _
    Private _clauseType As String

    Anythung here?

    Tuesday, July 03, 2012 10:04 PM
  • Just replace last line with:

    Public _clauseType As String
        Public Property ClauseType As String



    PBerumen


    • Edited by PBerumen Friday, September 07, 2012 3:03 PM
    Friday, September 07, 2012 3:02 PM
  • Hitting this with the VS2012 version of the vsix - so AFAICT it seems like ideally someone on the LightSwitch team (or at least someone with access to update the vsix in the gallery) can make the change, rebuild, and re-upload it?
    Friday, July 19, 2013 8:50 PM