none
Class Library in Lightswitch

    Question

  • I am developing an application with Lightswitch.

    It is really nice to design screens and connect them with databases but at this point I have to send some messages to our RabbitMQ queue and for that I need to be able to add some C# Class Libraries (like protobuf, rabbitmq, log4net and so on) to create the subscriber and shared classes and objects.

    So far I understand that Lightswitch is based on Silverlight and it has only 20 percent of the actual .NET Framework and has other engine then CLR and limited capabilites.

    But I am really stuck here, I'd be appreciated for some ideas.

    Thanks.

    Thursday, August 23, 2012 8:50 PM

Answers

  • Just to add to what the other posters have said, you would probably want to invoke protobuf, rabbitmq, log4net and so on from the server anyway and not from the client. There are a number of extension points in the data saving pipeline that you can tap into (before/after type events) to make those calls.

    If you do need a scenario where the user needs to click a button in the Silverlight screen (for example) and have one of those invoked then you can implement a "command type" pattern to send the command from the client to the server and have it invoked from the server. There are lots of post on this forum about the command pattern (have a search).

    Hope that helps.


    Xander

    Friday, August 24, 2012 12:30 AM

All replies

  • Hi Stylus,

    In my case I use this...

    For the client access (can be referenced in Client project)

     - SilverLight Class Library

    For the client and server access (can be referenced in Client, Common and Server project)

     - Portable Class Library, for create this type of project you can download a add on here

    For the server access (can be referenced in Server project)

     - Class Library

    I hope this helps...

    Thursday, August 23, 2012 10:24 PM
  • I do not think that it is fair to say that it is based on Silverlight, specially now that it produces HTML Clients.

    The base rule that I always follow with lightswitch is that it is just .Net code. So in that anything that you can do in a normal .Net application can be done inside lightswitch, you just need to work out how.

    With you classes you can always drop back to the code view and add the references to the assemblies and then add the code references in your code. Then you would use and call them as normal.

    Thursday, August 23, 2012 10:26 PM
  • Just to add to what the other posters have said, you would probably want to invoke protobuf, rabbitmq, log4net and so on from the server anyway and not from the client. There are a number of extension points in the data saving pipeline that you can tap into (before/after type events) to make those calls.

    If you do need a scenario where the user needs to click a button in the Silverlight screen (for example) and have one of those invoked then you can implement a "command type" pattern to send the command from the client to the server and have it invoked from the server. There are lots of post on this forum about the command pattern (have a search).

    Hope that helps.


    Xander

    Friday, August 24, 2012 12:30 AM