Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit editor mode

How to: Deploy a LightSwitch OData Service

Feedback

In this article

 

For the latest documentation on Visual Studio 2017, seeVisual Studio 2017 Documentation.

By publishing a LightSwitch application as a service, you can use it as the middle tier to provide data to other applications. You can host services on Microsoft Azure or Internet Information Services (IIS). For more information about how to deploy a service to Azure, seeHow to: Host an Application on Microsoft Azure.

You can use theLightSwitch Publish Application Wizard to deploy a service by either publishing or packaging it.

  • If you publish a service, client computers can access it immediately after you complete the wizard. The installation automatically deploys the database schema to SQL Server. To publish a service, you must have administrative access to both the web server and the database server, and you must provision the web server for LightSwitch. SeeHow to: Configure a Server to Host LightSwitch Applications.

  • If you package an application, you must compress (zip) everything that’s required to run the service in a folder. A server administrator must also install the service and make it available. SeeHow to: Install a LightSwitch Application on a Server.

To publish a service

  1. InSolution Explorer, choose theProjectName node, whereProjectName is the name of your project.

  2. On the menu bar, chooseBuild,PublishApplicationName.

    TheLightSwitch Publish Application Wizard appears.

  3. On theApplication Type page, choose theWeb service only option button, and then choose theNext button.

  4. On theApplication Server Configuration page, choose theIIS Server option button.

    Note

    If you have a publish settings file (.publishsettings or .pubxml) that was created for another service, you can use that file to provide the rest of the information that you need for deployment. Choose theImport Settings button to specify a publish settings file.

  5. Choose theNext button, and then, on thePublish Output page, choose theRemotely publish to a server now option button.

    TheDetails section appears.

  6. In theService URL text box, enter the Uniform Resource Locater (URL) for the server that’s running IIS.

  7. In theSite/Application text box, enter a path for the webpage that’s used to host the application manifest.

    This path is typically Default Web Site/ServiceName, whereServiceName is the name of your application.

  8. In theUser Name andPassword text boxes, enter your IIS credentials, and then choose theNext button.

  9. If theApplication Administrator tab of theSecurity Settings page appears, enter a validUser Name,Full Name, andPassword for the user who'll be the initial application administrator, and then choose theHTTPS tab.

    Note

    When you publish updates, the application administrator already exists. Select theNo, an Application Administrator already exists check box to skip this step.

  10. On theHTTPS tab of theSecurity Settings page, chooseYes to require a secure HTTPS connection, or chooseNo if your application doesn’t need a secure connection.

    SeeSecurity Considerations for LightSwitch.

  11. Choose theNext button to open theData Connections page of the wizard.

  12. On theDatabase Connections tab, enter the administrator and user connection strings for the database server where you want to publish the application database, and then choose theAttached Data Sources tab.

    Note

    When you publish updates, you don't need to republish the database unless you have changed the schema. To prevent the database from being republished, clear thePublish database schema check box.

    The database server must be running a compatible version of SQL Server, such as SQL Server 2005 or SQL Server 2005 Express. You don’t need to publish the application to the database server.

    Note

    The user connection string can’t use Integrated Security; you must specify a valid user name and password for the connection.

  13. On theAttached Data Sources tab, update the connection strings for any additional connections as needed, choose theNext button, and then choose thePublish button.

    When the service is published, other applications can access it from the website specified by theSite/Application name plusServiceName.svc, whereServiceName is the name of a data source that your service exposes.

To package a service

  1. InSolution Explorer, choose theProjectName node, whereProjectName is the name of your project.

  2. On the menu bar, chooseBuild,PublishApplicationName.

    TheLightSwitch Publish Application Wizard appears.

  3. On theApplication Type page, choose theWeb service only option button, and then choose theNext button.

  4. On theApplication Server Configuration page, choose theIIS Server option button.

    Note

    If you have a publish settings file (.publishsettings or .pubxml) that was created for another application, you can use that file to provide the rest of the information that you need for deployment. Choose theImport Settings button to specify a publish settings file.

  5. Choose theNext button, and then, on thePublish Output page, choose theCreate a package on disk option button.

  6. In theWhat should the website be named? text box, enter a name for the website that will host the service.

    By default, the name of the website is the application name.

  7. In theWhere should the package be created? text box, enter the UNC path for the location where you want the output to be published.

    By default, the output is published in thePublish subdirectory under your project directory.

  8. If theApplication Administrator tab of the Security Settings page will appear. Enter a validUser Name,Full Name, andPassword for the user who will be the initial application administrator, and then choose theHTTPS tab.

    Note

    When you publish updates, the application administrator already exists. Select theNo, an Application Administrator already exists check box to skip this step.

  9. On theHTTPS tab of theSecurity Settings page, chooseYes to require a secure HTTPS connection, or chooseNo if your application doesn’t need a secure connection.

    SeeSecurity Considerations for LightSwitch.

  10. Choose theNext button, and then, on theDatabase Connections tab of theData Connections page of the wizard, select theGenerate the SQL database script option button, and then enter a name for the database.

    You must specify the same name that you entered for theApplication Name property in theApplication Designer.

    Note

    If the database already exists on the server, choose theGenerate a new database called option button, and then enter the connection string for that database. If you don’t have access to the server, you can enter a connection string for another database that has the same schema as the database on the server.

    Note

    When you publish an update, you don't need to republish the database unless you’ve changed the schema. To prevent the database from being republished, clear theGenerate the SQL database script check box.

  11. On theAttached Data Sources tab, update the connection strings for any additional connections as needed, choose theNext button, and then choose thePublish button.

    When the service is published, a .zip file that contains the package is placed in the directory that you specified for the publish output. After this package has been created, a server administrator can use the MSDeploy tool to deploy the service to servers that are running IIS and SQL Server. SeeHow to: Install a LightSwitch Application on a Server.

    When the service is deployed, other applications can access it from the website specified by theSite/Application name plusServiceName.svc, whereServiceName is the name of a data source that your service exposes.

    Note

    If you’ve enabled authentication for your application, the application administrator must authorize users before they can run the application. For more information, seeHow to: Enable Authentication in a Silverlight Client App.

See Also

LightSwitch as a Data Source
Deploying LightSwitch Applications
How to: Host an Application on Microsoft Azure


  • Last updated on

In this article