一个关于Global文件的错误

Amigo2003 2003-09-15 11:05:55
打开网页就出现这种错误:
未能加载类型“Wrox.ThePhile.Web.Global
源错误:


行 1: <%@ Application Codebehind="Global.asax.cs" Inherits="Wrox.ThePhile.Web.Global" %>

Global是在Wrox.ThePhile.Web空间下定义的一个类


...全文
91 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
jjcccc 2003-09-15
  • 打赏
  • 举报
回复
看看你Gloabl.asax.cs关于Gloabl类的定义和所属命名空间对不对:
using System;
using System.Diagnostics;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.SessionState;

namespace Wrox.ThePhile.Web
{
/// <summary>
/// Summary description for Global.
/// </summary>
public class Global : System.Web.HttpApplication
{
public Global()
{
InitializeComponent();
}

protected void Application_Start(Object sender, EventArgs e)
{

}

protected void Session_Start(Object sender, EventArgs e)
{

}

protected void Application_BeginRequest(Object sender, EventArgs e)
{

}

protected void Application_EndRequest(Object sender, EventArgs e)
{

}

protected void Application_AuthenticateRequest(Object sender, EventArgs e)
{

}

protected void Application_Error(Object sender, EventArgs e)
{
string errMsg = "<link rel=\"stylesheet\" href=\"/ThePhile/Styles/ThePhile.CSS\">";
errMsg += "<h1>Application Error</h1><hr/>An unexpected error has occurred in this Application. The system " +
"administrators have been notified. Please feel free to contact us with the information " +
"surrounding this error.<br/>"+
"The error occurred in: "+Request.Url.ToString()+"<br/>"+
"Error Message: <font class=\"ErrorMessage\">"+Server.GetLastError().Message.ToString()+"</font><hr/>"+
"<b>Stack Trace:</b><br/>"+
Server.GetLastError().ToString();

Response.Write( errMsg );

if (!EventLog.SourceExists("ThePhile.COM"))
{
EventLog.CreateEventSource("ThePhile.COM", "Application");
}
EventLog.WriteEntry("ThePhile.COM", Server.GetLastError().Message, EventLogEntryType.Error);

Server.ClearError();
}

protected void Session_End(Object sender, EventArgs e)
{

}

protected void Application_End(Object sender, EventArgs e)
{

}

#region Web Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
}
#endregion
}
}

wkyjob 2003-09-15
  • 打赏
  • 举报
回复
表示沉默.

110,526

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧