安裝部署基礎——Web Solution

來源:互聯網
上載者:User

In this walkthrough, you will create a simple Web Forms application using Visual Basic, and then create an installer to deploy the application to a Web server.

Note   Web Setup Projects are not available in the Standard Edition of Visual Basic .NET. For more information, see Visual Basic Standard Edition Features.

To create the Web Forms application

  1. On the File menu, point to New, and then choose Project.
  2. In the New Project dialog box, select Visual Basic Projects in the Project Types pane, and then choose ASP.NET Web Application in the Templates pane. In the Location box, type http://localhost/WebApp1.
  3. Click OK to close the dialog box.

    The project is added to Solution Explorer, and the Web Forms Designer opens.

  4. Select the Web Forms tab in the Toolbox.
  5. Select the Button control and drag it to the Web Form.
  6. Double-click the Button control to add an event handler for the button.
  7. In the event handler, add the following code:
    Button1.Text = "abc"

    This will change the text displayed on the button to "abc" when the button is clicked.

  8. On the Build menu, choose Build WebApp1 to build the application.

To create a deployment project

  1. On the File menu, point to Add Project, and then choose New Project.
  2. In the Add New Project dialog box, select Setup and Deployment Projects in the Project Type pane, and then choose Web Setup Project in the Templates pane. In the Name box, type WebDeploy.
  3. Click OK to close the dialog box.

    The project is added to Solution Explorer, and the File System Editor opens.

  4. In the Properties window, select the ProductName property and type WebApp1.

To add the output of the WebApp1 project to the deployment project

  1. In the File System Editor, select the Web Application folder. On the Action menu, point to Add, and then choose Project Output.
  2. In the Add Project Output Group dialog box, choose WebApp1 from the Project drop-down list.
  3. Click OK to close the dialog box.
  4. Select the Primary Output and Content Files groups from the list, then click OK.

To set properties for the installer

  1. Select the WebApplication folder. In the Properties window, set the VirtualDirectory property to xyz.
  2. In the Properties window, set the DefaultDocument property to WebForm1.aspx.
  3. On the Build menu, choose Build WebDeploy.

To deploy the application to a Web server on your development computer

  1. In Solution Explorer, select the WebDeploy project. On the Project menu, choose Install.

    Note   You must have install permissions on the computer in order to run the installer, and you must have IIS (Internet Information Services) permissions to install to the Web server.

  2. To access the Web application that was deployed, start Internet Explorer, and type the URL http://localhost/xyz. Note that the text on the button changes to "abc" when you click the button on the Web page.

To deploy the application to a Web server on another computer

  1. In Windows Explorer, navigate to your project directory and find the built installer. The default path will be \documents and settings\yourloginname\ My Documents\Visual Studio Projects\WebApp1\WebDeploy\project configuration\WebDeploy.msi. The default project configuration is Debug.
  2. Copy the WebDeploy.msi file and all other files and subdirectories in the directory to the Web server computer.
  3. On the Web server computer, double-click the Setup.exe file to run the installer.

    Note   You must have install permissions on the computer in order to run the installer, and you must have IIS permissions to install to the Web server.

  4. To access the Web application that was deployed, start Internet Explorer, and type the URL http://[ComputerName]/xyz. Note that the text on the button changes to "abc" when you click the button on the Web page.

To uninstall the application

  1. In the Windows Control Panel, double-click Add/Remove Programs.
  2. In the Add/Remove Programs dialog box, select WebApp1 and click Remove.
  3. Click OK to close the dialog box.

    Tip   To uninstall from your development computer, on the Project menu, choose Uninstall.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.