Upgrading your LightSwitch projects (Raghuveer Gopalakrishnan)

Upgrading your LightSwitch projects (Raghuveer Gopalakrishnan)

Rate This
  • Comments 12

Introduction

In this blog post, we will look at how to upgrade your existing LightSwitch applications to Visual Studio 2013 Preview. In recent blog posts, we introduced some of the cool features available in preview like Enhancements in Solution Explorer, partitioned model files that improves experiences around Team Collaboration on LightSwitch projects, Intrinsic Database Management With Database Projects etc. You can take advantage of all these features by migrating your existing LightSwitch projects forward by means of project upgrade.

Upgrade Experience

For projects created with Visual Studio 2012, you will automatically receive a prompt for upgrade on opening the project on a machine with Visual Studio 2013 preview.

image

Click OK to begin the Project Upgrade process. Once the upgrade process is completed, you will automatically get the migration report in the browser as well as upgrade logs in the same folder on disk.

image

Upgrade Details

During Upgrade, the root, client and server projects will undergo a series of migration steps to move your project to latest version. Below, you will find a list of changes that occur during upgrade process

 

            Project

                                                                Details

       Root Project

  • The .ls proj/.ls3 project file will be upgraded and new project file (.lsx) project file is generated.
  • LightSwitch version and LightSwitch project version numbers get updated to latest (4.0 and 3.6 respectively).
  • The project structure for Root, Server and Client projects are upgraded to represent a de-nested project structure.
  • The Model Files (Client.lsml, Service.lsml) undergo migration to split into partitioned model files. Client.lsml file gets moved to Client project and Service.lsml file gets moved to Server project. Also, every entity, screen, query, data source etc. will have a separate model file.

      Server Project

  • References to LightSwitch Assemblies are updated to point to the latest version.
  • Reference to Microsoft.IdentityModel.Tokens.JWT gets added and the Nuget packages folder has an entry for this.
  • IIS Settings are updated to set to use IISExpress by default.
  • Net Target Framework version is updated from v4.0 to v4.5.

      Client Project

  • Jquery, jquery mobile files, .css files located under Application\ HTMLClient\Contents and Application\ HTMLClient\ Scripts folder are updated to the latest runtime version.Default.html file has these updated references.
  • Project References and references to LightSwitch assemblies are updated.

If your project is under Source Code Control, then after upgrade, you will find partitioned files for the model included under pending changes along with project files. These files get checked in during the check-in process.

Extensions and Upgrade:

If the LightSwitch project references any custom/third party extensions, these extensions are not automatically upgraded when project upgrade occurs. Many of the popular LightSwitch extensions now support Visual Studio 2013 Preview and 3rd party developers are continuing to add support for more.

 

Notes:

1. Before Upgrade starts, a backup of the current project is made and stored in Backup folder located at the same level in the project folder as the solution file (.sln). The user file settings (.suo file) is also backed up.

2. It is a 1 way project upgrade. This means that after upgrade, the project cannot be opened with previous releases of Visual Studio.

If you change your mind after upgrade and want to move back to the previous version of the project, you can open the project (not upgraded) in Backup folder using Visual Studio 2012.

Known Issues:

Please refer to Release Notes for Visual Studio 2013 Preview for list of any known issues around project upgrade.

Conclusion:

By upgrading your project to the latest preview version, you can utilize all the cool features and enhancements that were announced during the preview release. We would love to hear about your experience in upgrading your existing projects to the latest version of Visual Studio. Please let us know your feedback via LightSwitch forum or by posting a comment below.

Thanks,

Raghuveer Gopalakrishnan, SDET, LightSwitch Team

Leave a Comment
  • Please add 6 and 4 and type the answer here:
  • Post
  • Thanks Raghuveer  for explaining the process.  I went through upgrading an existing project with no real problem at all.

    The only issue I found was caused by changing the database schema (I'm using a link to an existing database).  If I changed a field in an existing table, or changed the relationships between tables, then the forms that relate to the changes are vastly changed.  In some instances, all related child entities are dropped completely from the visual designer.

  • Hi darcher,

    You might be running into one of the  Known Issues in Visual Studio 2013 Preview Post that is posted on social.msdn.microsoft.com/.../lightswitch-in-visual-studio-2013-preview-and-lightswitch-in-visual-studio-2012-update-3-release

    This is not an upgrade specific issue though. Could you please try creating the screens again after updating data source. I would be happy to help you if you run into any other issues.

    Thanks,

    Raghuveer

  • Hi Raghuveer,

    Your article is very interesting. However, I found a problem when upgrading one of my projects. When I click on Upgrade Project, VS starts the upgrade, but at the end I get the report with only Warnings and an error message with Object Reference not set to an instance of an object. VS bugs and ask for restart. When I try to load again the project VS bugs and a restart. I just tried to upgrade VS to update 3 and the problem is the same. Have you ever had this kind of errors before with a project? I would be very grateful if you can help solve this, since I want to create an HTML Client to my project and the upgrade is mandatory to do that.

    Thanks

  • Hi Faical,

    I cannot repro your issue. Would it be possible for you to share your project so that we can take a look? You can email it to raghuvg at Microsoft dot com.

    I also had a couple of questions for you:

    1. Was there a clean install of VS Update 3 on your machine or did you have previous versions of VS installed on the machine?

    2. Can you try creating a new HTML client project and see if it builds fine.

    Thanks,

    Raghuveer

  • Hi Raghuveer, will VS2013 automatically upgrade LightSwitch projects from VS2010? I am facing problems. VS2013 complains that "The Selected project was created by an older version of this application and cannot be opened."

  • Hi Raghuveer,

    I am facing the same issue as CT. ¿Do you know what is the problem? ¿ It can be Solved?

    Regards,

    Gabriel

  • Hi CT and Gabriel,

    This is a known issue posted in social.msdn.microsoft.com/.../lightswitch-in-visual-studio-2013-preview-and-rc-and-lightswitch-in-visual-studio-2012-update-3.  You cannot upgrade projects created in Visual Studio LightSwitch 2011/Visual Studio 2010 directly.  You must first upgrade the project using Visual Studio 2012.

    Thanks,

    Kevin

  • Hi,

    Is it possible to Upgrade the project manually.

    Could you please update any link @ lkarthikeyan@live.com

    Regards,

    karthikeyan.

  • Hello,

    my attempt to upgrade from VS 2012 to VS 2013 fails: CSRAdmin\CSRAdmin.lsxproj: Object reference not set to an instance of an object. :-(

    What can I do?

    Hansjörg

  • Hansjörg, I can try to help with your project upgrade.  Please contact me at:

    david (dot) kidder (at) Microsoft (dot) com

  • Hi Dave,

    When I upgrade a LS project to VS2013, I get the same error: 'Object reference not set to an instance of an object.'

    When I launch devenv.exe with /log enabled, it writes this message at that point:

    Performance warning: String load failed. Pkg:{AC5E9513-8EDF-4966-91CE-31E5569D02CC} (LightSwitch Version Broker package) LANG:0409 ID:105

    Can you help me to troubleshoot the error?

    Thanks,

    -Manuel

  • Hello,

    these lines in the web.config caused the upgrade failure for me:

         <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />

         <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />

         <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />

    Once they got commented out the project could be upgraded.

    But now i'm facing a new issue that the event handlers i implemented are not migrated properly. Let's see. An MS support engineer is looking at this issue. If I get results I'll let you know.

Page 1 of 1 (12 items)