This documentation is archived and is not being maintained.

How to: Create, Open, Save, or Delete a Project

In Visual Studio LightSwitch, projects are the containers for applications. You can create a project, open an existing project, save changes to a project, or delete a project that you no longer need.

Projects appear in Solution Explorer in a logical view. If you must access the files for a LightSwitch project, you can switch to File View.

If you’ve installed Microsoft LightSwitch for Visual Studio Update 2, you can also add an HTML client project to an existing solution, and you can add a Silverlight client project to an existing HTML Client solution.

To create a project

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

  2. In the New Project dialog box, in the left-hand pane choose Installed Templates, and then choose the LightSwitch node.

  3. In the center pane, choose one of the project templates.

    The right-hand pane displays a description of each project template as you choose it.

    NoteNote

    If you’ve installed Microsoft LightSwitch for Visual Studio Update 2, additional templates are available. See Projects: The Container for Your Application.

  4. In the Name text box, enter a name for the new project.

  5. In the Location text box, enter the location where the project will be saved.

  6. In the Solution list, choose Create New Solution to replace the currently open solution, or choose Add to Solution to add the new project to the open solution.

  7. If you are using a source code control product to store your code, select the Add to source control check box.

  8. Choose the OK button to create the project.

To open an existing project

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

  2. In the Open Project dialog box, browse to the location of the project that you want to open.

  3. Choose the Close Solution option button to replace the currently open solution, or choose the Add to Solution option button to add the new project to the open solution.

  4. Choose the Open button to open the project.

To save a project

  • On the menu bar, choose File, Save All.

    The project files are saved to the location that you specified when you created the project.

To delete a project

  • You can delete a project permanently, but not by using LightSwitch. Before you delete a project, save any files that you want to use again in another application. Use File Explorer to delete the directory that contains the project files.

To view project files

  1. In Solution Explorer, expand the Logical View list on the toolbar, and then choose File View.

  2. Expand the Common node, and then expand the User Code node to access the files that contain your code.

  3. To display additional project files, choose the Show All Files button on the toolbar.

    Caution noteCaution

    If you edit project files other than user code files, you could corrupt the project. You should always back up these files before you edit them.

To add a client project to an existing solution

  1. In Solution Explorer, choose the project node.

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

    NoteNote

    This command is available only if you’ve installed Microsoft LightSwitch for Visual Studio Update 2.

    The Add Client dialog box appears.

  3. In the Select the type of client to add list, choose HTML Client or Desktop Client.

    NoteNote

    A project can contain only one HTML client and one desktop client. If the project has been enabled for SharePoint, it can contain only a single client.

  4. In the Name text box, enter a name for the client, and then choose the OK button.

  5. When you add an HTML client, the project must be upgraded to a new solution model. If you're prompted to upgrade, choose the OK button.

    A migration report appears in a browser window when the upgrade is complete.

Show: