Publishing a Desktop Application in Light Switch Visual Studio 2012

Publishing a Desktop Application in Light Switch Visual Studio 2012

This article describes how to perform hosting in a Desktop Application using LightSwitch Visual Studio 2012.

Procedure for publishing a Desktop Application

Step 1

  • Open the Visual Studio 2012.
  • Go to "File" => "New" => "Project..."
  • In "New Project" => "Installed" => "Template"
  • In "Template" => "LightSwitch"
  • Select "LightSwitch Application (Visual C#)".
  • Enter the name and choose the location.
  • Click "OK".

nw pro.jpg

Step 2

Go to the Solution Explorer, right-click on the "Data Source" and select "Add Table".

add table.jpg

Step 3

Insert the data in the following table and rename it.

table.jpg

Step 4

Go to the Solution Explorer and right-click on "Screens" and select "Add Screen".

add src.jpg

Step 5

The Screen Designer appears. Select the Screen Template and provide the screen information and click the "OK" button.

ad screen.jpg

Step 6

Go to the Build Tab and choose the Configuration Manager.

build.jpg

Step 7

The Configuration Manager Designer window appears.

confi manager.jpg

Step 8

Select "Release" from the "Active solution configuration" dropdown then click the "Close" button.

release.jpg

Step 9

Now, again go to the Build Tab and select the Publish (Application Name) option. Note that here our application name is Application6.

publish.jpg

Step 10

We will notice that the LightSwitch Application Wizard appears.

app type.jpg

Step 11

In the Application Type, we will select one application, either Web or Desktop Application. Here we will choose Desktop Application and click on "Next" button.

app type.jpg

Step 12

In the Application Server Configuration, we will be asked to choose "Where the application's services will be hosted?" and we will choose Local and click on the "Next" button.

server config.jpg

Step 13

In the Publish Output section we will need to specify the path under "Where do you want the application files to be placed?" and we also need to select the option from "How do you want to publish the default database?" and after selecting click on the "Next" button.

publish output.jpg

Step 14

In the Database Connections,we need to specify both user as well as administrator database connections, then click on the "Next" button.

mt database conn.jpg

Step 15

In order to specify the connection we click on the button, the connection property window appears. We also provide the username and word and enter the database name.

conn prop.jpg

Step 16

We click on the Test Connection button to test the connection. We click the "OK" button.

test result.jpg

Step 17

In the Prerequisites section, we will specify "whether the application have any additional dependencies that need to be installed?". We will choose "No, only install the prerequisites" then click on the "Next" button.

prerequirties.jpg

Step 18

In the "Specify a certificate" section, we are not specifying any certificate; click on the "Next" button.

specify a certi.jpg

Step 19

In the summary section, we will see the basic summary of our application and click on Publish button.

publish summery.jpg

When we Publish we get:

publish succeed.jpg