How to Publish a LightSwitch Desktop Application



Prologue:

In this article we will discuss publishing the LightSwitch Desktop Application.

In my previous article we have seen how to create a LightSwitch Login screen i.e. Forms Authentication. So in this article we will discuss how to publish the desktop application which has forms authentication.

Preparing the Solution:

Create a LightSwitch Solution with name DeploymentOfLS. Then add a table called Person with columns as given in the following figure.

LSwich1.gif

Design the screen as per your requirement.

Make sure you have selected Use Forms Authentication in the project's properties.

Selecting Forms Authentication:

LSwich2.gif

In the figure above we have deselected the "Granted for Debug" check boxes for publishing the application.

Selecting Type of Application:

LSwich3.gif

From the Project Properties menu select the Application Type tab [No: 1]. Here we need to select which type of application we are going to publish i.e. as Desktop application or Web application [No: 2] from the Client group box.

We have to choose where the application is going to run i.e. the application will run on the end user's machine or in the IIS server or in Windows Azure.

Yes LightSwitch Beta 2 supports Windows Azure.

Application Server Configuration:

The next step is to configure the server; i.e. whether the application should run in the local machine or the server.

This wizard will have three options as shown in the figure.

LSwich4.gif

For our application we are choosing local as we are going to install in our machine.

Publish Output file [Setup file]:

LSwich5.gif

In this Publish Output tab, we have two options.

  1. Where should the setup file be placed
  2. How to publish the Database.


For the first option we need to select the folder; where it should create the application setup file. The second option is how the database should be published i.e. whether we need a SQL script file for the database or it should create a database at the time of publish.

If you choose the first option then the database will be created automatically when you click Finish. If you choose the second option then it will create a SQL script file in the Package.

Specify DB connection properties:

LSwich6.gif

Just press the Next button to continue the Wizard. Because we don't need to change the connection string as we are hosting in the local machine.

Application Administrator:

In this wizard we have to give the username and password for the application. LightSwitch applications with Access control features enabled require a Security Administrator.

LSwich7.gif

The user created via this wizard will have the Security Administrator power to create the Users, Roles and permissions.

Prerequisites:

If our application has any dependencies to be installed then we have to select the Second option "Yes, I need to specify additional prerequisites".

LSwich8.gif

In our application we don't have any additional prerequisites to be installed. So select the first option.

The option "Copy from the same location as my application" is used to tell the publisher where it should find the Additional prerequisites.

Specifying the Certificate:

By signing a XAP (.xap) file for a LightSwitch application, you assure users that the publisher is reliable and the code has not been tampered with.
LightSwitch applications are downloaded as XAP files. An XAP file is a compressed file that contains an assembly manifest and one or more assemblies.

An XAP file is signed by using a public key certificate (typically referred to just as a certificate), which is a digitally signed statement that binds the value of a public key to the value of a private key that is held by a person, device, or service. A certificate is typically obtained from a system administrator.

LSwich9.gif

As shown in the figure, select "Specify a Certificate" and then select a certificate if you have one with your machine else click on "Create a test certificate".

If you chose "Create a test certificate" then it will ask for password to create a certificate.

That's it. You are done.

LSwich10.gif

This is the summary of our application deployment. The deployment will take one or two minutes.

After a successful publish we will see the files created in the directory in which you have selected previously.

LSwich11.gif

Before installing the application please go through the Install.htm file.

Now install the application by double-clicking the setup.exe file.

After installing the application the installer automatically starts the application for you.

LSwich12.gif

As our application uses Forms based Authentication it asks for the credentials. Give the user name and password which we have created at the time of publish.
Then what's up.

Summary:

In this article Part - I, we have seen the basics of Forms Authentication in LightSwitch Beta 2.

Thanks for spending your precious time here. Please provide your valuable feedbacks and comments, which enables me to give a better article the next time.

Please rate this Article.

Thanks.
 

Up Next
    Ebook Download
    View all
    Learn
    View all