Its a definite writeup resource
Home How to order? How to write? About us Contact us
Please! Login      

Creating ASP.Net website setup

The following tutorial is based on .Net 2.0 or above.

There are three different ways in which a website can be hosted / deployed / installed on a live web server (IIS).

Simplest way

The simplest of all the deployment is to copy all the contents of your website project to the root of your hosted website folder.

Simplest way - Overview

  1. This method is the easiest one for the deployer as he just have to copy paste the web project contents to the hosted website folder
  2. Due to this, on first access, the hosting IIS .net framework would first compile the whole website and then execute it. Hence the first access would always take longer period to respond.
  3. Another benifit is, if any of the file is changed either .aspx or .aspx.vb then only that file is to be uploaded and the webserver would compile it again on the first access
  4. The only disadvantage is that all the code behind logic is in the text form and visible to the client, if he wants to access it
  5. This method is ususally used when the client has also paid for the source code ownership.

Setup & Deployment

The following setups need to be performed for create website setup project:

  1. Open the website project in Visual Studio IDE.
  2. From the "Solution Explorer", right click on the solution - Add - New Project as shown below:
  3. Select "Setup and Deployment" as Project Types, "Web Setup Project" as Templates and type an appropriate name in "Name field" as shown below. Finally click "Ok".
  4. In the File System tab of your wpSetup project, right-click on "Web Application Folder" node, then select "Add" - "Project Output".
  5. In the Project Output dialog, just click "Ok", by having "Configuration" as "Active".
  6. In the property dialog of "Bin" node, set "Allow Read Access" to "True".
  7. In the property dialog of "Web Application Folder" node, set the "Default Document" to your start page (In our case is Default.aspx).
  8. Build your application.
  9. Since our build mode was "Debug" so locate your "setup.exe" file and execute it.
  10. Click Next, and pick step 11 or 12.
  11. You will be picking this step, only when you want your project to be a part of the existing website. Just select the website in which you want to deploy your new project and select the name of the virtual directory in which the files are going to copied.
  12. You will be picking this step, when you want your project to be deployed as an independent website. Before doing so it is a prerequiste that you have already created a website and bind it to a port by using IIS manager. For reference read Creating New Web Site topic.
  13. Note: In both the above two cases, either the default application can be selected or you can create a new applicaton pool for better management by using IIS manager.

Publish website

In order to publish a website, do the following:

  1. Load the website project in the Visual Studio IDE
  2. Select "Publish Website" from "Build" menu

  3. In the above image select "Allow this precompiled site to be updateable"
  4. Select your drive location, where you want your files to be published. You can also select http: or ftp: destination.
  5. Finally click "Ok"
  6. Your folder "c:\wpPublish" now appears as:

    As you can see in the above screen shot the published folder only contains the design files i.e .aspx and does not have any .aspx.vb (code behind files if you have selected vb.net language)
  7. Your folder "c:\wpPublish\bin" folder would contain all the complied code (dll files) which you have done in the code behind files i.e. .aspx.vb files.
  8. Finally upload the contents of "c:\wpPublish" folder to your hosted website root

Publish website - Overview

  1. Since the code is precompiled, so the .net framework of your webserver doesnot have to do the compilation of you code behind files.
  2. The source code of your code behind files i.e. .aspx.vb files is not present in the form accessible text. Hence protected, if you want your code not to be seen by your client.
  3. As you can see from the "c:\wpPublish\bin" folder contents, App_Code.dll file contains the compiled code for all the classes present in "App_Code" folder of you website project. Hence if you make any changes in the "App_Code" folder classes, then after republishing the website project, all you need to do is to copy "App_Code.dll" file to your hosted website root
  4. But if you change any of the code behind file code i.e. in .aspx.vb files, then after republishing you have to upload all the "App_Web_....dll" files along with all the .aspx files. The reason is that we have not checked "Use fixed naming and single page assemblies" option while publishing.
  5. Now if check "Use fixed naming and single page assemblies" option while publishing then our "c:\wpPublish\bin" would look like as:

    From the above screen shot, it is clear that separate dll files are created for the code behind files of every .aspx page.
  6. Now in this case if you change the code behind i.e. any .aspx.vb file code, then after republishing you will notice that the names of the dll file would not change and you just have to upload only that dll file, whose .aspx.vb file is changed.

For any feedback or suggestion please contact at: customersupport@firstclass-writeups.org, your valuable suggestion would be highly appreciated.

Above tutorial is the property of firstclass-writeups.org

"I learned three important things in college to use a library, to memorize quickly and visually, to drop asleep at any time given a horizontal surface and fifteen minutes. What I could not learn was to think creatively on schedule."
Agnes De Mille
Testimonials
sir, I am impressed. Thank you.
- William, J. Dallas.

Dear Writer, a marvellous job.
- Susan. New York.

this is the first time i used your service, consider me your regular customer.
- Brooke, R. London.

I am happy to recieve positive feedback from ma professor, thanks!
- sophie, chicago.

I recieved the paper on time, good work!
- Ali, Ontario
Latest Topics
Creating ASP.Net website setup... Read
What is sports sponsorship and is it effective?... Read
Strengths and Weakness of Internal Marketing... Read
All
About Us | FAQ | Contact Us | Newsletter | Free Tutorials
© 2008 Firstclass Writeups - All rights reserved.