Hi
I have implemented the ASP.NET Club Site Starter Kit on my 1&1 web
space.
I have recently been getting some errors where the page doesn't load
and just comes up blank. I have put a handler on Application_Error in
global.asax to email me whenever an error occurs. Sometimes I get upto
100 in an hour which is rather concerning.
I have looked at the error message returned but I can't seem to work
out what's causing the error.
How can I debug the application to track down the error? I have quite
a bit of experience with VB.NET so I understand the concept of break
points and stack traces but it all seems a bit scary when it's on the
web.
I have included the code I have in my global.asax and the error message
I get at the bottom of this post. Should I try running the app on
local host or is there some sort of component or change I can make
somewhere to track down the error online?
Note: I didn't write the error notification code. Theres a line which
logs to an event log. Would it help if I un-comment this and see what
that does?
Regards, Carl Gilbert
****** EVENT HANDLER ******
Protected Sub Application_Error(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim objErr As Exception = Server.GetLastError.GetBaseException
Dim strMsg As String = "Error Caught in Application_Error
event\n" + _
"<br>Error in: <a href='" + Request.Url.ToString() + "'>" +
Request.Url.ToString() + "</a>" + _
"\n<br>Error Message:" + objErr.Message.ToString() + _
"\n\n<br><br>REMOTE_ADDR: " +
Request.ServerVariables("REMOTE_ADDR") + "</a>" + _
"\n<br>HTTP_ACCEPT_LANGUAGE: " +
Request.ServerVariables("HTTP_ACCEPT_LANGUAGE") + _
"\n<br>HTTP_REFERER: " +
Request.ServerVariables("HTTP_REFERER") + _
"\n<br>HTTP_USER_AGENT: " +
Request.ServerVariables("HTTP_USER_AGENT") + _
"\n<br>HTTP_COOKIE: " +
Request.ServerVariables("HTTP_COOKIE") + "\n\n\n<br><br>Stack Trace:" +
objErr.StackTrace.ToString
'EventLog.WriteEntry("Sample_WebApp",err,EventLogE ntryType.Error);
Server.ClearError()
Dim strSbj As String = "BWBFC Application Error"
ClubSiteMailer.Mailer.Send(strMsg, strSbj)
End Sub
****** ERROR MESSAGE ******
Error Caught in Application_Error event\n
Error in: http://bwbfc.co.uk/bb/default.aspx\n
Error Message:Request for the permission of type
'System.Security.Permissions.FileIOPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
failed.\n\n
REMOTE_ADDR: 217.37.196.9\n
HTTP_ACCEPT_LANGUAGE: en-gb\n
HTTP_REFERER: \n
HTTP_USER_AGENT: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
SV1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727; WinFX RunTime
3.0.50727)\n
HTTP_COOKIE: \n\n\n
Stack Trace: at System.Security.CodeAccessSecurityEngine.Check(Obj ect
demand, StackCrawlMark& stackMark, Boolean isPermSet) at
System.Security.CodeAccessPermission.Demand() at
System.IO.Path.GetFullPath(String path) at
System.Web.Util.FileUtil.IsSuspiciousPhysicalPath( String physicalPath,
Boolean& pathTooLong) at
System.Web.Util.FileUtil.IsSuspiciousPhysicalPath( String physicalPath)
at System.Web.CachedPathData.GetConfigPathData(String configPath) at
System.Web.CachedPathData.GetConfigPathData(String configPath) at
System.Web.CachedPathData.GetConfigPathData(String configPath) at
System.Web.CachedPathData.GetVirtualPathData(Virtu alPath virtualPath,
Boolean permitPathsOutsideApp) at
System.Web.HttpContext.GetPathData(VirtualPath path) at
System.Web.Security.UrlAuthorizationModule.IsUserA llowedToPath(HttpContext
context, VirtualPath virtualPath) at
System.Web.UI.Util.IsUserAllowedToPath(HttpContext context, VirtualPath
virtualPath) at
System.Web.SiteMapProvider.IsAccessibleToUser(Http Context context,
SiteMapNode node) at
System.Web.SiteMapNode.IsAccessibleToUser(HttpCont ext context) at
System.Web.StaticSiteMapProvider.GetChildNodes(Sit eMapNode node) at
System.Web.SiteMapNode.get_ChildNodes() at
System.Web.UI.WebControls.SiteMapDataSource.GetNod es() at
System.Web.UI.WebControls.SiteMapDataSource.GetPat hNodeCollection(String
viewPath) at System.Web.UI.WebControls.SiteMapDataSource.GetVie w(String
viewName) at
System.Web.UI.WebControls.SiteMapDataSource.System .Web.UI.IDataSource.GetView(String
viewName) at
System.Web.UI.WebControls.Repeater.ConnectToDataSo urceView() at
System.Web.UI.WebControls.Repeater.OnLoad(EventArg s e) at
System.Web.UI.Control.LoadRecursive() at
System.Web.UI.Control.LoadRecursive() at
System.Web.UI.Control.LoadRecursive() at
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at
System.Web.UI.Page.ProcessRequest(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at
System.Web.UI.Page.ProcessRequest() at
System.Web.UI.Page.ProcessRequestWithNoAssert(Http Context context) at
System.Web.UI.Page.ProcessRequest(HttpContext context) at
ASP.default_aspx.ProcessRequest(HttpContext context) at
System.Web.HttpApplication.CallHandlerExecutionSte p.System.Web.HttpApplication.IExecutionStep.Execut e()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously)