开发者社区> 问答> 正文

使用LiteDB的项目发布到服务器上(iis6)就报错了?报错

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.NullReferenceException: Object reference not set to an instance of an object.

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:  

[NullReferenceException: Object reference not set to an instance of an object.]
   LiteDB.IndexNode.IsHeadTail(CollectionIndex index) +95
   LiteDB.<FindAll>d__2.MoveNext() +212
   LiteDB.<Find>d__9.MoveNext() +265
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +327
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +58
   MidOperator.LiteDB.OP.LiteDBOP.FindAll() +173
   MidOperator.Filter.Filters.GrabArtilceFilter.ArticleFilter(String contents, String newstr) +44
   syzjbg.NewAdmin.ArticleManage.EditGrabArticle.GetSingleArticleInfo() +89
   syzjbg.NewAdmin.ArticleManage.EditGrabArticle.OnLoad(EventArgs e) +91
   System.Web.UI.Control.LoadRecursive() +61
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1966


Version Information:  Microsoft .NET Framework Version:4.0.30128; ASP.NET Version:4.0.30128.1

展开
收起
爱吃鱼的程序员 2020-06-14 15:23:04 683 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    我也有遇到这个问题,目前还没有找到问题所在,只是会在部分电脑上出现。而且调试的时候没问题,运行的时候才会出现。找到问题所在了,你在VS的编译选项中去掉对“优化代码”的勾选,再编译生成即可正常。希望能对你有用。

    2020-06-14 15:23:22
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
如何运维千台以上游戏云服务器 立即下载
网站/服务器取证 实践与挑战 立即下载
ECS计算与存储分离架构实践 立即下载