Alessandro Del Sole's Blog

/* A programming space about Microsoft® .NET® */
posts - 159, comments - 0, trackbacks - 0

My Links


Your host

This is me! This space is about Microsoft® .NET® and Microsoft® Visual Basic development. Enjoy! :-)

These postings are provided 'AS IS' for entertainment purposes only with absolutely no warranty expressed or implied and confer no rights.

Microsoft MVP

My MVP Profile

I'm a VB!

Watch my interview in Seattle

My new book on VB 2015!

Pre-order VB 2015 Unleashed Pre-order my new book "Visual Basic 2015 Unleashed". Click for more info!

My new book on LightSwitch!

Visual Studio LightSwitch Unleashed My book "Visual Studio LightSwitch Unleashed" is available. Click the cover!

Your visits

Follow me on Twitter!

CodePlex download Download my open-source projects from CodePlex!

Article Categories


Post Categories

.NET Framework


Help Authoring

Microsoft & MSDN

Setup & Deployment

Visual Basic 2005/2008/2010

LightSwitch: a small guide for migrating apps from v1 to v2

I have been recently busy in migrating a quite complex LightSwitch application from v1 (2011) to v2 (2012) and so I'd like to share some considerations that can be useful before you start the migration process.

Actually, the process is very simple but requires you to pay attention against the following situations.

Extensions and 3rd party components

If your application uses extensions or controls by 3rd party producers, it is particularly important to ensure that a version supported by Visual Studio 2012 exists. In most cases, extensions for v1 are also correctly recognized and used in v2, but this is not a rule. So, before you do anything else, create a new empty LightSwitch project in VS 2012 and check that everything you need is available in the Extensions tab of the project's properties. If not, check for the availability of a new version. If one is not available, make an installation repair of the controls so that they can be recognized by VS 2012 if this has been installed after the extensions.

Server side: prerequisites

If your application is going to be published onto a Web server, as it often happens, you just need to install the .NET Framework 4.5 and the Web Deployment 3.0 tool. Assuming you are publishing the upgraded app onto the same server of the previous version, the Visual Studio LightSwitch 2011 server prerequisites are still good for version 2012, so you don't need anything else. Let me suggest to download the Web Deployment tool via the Web Platform Installer which makes things the appropriate way.

Server side: the database

Unless you want to upgrade to SQL Server 2012, your existing database will not need any changes since LightSwitch 2012 still supports previous versions of the db engine. Really cool.

Client side: Silverlight 5

Of course LightSwitch 2012 relies on Silverlight 5, so clients that will access your application will receive a warning which says that Silverlight must be also upgraded to version 5. In scenarios like the one I work for, so a Windows domain and users with limited privileges, this is a thing to take care about since if you want to avoid the need of (or you can't from remote connections) going to every workstation and logon with admin credentials to install the plug-in, you might want to plan a distribution like a WSUS server.

Silverlight projects with custom controls

In LightSwitch 2012, when you open a solution containing a Silverlight project exposing custom controls, such a project will not be automatically upgraded to version 5. For this reason, you must upgrade the project to version 5 of Silverlight by changing the project properties, but most importantly you need to upgrade references to assemblies if an updated edition targeting Silverlight 5 exists. Consequently, if an updated version of the assemblies does not exist, do not migrate. It is a good way to avoid a number of problems.


The LightSwitch 2012's Publish Wizard now includes some more options especially when publishing to Web servers, but it is not mandatory to use them when upgrading. You won't change the previous settings and you can still publish the same way you did with version 1. Cool  However, let me give you a suggestion based on my practical experience: if you use 3rd party extensions or libraries, after you upgrade these components as well and before you publish to the server, remove the Bin subfolder from the application folder on the hosting Web server. After you have done this, go publish! The reason is that despite LightSwitch is careful enough to update all the required components, it can happen that not all of them are replaced with updated versions. By doing so, it will deploy all the correct files. Of course, make a backup of the Bin subfolder.


According to my personal real-world experience, these have been the most critical points when upgrading a LightSwitch application from v1 to v2. Keep in mind that Visual Studio 2012 will also upgrade the .LsProj file, which cannot be reverted. So, even if the IDE makes a backup, make one yourself: you never know. 

Happy migration!


Print | posted on giovedì 11 ottobre 2012 13:47 | Filed Under [ Visual Studio LightSwitch ]


No comments posted yet.

Post Comment

Please add 4 and 5 and type the answer here:

Powered by:
Powered By Subtext Powered By ASP.NET