visual-studio-lightswitchlightswitch-2012

Lightswitch ApplicationServerContext


I need to use functionality available with the Lightswitch ApplicationServerContext available in the 2012 version of Lightswitch in the Silverlight version of the client part of the application.

The only examples I've been able to find so far show the HTML client of Asp.net pages etc

I have tried creating the ApplicationServerContext in the Silverlight client using

ServerApplicationContext context = ServerApplicationContext.CreateContext();

but I get the error "The name 'ServerApplicationContext' does not exist in the current context"

Is it possible to use ApplicationServerContext in the Silverlight client and if so how?

Thanks

Mark


Solution

  • The ServerApplicationContext is intended to give access to the custom Business Logic on the server. Before this the only way to communicate with the server middle tier was via oData. Using the ServerApplicationContext it is possible to extend your Lightswitch Application serverside with other technologies such as ASP. NET MVC, ASP.NET WEBFORMS and ASP. NET WEBAPI.

    It is not possible to acces the ServerApplicationContext from the Silverlight Client because

    If you want to access server side functionality from the Client you could:

    Since Microsoft stopped developing Lightswitch and browsers which support plugins such as java, flash and silverlight are deprecated (the new Windows 10 Edge browser does not support any plug ins, silverlight included...) the way of preserving your development investments in lightswitch applications could be to deploy only the lightswitch server, expose your use cases through current asp.net techonologies and develop a new desktop client using a current techonology (such as WPF) that connects to the lightswitch middle tier through OData or other webservices that you could expose.

    Hope this helps.