When porting an earlier version of net to IIS In window7, the following error occurs:
"/" Indicates a server error in the application.
The request is unavailable in this context
Note:An error occurred while executing the current Web request. Check the stack trace information for details about the error and the source of the error in the code.
Exception details:System. Web. httpexception: the request is unavailable in this context
This is really strange, because it is okay to debug the program. It can be determined that this is definitely irrelevant to the project itself, that is, it is related to the environment, that is, it should be the iis7 problem.
Searching for the Internet for half a day: the problem is very simple, that is, the Web application pool configuration error. This error should be unique to iis7.
Solution:
Choose iis7-> current application virtual directory-> right-click-> Manage application-> Advanced Settings
Modify the application pool attribute: ultapppool is classic. Net apppool (that is, classic.
Or directly go to the application pool, double-click defaultapppool, and change "managed pipeline mode" to "classic" in the pop-up window. Just exit.
Note:
In IIS 7, the application pool has two running modes: integration mode and classic mode. The application pool mode affects how the server processes managed code requests. If a hosted application runs in an integrated application pool, the server uses the IIS and ASP. NET integrated request processing pipelines to process requests. However, if the hosted application runs in a classic-mode application pool, the server will continue to host code requests through the aspnet_isapi.dll route, the method for processing requests is the same as that for applications running in IIS 6.0.
For more information about the integration mode in the managed pipeline mode of the IIS 7 Application pool, see ASP. NET 3.0 advanced programming.