How to: Create or Add an HTML Client Project

You can use a HTML client project to add cross-browser, mobile web client capabilities to your Visual Studio LightSwitch application. HTML clients are based on HTML5 and JavaScript and optimized for touch-first displays on mobile devices such as tablet computers that are running on a variety of operating systems.

You can add an HTML Client project to an existing LightSwitch desktop or web application, or you can create a solution that contains only an HTML Client project. In either case, a single Server project contains the data layer for your application. Each solution can contain one HTML Client project and one Desktop Client project.

NoteNote

When you add an HTML Client project to a LightSwitch solution, it’s upgraded to Microsoft LightSwitch for Visual Studio Update 2. The file structure of the solution is modified, and you can no longer open the solution on a computer that doesn’t have Microsoft LightSwitch for Visual Studio Update 2 installed.

To create an HTML Client solution

  1. On the menu bar, choose File, New, Project.

  2. In the New Project dialog box, choose either the LightSwitch HTML Application (VB) or LightSwitch HTML Application (C#) template.

    NoteNote

    JavaScript is the programming language for the HTML Client project. Depending on your choice, either Visual Basic or C# is the programming language for the Server project.

  3. Name the project, and then choose the OK button.

    The solution is added to Solution Explorer with Server and Client projects.

To add an HTML Client project to an existing solution

  1. In Solution Explorer, choose the Solution node.

  2. On the menu bar, choose Project, Add Client.

  3. In the Add Client dialog box, choose HTML Client.

  4. Name the project, and then choose the OK button.

    A client project is added to Solution Explorer and set as the Startup project.

Show: