解决使用DevExpress开发错误:未将对象引用设置到对象的实例

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/upi2u/article/details/37763945


在使用DevExpress是总是会出现一些状况。这次同事在他的机器上调试完毕的代码发过来,却出现“未将对象引用设置到对象的实例”的错误,提示是Resources.resx的问题。还有一个提示是LC.exe错误。

LC.exe的问题好办,删除文件licenses.licx即可。

另外一个未设置对象的问题就不好办了,尝试过重新安装DevExpress,但是错误还是一样的。后来尝试修改Resources.resx这个文件,问题得到解决,具体就是将文件中“Version=4.0.0.0”改成“Version=2.0.0.0”就OK了,应该就是先后设置使用不同.Net版本的问题。


<resheader name="reader">
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
  <data name="back" type="System.Resources.ResXFileRef, System.Windows.Forms">
    <value>..\Resources\back.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
  </data>
  <data name="blank" type="System.Resources.ResXFileRef, System.Windows.Forms">
    <value>..\Resources\blank.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
  </data>
  ... 

 

 

 

展开阅读全文

未将对象引用设置对象实例错误

05-25

[code=C#]rnusing System;rnusing System.Collections;rnusing System.Configuration;rnusing System.Data;rnusing System.Web;rnusing System.Web.Security;rnusing System.Web.UI;rnusing System.Web.UI.HtmlControls;rnusing System.Web.UI.WebControls;rnusing System.Web.UI.WebControls.WebParts;rnpublic partial class Company : System.Web.UI.Pagernrn RGP.IBLL.Member memberBLL = new RGP.BLL.Member();rn protected RGP.Model.Member member = new RGP.Model.Member();rn RGP.Model.Device device = new RGP.Model.Device();rn RGP.IBLL.Device deviceBll = new RGP.BLL.Device();rn RGP.IBLL.DictInfo dictBLL = new RGP.BLL.DictInfo();rn RGP.IBLL.MemberVisit visitBLL = new RGP.BLL.MemberVisit();rn protected RGP.Model.MemberVisit visit = new RGP.Model.MemberVisit();rnrn protected void Page_Load(object sender, EventArgs e)rn rn if (!Page.IsPostBack)rn rn 代码省略...............rnrn rnrn visit.VisitID = Convert.ToInt32(memberBLL.get(Request.Cookies["login_MemberID"].Value));rn visit.MemberID =int.Parse(Request.QueryString["ID"]);rn visit.VisitTime = DateTime.Now;rn visit.VisitIP = RGP.Lib.StringHandle.GetIP();rn visitBLL.add(visit);rn rn rnrn[/code]rnrn报错 rnrnrn异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。rnrn源错误: rnrnrn行 46: rn行 47: rn行 48: [color=#FF0000]visit.VisitID = Convert.ToInt32(memberBLL.get(Request.Cookies["login_MemberID"].Value));[/color]rn行 49: visit.MemberID =int.Parse(Request.QueryString["ID"]);rn行 50: visit.VisitTime = DateTime.Now;rn rn 论坛

没有更多推荐了,返回首页