VS2010 Publishing Web Site Technology Introduction _ Practical skills

Source: Internet
Author: User

VS2010 Web Site Publishing detailed
for VS2010, publishing the web is a fairly easy thing to do, and perhaps that is why there is little information about the details of the Web site being published online. However, these are what beginners need, and I'll give you a detailed introduction to the Web site publishing process.
First step: Right-click the Web application name (for example: Newssystem) In Solution Explorer--click Publish, as shown:

Step two: In the pop-up dialog box, publish method selection: File system, target location customization (such as: Select the desktop Test folder), check the "Delete all existing files before publishing" checkbox, and then click to Publish. As shown in figure:

Add: In the second step of the "Publish Web" section, "Target Files" is where you want to select a folder that is not a project project.

Next we'll see the files we need under the Test folder, and the following is a comparison of the files in the test folder with the files in the original item:

Step Three: Publish the Web site in IIS. Right-click on the computer-manage, open the Computer Management window, and click Internet Information Services (IIS) Manager under Services and applications, as shown in the figure:

Step Fourth: Right-click the application pool, add the application pool, fill in the name in the Add Application Pool window that pops up, and the. NET Framework version is determined by the. NET Framework version you use for your development program.

Fifth step: Right click on "website", add a site, in the Add Web Site window, fill in the site name, the application pool select the new application pool, the physical path to the second step output folder, "link to" Select a specific user, and enter your username and password, IP address to populate the native IP. sure you can. As shown in the figure:

So far, our web site has been published successfully, this time we can enter the Web site through the browser to view our website.

VS2010 Publish Web site problem detailed

If you set all the better, read the above article your site has been published, in the local area network has been able to browse. However, usually if you are the first to publish, it should not be so smooth. Focus on the following:
The following conditions may occur when you enter a set IP address + port number in the Address bar.
problem one, asp.net settings that are not applicable in integrated managed piping mode are detected.

Workaround: Open IIS, select the application pool, and see that there is an action bar on the right that says "Set Application pool Defaults", click Enter, put "enable 32-bit applications" to true, and set "managed piping mode" to classic. As shown in figure

Issue two, the page you requested is not available because of the Web server's ISAPI and CGI Restrictions list setting.

Workaround: Open IIS, select the root directory, double-click ISAPI and CGI restrictions, and then set both ASP.net v4.0.30319 to allow. As shown in figure

Problem three, there are no accessible tables. Be sure to register at least one data model in Global.asax and enable the scaffolding, or implement a custom page.

Solution: Open the project, open the Global.asax file, under the RegisterRoutes method we can see the following content

Important: Data Model registration 
//cancellation of the comment for this line, registering the LINQ to SQL model for ASP.net Dynamic data.
//To set scaffoldalltables = True, the following conditions are required to
determine that you want all tables in the data model to support the scaffolding (that is, the template). To control the
//scaffolding of each table, create a partial class for the table and
apply the//[Scaffoldtable (True) attribute to the partial class.
//Note: Make sure to change "yourdatacontexttype" to the//name of the application's data context class
.
//model. Registercontext (typeof (Yourdatacontexttype), new Contextconfiguration () {scaffoldalltables = false});

After you have injected the code snippet, replace Yourdatacontexttype with the context you created, and scaffoldalltables to True, I use the part of the data that LINQ to SQL writes. That's what it looks like after the change.

Defaultmodel.registercontext (typeof (Bmscontextdatacontext), New Contextconfiguration ()

After you modify it, don't forget to republish it again.

Problem four, unable to open the database, login failed

Solution: This problem just came out when a bit Meng, thought is the issue of IIS settings, and then carefully look, vaguely feel déjà vu, by looking at the database connection, found that there is a problem connected to the database, and IIS settings Independent.

Solve the above several problems, once again after the release of the site, it can be normal access, and then in the same LAN with other machines on the verification, there is no problem.

Above is the whole content of this article, hope to be helpful to everybody's study.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.