在IIS7集成模式中,当我们在Global.asax的Application_Start中使用HttpContext.Current.Request.ApplicationPath获得当前虚拟目录路径,会得到以下的错误:
Server Error in '/IIS' Application.
Request is not available in this context
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.Web.HttpException: Request is not available in this context
Source Error:
Line 6: { Line 7: // Code that runs on application startup Line 9: } Line 10: |