Share via


Publishing the Application

In this lesson, you will learn how to publish an application and deploy it to end users.

Publishing

The final step in creating an Application an application is to distribute it to users. You publish and deploy LightSwitch-based applications by using the LightSwitch Publish Application Wizard. The wizard guides you through the process of publishing the application.

After the application is published, there are several ways to deploy it to end users. The steps to deploy differ depending on the deployment method that you use.

To publish an application

  1. On the Build menu, click Publish MyFirstApplication.

    The LightSwitch Publish Application Wizard appears.

  2. On the Welcome to the LightSwitch Publish Wizard page, click Next.

  3. On the Application Services page, click Next.

  4. On the Specify Publishing Preference page, in the Where do you want the application files to be placed? box, accept the default location (the path to your project plus Publish\).

    This publishes the application to a Publish subdirectory in your project directory.

  5. In the How do you want to publish the default database? list, click Publish directly to the database now and then click Next.

  6. On the LightSwitch Application Data – SQL Database Connection page, accept the default connection strings and then click Next.

  7. On the Application Administrator page, in the Should the Application Administrator be created when the application is deployed? Section, click Yes, create the Application Administrator at this time.

  8. In the User Name box, type admin.

  9. In the Full Name box, type Administrator.

  10. In the Password box, type Admin_007.

  11. In the Confirm Password box, type Admin_007 again, and then click Next.

  12. On the Install Prerequisites page, accept the default settings and then click Next.

  13. On the Other Connection Information page, accept the default settings and then click Publish.

    The application will be published.

    Tip

    You can monitor the progress in the status bar at the bottom of the IDE. When the process is finished, the message Publish succeeded appears.

To deploy an application

  1. In Windows Explorer, locate the Publish subdirectory in your project directory.

    Tip

    To find your project directory, select the MyFirstApplication node in Solution Explorer and look at the Project Folder property in the Properties window.

  2. Select the contents of the Publish directory and all its subdirectories, and copy them to a network location or to removable media.

Closer Look

In this lesson, you learned how publish the application. The steps for publishing differ for other application types. You must exit the wizard and open the Application Type tab of the Application Designer to change the application type.

On the third page of the wizard, you specified the location at which to publish the application, in this case the default Publish subdirectory. You can enter any valid file path or network path for a publish location.

You also chose the Publish directly to the database now option. This option installs the application database to SQL Server during installation. Use this option when SQL Server is already installed and configured on the computers on which the application will be installed.

The other option, Create a script file to install and configure the database, creates a script file that is run during installation, after SQL Server is installed and configured. Use this option when you want to install SQL Server as a part of the installation, or when you are publishing to an existing database.

On the LightSwitch Application Data – SQL Database Connection page, you accepted the default connection strings. In this case, they were connection strings for the local instance of SQL Server Express that was installed with LightSwitch. If you are publishing to another computer, you have to know the connection string for the instance of SQL Server on that computer. In that case, choosing to install with a script file might be a better choice.

On the Application Administrator page, you chose to deploy authentication with the application, and you defined a default administrator user account and password. This user account automatically provides the Security Administration permission that enables the application administrator to add users and assign roles. Remember the user name and password. You need them to run the application.

Note

You should only deploy the authentication information the first time that you deploy the application. Attempting to deploy the authentication information again causes publishing to fail.

On the Install Prerequisites page, you chose to install only the default prerequisites--the items that are shown in bold text. If you know that the computers where the application will be installed have additional dependencies, you can choose to install those as prerequisites also. Prerequisites can be downloaded from the Internet or from a network share that contains the necessary files.

On the final page, you accepted the default connection strings for the two additional data sources that are used by the application: NORTHWINDData and NORTHWINDData1. In this case, both databases are on your local computer. If you connect to an external database, you have to obtain a connection string from the database administrator.

Next Steps

In the next lesson, you will install and run the application.

Next lesson: Running the Application

See Also

Concepts

How to: Deploy a 2-tier Application

Other Resources

Distributing Your Application

Deployment: Distributing and Maintaining Your Application