PDA

View Full Version : سوال: پیغام خطا Exception Details: System.Web.HttpException:



scarce
دوشنبه 16 آبان 1390, 00:07 صبح
سلام خدمت تمام اساتید و کاربران سایت

دوستان عزیز من با یک مشکلی برخوردم که شرح مشکل به شکل زیر می باشد

1_ من یک وب سایت طراحی کردم با VB در ASP.NET و بعد از ساختن و تست در لوکال پروژه رو کامپایل کردم و روی هاست انتقال دادم

2_ دیتابیس مربوط رو هم در هاست ، بعد از ساختن بانک اطلاعاتی ( sql server ) ،ریستور کردم
تا اینجای کار همه چی درسته حتی تو قسمت WebAdmin هم تست کردم تمامی جدول ها و sp ها ریستور شده است
3_از کانکشن استرینک زیر برای وصل شدن به دیتابیس استفاده کردم در web.config


Data Source=localhost;Initial Catalog=Bankx;User ID=cmsT1;password:111222;Integrated Security=True


کد مربوط به فایل ل Global.asax بصورت زیر هست




<%@ Application Language="VB" %>
<%@ Import Namespace="System.Web" %>

<%@ Import Namespace="System.Security.Principal" %>
<%@ Import Namespace="SC.classes.STrack" %>
<script runat="server"><script runat="server">
Protected Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
Dim MC As New STrack
Dim UrlR As String
If Not HttpContext.Current.Request.UrlReferrer Is Nothing Then
UrlR = HttpContext.Current.Request.UrlReferrer.ToString
End If
MC.ReferURL = UrlR
MC.IP = HttpContext.Current.Request.UserHostAddress.ToStri ng
MC.Add()
MC = Nothing
End Sub
Protected Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
Dim Func As New Func
Dim Msg As String
Msg = "APP Error ... <br/><br/>"
Msg += "Error In Path : " & HttpContext.Current.Request.Path.ToString
Msg += "<br/><br/>Error Raw URL : " & HttpContext.Current.Request.RawUrl.ToString
Dim MyError As Exception = Server.GetLastError
Msg += "<br/><br/>Error Msg : " & MyError.Message.ToString
Msg += "<br/><br/>Error Source : " & MyError.Source.ToString
Msg += "<br/><br/>Error Stack Trace : " & MyError.StackTrace.ToString
Msg += "<br/><br/>Target Site : " & MyError.TargetSite.ToString
Msg += "<br/><br/>IP Address = " & HttpContext.Current.Request.UserHostAddress.ToStri ng

If HttpContext.Current.Request.Path.ToString.IndexOf("Admin") < 0 Or HttpContext.Current.Request.Path.ToString.IndexOf("User") < 0 Then
Response.Redirect("exrr.htm", True)
Else
Response.Redirect("../exrr.html", True)
End If
Func = Nothing
End Sub
Protected Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As EventArgs)
If Not HttpContext.Current.User Is Nothing Then
If HttpContext.Current.User.Identity.IsAuthenticated Then
If HttpContext.Current.User.Identity.AuthenticationTy pe = "Forms" Then
Dim ID As FormsIdentity = HttpContext.Current.User.Identity
Dim Ticket As FormsAuthenticationTicket = ID.Ticket
Dim UserData As String = Ticket.UserData
Dim Roles As String() = UserData.Split(",")
HttpContext.Current.User = New GenericPrincipal(ID, Roles)
End If
End If
End If
End Sub
</script>






موقع لود صفحه در هاست با پیغام زیر مواجه میشم به نظر شما مشکل از کجاست



Server Error in '/' 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:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): Request is not available in this context] System.Web.HttpContext.get_Request() +8794352 ASP.global_asax.Application_Start(Object sender, EventArgs e) +44 [HttpException (0x80004005): Request is not available in this context] System.Web.HttpApplicationFactory.EnsureAppStartCa lledForIntegratedMode(HttpContext context, HttpApplication app) +2722614 System.Web.HttpApplication.RegisterEventSubscripti onsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +128 System.Web.HttpApplication.InitSpecial(HttpApplica tionState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +188 System.Web.HttpApplicationFactory.GetSpecialApplic ationInstance(IntPtr appContext, HttpContext context) +295 System.Web.HttpApplicationFactory.GetPipelineAppli cationInstance(IntPtr appContext, HttpContext context) +56 System.Web.Hosting.PipelineRuntime.InitializeAppli cation(IntPtr appContext) +231 [HttpException (0x80004005): Request is not available in this context] System.Web.HttpRuntime.FirstRequestInit(HttpContex t context) +8897503 System.Web.HttpRuntime.EnsureFirstRequestInit(Http Context context) +85 System.Web.HttpRuntime.ProcessRequestNotificationP rivate(IIS7WorkerRequest wr, HttpContext context) +333


Version Information: Microsoft .NET Framework Version:2.0.50727.4216; ASP.NET Version:2.0.50727.4209