Publish websites ASP. NET (ASPX) and asp. netaspx
How does Insus. NET publish its own development website? I will share it with you today. Maybe your approach is the same as Insus. NET.
In this article, create a site in VS and then deploy it in IIS.
Generally, Insus. NET creates an Empty site. However, this article demonstrates how to create a site with an instance.
Refer to the following steps to put the site file inE: \ Projects \Directory.
A website with an instance has been created. No matter what the website is, we need to Build it before release to ensure that there are no errors.
Everything is normal and there are no errors:
Now you can publish Web Site:
In the Publish Web window, select Custom as the Profile in Step 1:
In the New Custom Profile window, mark 1 and enter "WS1" with the same site name.
In the Publish Web window, in step 2, Connection, mark 3, select File System, that is, issue with File System method. Target location: select a Target path.
In the Publish Web window, in step 2, Settings, Configuration, select Debug (select default), and in addition, choose the three Options of File Publish Options to get a new File in the future publish.
The following two lines of files show that Publish is successful:
The next step is the focus. I copy a copy of the Web program to a new location, such as disk D:
ThenDelete the directory App_Code.
Next, we will go to the publish directory and expand the Bin directory. We only need to copy the App_Code.dll file. That is to say, the above is a series of publish actions, we only want to App_Code.dll for this file.
Put it under the Directory D: \ WS1 \ bin above.
FinalD: \ WS1These files can be uploaded to the server for IIS deployment.
This directory contains fewer App_Code directories than the source file. However, the bin directory contains an additional App_Code.dll file, which is from the publish result.
The subsequent IIS deployment is similar to the IIS deployment of the http://www.cnblogs.com/insus/p/4466200.html of the simple ASP. net mvc release.
Press Win key + R key to run inetmgr:
In the Internet Information Services (IIS) Manager window, expand to the Default Web Site on the left, right click Add Application...
In the Add Application window, refer to the following mark and complete.
The release of the ASPX website is complete.
The key point is to delete the App_Code directory and copy the App_Code.dll file to the Bin directory.Obtain the deployment file.
In the future, you need to describe how to release and update your website.
In the first case, modify only the xxx. aspx file, for example:
In this case, you do not need to perform any publish actions. You only need to upload the About. aspx file to the directory corresponding to this file on the server and replace it with it.
Browsing result after modification:
In the second case, we modify the xxx. aspx and xxx. aspx. cs files.
Add a control in Default. aspx,
<asp:Label ID="LabelCurrentTime" runat="server" Text=""></asp:Label>
In the Page_Load event of Default. aspx. cs, add the Code:
this.LabelCurrentTime.Text = DateTime.Now.ToString();
At this time, no compilation is required. directly upload the Default. aspx and Default. aspx. cs files from the source program to the server and replace them.
View the results:
For example, xxx.aspx,xxx.aspx.cs,xxx.html, xxx. ASCX, xxx. ASCX. cs, etc. publish is required. After modification, copy and upload the file to the server for the network.
Finally, you have modified the code in App_Code, for example:
Add a Class, Test. cs. In the implementation environment, you may not add a new Class, but modify a Class. This is also the case:
Open the Contact. aspx page and modify and add the following content:
In the Contact. aspx. cs code page, add the following content:
At this point, we copy the Contact. aspx and Contact. aspx. cs to the server and replace the old file.You also need to publish the source program. And upload the new App_Code.dll to the bin directory of the server for replacement.
Then browse the modified Website:
The last thing to note is when you reference a new xxx program. dll, You have to upload the dll to the xxx. go to the dll Directory.