Copying a Web Site


With Visual Studio 2005, you can copy files from a source Website to a remote Website. The source Website is the Website of your Web application that has been opened with Visual Studio. This Website is accessed either from the local file system or from IIS — depending on how the Web application was created. The remote Website to which the files should be copied can be accessed using the file system, the FTP protocol, or FrontPage Server Extensions on IIS.

Copying files can happen in both directions: from the source Website to the remote Website and vice versa.

In the next Try It Out, you use Visual Studio to copy the Web application from Chapter 19 to the Website you configured earlier.

Try It Out – Copy a Web Site

image from book
  1. Open the Web application from Chapter 19.

  2. Select the menu options Website Copy Web Site. The dialog shown in Figure 21-10 will appear.

    image from book
    Figure 21-10

  3. Select the button Connect to a remote site that is located next to the Connect to drop-down list. The dialog in Figure 21-11 appears.

    image from book
    Figure 21-11

  4. From the Open Web Site dialog, you can select files to copy to the local file system, local IIS, FTP sites, and remote sites (which have FrontPage Server Extensions installed). Select Local IIS, and select the previously created Website, BegVCSharpWebsite.

  5. In the Source Web site list, select the files you want to copy from Source Web Site to Remote Web Site.

  6. Click the Copy selected files button.

  7. Now all the selected files have been copied to the new Website.

image from book

With the Copy Web Site tool, you can also select files to copy from the remote Website to the source Website. Selecting the button Synchronize selected files that shows errors in both directions, the newer files from the remote Website are copied to the source Website, and the newer files from the source Website are copied to the remote Website. This is a very useful option if you have a team Web server where other developers synchronize files. Synchronizing in both directions copies your newer files to the team Web server and the files from your colleagues' remote Web server to your local site.

When the files are just copied, you cannot be sure if the files can be compiled. Compilation happens when the files are accessed by a browser. You can perform a precompilation of the Website using the command-line utility aspnet_compiler.exe.

If you start the command

aspnet_compiler –v /BegVCSharpWebsite

the Website BegVCSharpWebsite is precompiled. This way the first user doesn't have to wait until the ASPX pages are compiled as they already are.

You can find this utility in the directory of the .NET runtime.




Beginning Visual C# 2005
Beginning Visual C#supAND#174;/sup 2005
ISBN: B000N7ETVG
EAN: N/A
Year: 2005
Pages: 278

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net