asp.net 2.0 two modes of website and Web application What's the good?

Source: Internet
Author: User
Tags stack trace

The company's Web site is being transformed recently, mainly because the 2.0 website model often causes incomprehensible compilation errors and system crashes; According to colleagues, a DotNetNuke project that they are developing faces the same problem, and always appears randomly, unable to find the cause. One of the main problems is this:

Loading this Assembly would produce a different grant set to other instances.
(Exception from hresult:0x80131401)

Description:an unhandled exception occurred during the execution of the current Web request.
Please review the "stack Trace for" Information about the error and where it originated in the code.

You may have seen this mistake, the problem is that when this problem occurs, you do not know exactly that the file's line of code caused the error, especially on a >10g website. So we can only IISReset and delete asp.net temporary files. This lasted for about 2 months, and later we found that the error would not have happened as long as no one had updated the files on the site. In general it appears that after a file has been updated, the site is compiling its own process.

When Vs2005 was released, the website development model was one of the most important bright spots, but in practice we found that the website model did provide a lot of convenience for development, such as directly modifying any code-behind and App_Code code. Without the need for a new compilation. But it's a bit of a mistake to do so in a way that is already running on the production server. The main problem is that when the programmer modifies the Code upload, the site itself will be compiled from the new, but also have multiple external access, it is very easy to cause the entire compilation process confusion. The other problem is that it's very dangerous for programmers to wait until the site compiles itself to see if the code they're modifying is correct.

Based on these issues, we decided to deploy the Web site in the application mode of the Web. WebApp is the default development mode in ASP.net 1.1, but is not found in the original version of VS2005, you need to install hotfix and plug-in to use this feature.

Install "MS Visual Studio Hotfixes"

Install "VS2005 Web application Projects"

http://www.microsoft.com/downloads/details.aspx?FamilyId=8B05EE00-9554-4733-8725-3CA89DD9BFCA&displaylang=en

Install "VS2005 Web deployment Projects"

http://msdn.microsoft.com/asp.net/reference/infrastructure/wdp/


Figure: After the installation is complete you will find a Long-lost Web application project type

But for an existing project based on website mode, you can use the shortcut menu to convert it to WebApp, and you'll find that the Bin folder is back after the new compilation.

I personally think it's a good choice to use the VS2005 website model, but if you want to deploy, especially if the site project is very large, use the Web application mode; At the very least, you know for sure whether the site compiles , it is clear where all the required files are, and also eliminates the delay in dynamic compilation of the Web site, and has a certain advantage in performance.

Related Article

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.