Deploying website online from localhost

Post Reply
Neofriend
Captain
Captain
Posts: 103
Joined: Wed Dec 23, 2009 3:37 pm
Location: Pakistan

Deploying website online from localhost

Post by Neofriend » Tue Jun 15, 2010 6:01 pm

I have a sample windows server and the project at my localhost, which works fine. How can I get it to work on live server? As now I need to do that to progress with the project.

Thanks
User avatar
Saman
Lieutenant Colonel
Lieutenant Colonel
Posts: 828
Joined: Fri Jul 31, 2009 10:32 pm
Location: Mount Lavinia

Re: Deploying website online from localhost

Post by Saman » Wed Jun 16, 2010 4:19 am

Deployment Options Supported by .NET
  1. XCOPY Deployment
  2. Using the Copy Project option in VS .NET
  3. Deployment using VS.NET installer
XCOPY Deployment
One of the primary goals of the .NET Framework is to simplify deployment by making possible what is known as XCOPY deployment. Before looking at how .NET enables XCOPY deployment, let us take a moment to understand what XCOPY deployment is. Prior to .NET, installing a component (for example, a COM Component) required copying the component to appropriate directories, making appropriate registry entries, and so on. But now in .NET, to install the component all you need to do is copy the assembly into the bin directory of the client application and the application can start using it right away because of the self-describing nature of the assembly. This is possible because compilers in the .NET Framework embed identifiers or meta-data into compiled modules and the CLR uses this information to load the appropriate version of the assemblies. The identifiers contain all the information required to load and run modules, and also to locate all the other modules referenced by the assembly. It is also referred to as zero-impact install since the machine is not impacted by way of configuring the registry entries and configuring the component. This zero-impact install also makes it possible to uninstall a component without impacting the system in any manner. All that is required to complete uninstallation is the removal of specific files from the specific directory. For performing this type of deployment, all you need to do is to go to the Command Prompt and copy over the required files to a specific directory on the server using the XCOPY command.

The following screenshot illustrates the use of XCOPY deployment to deploy the Web application named DeploymentExampleWebApp to the target server named RemoteServer.
1.gif
1.gif (14.99 KiB) Viewed 5951 times
As you can see, the XCOPY command takes a number of arguments.
  • / E - This option copies directories, subdirectories, and files of the source argument, including empty ones.
  • / K - This option allows you to retain all the existing file and folder attributes. When you use XCOPY to copy files or a directory tree structure, XCOPY strips off file attributes by default. For example, if a file had the read-only attribute set, that attribute would be lost after the file is copied. To retain the original attributes with the copied files, you must use the / K parameter.
  • / R - This option overwrites files marked as read only.
  • / O - This option preserves all security-related permission ACLs of the file and folders.
  • / H - This option copies both hidden and system files.
  • / I - This option tells XCOPY to assume that the destination is a directory and create it if it does not already exist.
Please refer to the MSDN help documentation for more information on the different options supported by XCOPY command.

Once the folder is copied over to the target server, you then need to create a virtual directory on the target server (using Internet Information Manager MMC snap-in) and map that virtual directory to the physical directory that is created using the XCOPY command. That's all there is to deploying an ASP.NET Web application on a remote server using XCOPY Deployment.


Copy Project Option in VS .NET
The Copy Project option in VS .NET makes it very easy to deploy ASP.NET Web applications onto the target servers. Using this option, you can copy the Web project to the same server or to a different server.

If you are using VS .NET to develop Web applications, the first thing that you need to do before packaging an ASP.NET Web applications is to change the Active Solution Configuration from Debug to Release as shown below. This allows the compiler not only to optimize the code but also remove the debugging related symbols from the code, making the code run much faster. To bring up the Configuration Manager, select your Web project from the Solution Explorer and select Project->Properties->Configuration Properties from the menu and then click on the Configuration Manager Command button. In the Active Solution Configuration combo box, select the Release option.
2.gif
2.gif (15.83 KiB) Viewed 5951 times
To copy the Web project onto the target server, select Project->Copy Project from the menu. Selecting that option will result in the following dialog box being displayed.
3.gif
3.gif (21.6 KiB) Viewed 5951 times
The Copy Project dialog provides the following options.

Destination Project Folder: Using this option, you can specify the location to which you want to copy the project. The location can be the same server or a remote server.
Web access method: The Web access method option determines the access method that is used to copy the Web project to the destination folder. There are two types of Web access methods.
File share: This option indicates that you want to directly access your project files on the Web server through a file share. It does not require FrontPage Server Extensions on the server.
FrontPage: This option specifies that you want to use the HTTP-based FrontPage Server Extensions to transfer your project files to the server. Before using this option, make sure FrontPage Server Extensions are installed on the server. This option will automatically create the required virtual directory on the target server.
Copy: The Copy option provides three types:
Only files needed to run this application: this option copies built output files (DLLs and references from the bin folder) and any content files (such as .aspx, .asmx files). Most of the time, you should be able to deploy the application using this default option.
All project files: this option copies built outputs (DLLs and references from the bin folder) and all files that are in the project. This includes the project file and source files.
All Files in the source project folder: choosing this option will result in all the project files and any other files that are in the project folder (or subfolder) being transferred to the destination folder.

To copy the Web project, select the appropriate options from the above Copy Project dialog box and click OK. This will result in the ASP.NET Web application being deployed on the target server.
Post Reply

Return to “ASP & ASP.Net”