一个网上系统,在XP里发布都是正常的.但是在WINDOWS 2003中发布 总是提示 "未将对象引用设置到对象的实例"的错误 具体信息如下 请问高手们如何解决之.
未将对象引用设置到对象的实例。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。源错误:
行 52: string password = StrUtils.InputText(txtPassword.Text, 50);
行 53:
行 54: Account account = AccountService.GetInstance().GetAccount(userId, password);
行 55:
行 56: //If login is successful then store the state in session and redirect
源文件: d:\powerwms3\subprojects\powerwms.msi\web\login.aspx.cs 行: 54 堆栈跟踪:
[NullReferenceException: 未将对象引用设置到对象的实例。]
Msi.Services.AccountService..ctor() +36
Msi.Services.AccountService..cctor() +20[TypeInitializationException: “Msi.Services.AccountService”的类型初始值设定项引发异常。]
Msi.Services.AccountService.GetInstance() +0
Msi.Web.Login.cmdLogin_Click(Object sender, ImageClickEventArgs e) in d:\powerwms3\subprojects\powerwms.msi\web\login.aspx.cs:54
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +109
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +69
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:1.1.4322.573; ASP.NET 版本:1.1.4322.573
未将对象引用设置到对象的实例。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。源错误:
行 52: string password = StrUtils.InputText(txtPassword.Text, 50);
行 53:
行 54: Account account = AccountService.GetInstance().GetAccount(userId, password);
行 55:
行 56: //If login is successful then store the state in session and redirect
源文件: d:\powerwms3\subprojects\powerwms.msi\web\login.aspx.cs 行: 54 堆栈跟踪:
[NullReferenceException: 未将对象引用设置到对象的实例。]
Msi.Services.AccountService..ctor() +36
Msi.Services.AccountService..cctor() +20[TypeInitializationException: “Msi.Services.AccountService”的类型初始值设定项引发异常。]
Msi.Services.AccountService.GetInstance() +0
Msi.Web.Login.cmdLogin_Click(Object sender, ImageClickEventArgs e) in d:\powerwms3\subprojects\powerwms.msi\web\login.aspx.cs:54
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +109
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +69
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:1.1.4322.573; ASP.NET 版本:1.1.4322.573
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货