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
On the menu bar, choose File, New Project.
In the New Project dialog box, in the left-hand pane choose Installed Templates, and then choose the LightSwitch node.
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.
If you’ve installed Microsoft LightSwitch for Visual Studio Update 2, additional templates are available. See Projects: The Container for Your Application.
In the Name text box, enter a name for the new project.
In the Location text box, enter the location where the project will be saved.
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.
If you are using a source code control product to store your code, select the Add to source control check box.
Choose the OK button to create the project.
To open an existing project
On the menu bar, choose File, Open Project.
In the Open Project dialog box, browse to the location of the project that you want to open.
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.
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
In Solution Explorer, expand the Logical View list on the toolbar, and then choose File View.
Expand the Common node, and then expand the User Code node to access the files that contain your code.
To display additional project files, choose the Show All Files button on the toolbar.
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
In Solution Explorer, choose the project node.
On the menu bar, choose Project, Add Client.
This command is available only if you’ve installed Microsoft LightSwitch for Visual Studio Update 2.
The Add Client dialog box appears.
In the Select the type of client to add list, choose HTML Client or Desktop Client.
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.
In the Name text box, enter a name for the client, and then choose the OK button.
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.