Shrinking a LightSwitchV3 project for file transfer

Introduction

A small LightSwitch solution can take quite some diskspace, ~150MB.

Since the LSv1 beta version, there’s a batch file made by Oscar Agreda for shrinking some redundant folders that Visual Studio creates when building in debug or release.

With the current version of LightSwitch, you have 2 options for cleaning your project: using an update of this batch, or by using the Clean Solution functionality of Visual Studio.

LSCleanV3.bat

Here’s an update of the script that works with the current version of LightSwitch, having a Desktop and/or a HTML Client:

 rd /q /s Bin\Debug
 rd /q /s Bin\Release
 rd /q /s _Pvt_Extensions

for /d %%p in (*Client) do (
 rd /q /s "%%p\Bin\Debug"
 rd /q /s "%%p\Bin\Release"
 rd /q /s "%%p\obj\Debug"
 rd /q /s "%%p\obj\Release"
 )

for /d %%p in (*Server) do (
 rd /q /s "%%p\Bin\Debug"
 rd /q /s "%%p\Bin\Release"
 rd /q /s "%%p\obj\Debug"
 rd /q /s "%%p\obj\Release"
 )

Remember to close your solution first, then run the script from your LS project folder.
With this script you can shrink the project folder to ~15MB, compressable to 3MB.

Clean Solution

With the first LightSwitch version, cleaning up the solution didn’t work for the LightSwitch project.
The current version has fixed this so you can also remove the redundant build files by cleaning your solution, do this once for each build configuration you used. This also cleans up the build files of additional projects, for instance your RIA Service class library project, which the batch file doesn’t.

After the clean, you can manually delete the _Pvt_Extensions folder.

Enjoy!
Michiel

Advertisements

Lightswitch has made a switch!

I’ve met LightSwitch in november 2011. Back then it was marketed as a ‘Citizen developer’ framework.
With LightSwitchV1 you could easily migrate from Access and get a scalable 3-tier application based on modern technologies, which is fantastic for developers in the category of ‘Citizen developers’, whatever that may be.

Though I don’t classify in this category, my first experiences with LightSwitchV1 back then were positive. Ok, any junior developer can quickly build its own LightSwitch application. That’s good, but suprisingly the framework simplyness didn’t limit some more advanced functionalities. You can write your own queries in LINQ and thanks to RIA Services you can do your own plumbing, if there’s the need for it. The MVVM pattern works really great and the automated dependency tracking for computed properties and validations are superb! Since Q1 2012 I’ve developed several small-to-medium sized LOB applications, and I’ve never hit a brick wall.
Of course LS had some downsides, in my experience there were 3. Localization, the SL client (for customer facing applications) and multi-developer support.

And then LightSwitchV2 came out in Visual Studio 2012. At first sight, the version V2 didn’t improve that much. The UI was a bit better and a OData Service is exposed instead of a hard-to-expose RIA service. The latter is actually a bigger improvement then I first assumed. It gives the possibility to consume your data from other applications that can consume OData like PowerPivot, Java applications, your company’s Drupal website and many others! This interoperability heavily improves the maturity of the LS framework.

And now LightSwitchV3 is released within VS 2012 Update 2. With this update you can easily create simple mobile HTML5 companion apps for tablets and mobile phones based on jQuery UI and other standard libraries. You can also create Sharepoint apps and integrate all this goodness in office 365! The LightSwitch team also built-in a easter gift:  localization support.

If you follow the history of Lightswitch, you can clearly state that the framework has made a switch. From a simple and medium rich citizen developer framework to a equally simple but far richer framework in which any developer can easily build a interoperable and multi-platform LOB application!

Now the time has come to stop bragging how quick you can build a small Lightswitch application. Start bragging how rich, usable and qualitative your LS applications can be created without much effort and costs.

Lightwitch is a framework of the new digital norm!

If you follow the history of LS, you can state that Microsoft has put much effort in Lightswitch. They believe in Lightswitch and so do I. So I’ll start blogging about it!