Discuz!NT官方社区

首页 » Discuz!NT交流与讨论 » BUG 反馈 » 未将对象引用设置到对象的实例
steven9801 - 2008-4-8 10:16:00
论坛版本: Discuz!NT 2.0.1214    .net框架版本:1.1 Windows版本:win2003server
问题描述:点主题贴都正常,类似这级的页面:showforum-48.aspx;而点帖子页面出错:“未将对象引用设置到对象的实例”,类似这级的页面:showtopic-45979.aspx。重启下IIS就正常了。但是不知道啥时候它又会出现同样的错误!请教官方是啥原因呀???
steven9801 - 2008-4-8 10:19:00
咋没人回答呀!
steven9801 - 2008-4-8 10:20:00
个人觉得是配置文件读写问题!
steven9801 - 2008-4-8 10:22:00
戏水兄,能否回答下啥原因呀??
steven9801 - 2008-4-10 9:23:00
论坛版本: Discuz!NT 2.0.1214    .net框架版本:1.1 Windows版本:win2003server
问题描述:点主题贴都正常,类似这级的页面:showforum-48.aspx;而点帖子页面出错:“未将对象引用设置到对象的实例”,类似这级的页面:showtopic-45979.aspx。重启下IIS就正常了。但是不知道啥时候它又会出现同样的错误!请教官方是啥原因呀???
具体错误:
“/”应用程序中的服务器错误。
--------------------------------------------------------------------------------

未将对象引用设置到对象的实例。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。

源错误:

生成此未处理异常的源代码只能在调试模式中进行编译时显示。若要启用该功能,请执行以下步骤之一,然后请求 URL:

1. 在生成错误的文件的顶部添加一个“Debug=true”指令。示例:

  <%@ Page Language="C#" Debug="true" %>

或者:

2. 将以下节添加到应用程序的配置文件中:

<configuration>
  <system.web>
      <compilation debug="true"/>
  </system.web>
</configuration>

请注意,第二种方法将使给定应用程序中的所有文件在调试模式下进行编译。第一种方法只使特定文件在调试模式下进行编译。

重要事项:以调试模式运行应用程序肯定会引起内存/性能系统开销。在部署到产品方案中之前,应该确保应用程序已禁用调试。 

堆栈跟踪:


[NullReferenceException: 未将对象引用设置到对象的实例。]
  Discuz.Forum.TopicStats.GetStoredTopicViewCount(Int32 tid)
  Discuz.ForumPage.showtopic.ShowPage()
  Discuz.Web.UI.Pages.BasePage..ctor()
  Discuz.ForumPage.showtopic..ctor()
  ASP.showtopic_aspx..ctor() +6

[TargetInvocationException: 调用的目标发生了异常。]
  System.RuntimeType.CreateInstanceImpl(Boolean publicOnly) +0
  System.Activator.CreateInstance(Type type, Boolean nonPublic) +66
  System.Web.UI.TemplateControlParser.GetCompiledInstance(String virtualPath, String inputFile, HttpContext context) +164

[HttpException (0x80004005): 未能创建类型为“ASP.showtopic_aspx”的页。]
  System.Web.UI.TemplateControlParser.GetCompiledInstance(String virtualPath, String inputFile, HttpContext context) +340
  System.Web.UI.PageParser.GetCompiledPageInstanceInternal(String virtualPath, String inputFile, HttpContext context) +43
  System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String path) +44
  System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, String path, String pathTranslated, Boolean useAppConfig) +698
  System.Web.MapHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +95
  System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +173




--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:1.1.4322.2407; ASP.NET 版本:1.1.4322.2407
steven9801 - 2008-4-10 9:29:00
请教,谢谢!
http://sh.tg28.com/bbs/showforum-207.aspx点主题贴,就会出现上面的错误
steven9801 - 2008-4-10 9:51:00
我现在重起IIS暂时解决问题了,但这解决不了根本问题呀
steven9801 - 2008-4-10 9:56:00


引用:
原帖由 steven9801 于 2008-4-8 10:16:00 发表
论坛版本: Discuz!NT 2.0.1214    .net框架版本:1.1 Windows版本:win2003server
问题描述:点主题贴都正常,类似这级的页面:showforum-48.aspx;而点帖子页面出错:“未将对象引用设置到对象的实例”,类似这级的页面:show


“/”应用程序中的服务器错误。
--------------------------------------------------------------------------------

未将对象引用设置到对象的实例。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。

源错误:

生成此未处理异常的源代码只能在调试模式中进行编译时显示。若要启用该功能,请执行以下步骤之一,然后请求 URL:

1. 在生成错误的文件的顶部添加一个“Debug=true”指令。示例:

  <%@ Page Language="C#" Debug="true" %>

或者:

2. 将以下节添加到应用程序的配置文件中:

<configuration>
  <system.web>
      <compilation debug="true"/>
  </system.web>
</configuration>

请注意,第二种方法将使给定应用程序中的所有文件在调试模式下进行编译。第一种方法只使特定文件在调试模式下进行编译。

重要事项:以调试模式运行应用程序肯定会引起内存/性能系统开销。在部署到产品方案中之前,应该确保应用程序已禁用调试。 

堆栈跟踪:


[NullReferenceException: 未将对象引用设置到对象的实例。]
  Discuz.Forum.TopicStats.GetStoredTopicViewCount(Int32 tid)
  Discuz.ForumPage.showtopic.ShowPage()
  Discuz.Web.UI.Pages.BasePage..ctor()
  Discuz.ForumPage.showtopic..ctor()
  ASP.showtopic_aspx..ctor() +6

[TargetInvocationException: 调用的目标发生了异常。]
  System.RuntimeType.CreateInstanceImpl(Boolean publicOnly) +0
  System.Activator.CreateInstance(Type type, Boolean nonPublic) +66
  System.Web.UI.TemplateControlParser.GetCompiledInstance(String virtualPath, String inputFile, HttpContext context) +164

[HttpException (0x80004005): 未能创建类型为“ASP.showtopic_aspx”的页。]
  System.Web.UI.TemplateControlParser.GetCompiledInstance(String virtualPath, String inputFile, HttpContext context) +340
  System.Web.UI.PageParser.GetCompiledPageInstanceInternal(String virtualPath, String inputFile, HttpContext context) +43
  System.Web.UI.PageHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String path) +44
  System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, String path, String pathTranslated, Boolean useAppConfig) +698
  System.Web.MapHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +95
  System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +173




--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:1.1.4322.2407; ASP.NET 版本:1.1.4322.2407
戏水 - 2008-4-10 10:11:00
楼主 您的版本比较陈旧 , 建议您升级到最新版本 。当然 升级前请做好备份。 很多问题已经在新版本中进行了修正。
1
查看完整版本: 未将对象引用设置到对象的实例