Add a full-blown RIA service to your LightSwitch project in 15 seconds

Introduction

Long time ago I developed a Nuget package for injecting in a LightSwitch project a RIA service. This Nuget package was developed in the visual studio 2010 times and probably no longer correclty working in the visual studio 2012 and especially not with the new CTP 4 release of LightSwitch.

Here is the original post: NUGET PACKAGE FOR SETTING UP AN INTERNAL RIA SERVICE FOR YOUR LIGHTSWITCH PROJECT

Therefor, I decided to refresh this Nuget package in such a way that it works in the 2012 version of LightSwitch (both V2 and V3).

I can assure you that developing a Nuget Package can be a tedious task, but it seems to work, at least on my machine :)

Currently, it will only function completely correctly for c# based projects.

How to proceed

  1. Start with a c# LightSwitch project where there is already some content in the ApplicationData context. So, adding just one table is enough. Compile also the project.
  2. Add new a new c# ClassLibrary to your solution.
  3. Run now the Nuget Package “TheLightSwitchToolbox.RiaServices.Server” over the Classlibrary.ria

    Do this from the Package Manager Console :

    riaconsole

The Result

The result will be that you have a full-blown Ria Service with all binary references in place, a nice LightSwitchDomainServiceBase base class an example service and an example DTO. You RIA project will contain also a file reference (meaning it will be up-to-date all the time) to the ApplicationData.cs (for LightSwitch V2 project) or ApplicationDataObjectContext.cs (for a LightSwitch V3 project).

Try it !