在后台有这么一句话:
doc.Close(ref doNotSaveChanges, ref missingValue, ref missingValue);vs运行的时候,没有错误.但是iis发布之后,就会出错未将对象引用设置到对象的实例。说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。源错误:
行 146: object missingValue = Type.Missing;
行 147: object doNotSaveChanges = Microsoft.Office.Interop.Word.WdSaveOptions.wdDoNotSaveChanges;
行 148: doc.Close(ref doNotSaveChanges, ref missingValue, ref missingValue);
行 149: appWord.Application.Quit(ref miss, ref miss, ref miss);
行 150: doc = null;源文件: e:\10.24\yuxuelitable\ncjttdsyqmjdrb_cx.aspx.cs 行: 148 堆栈跟踪:
[NullReferenceException: 未将对象引用设置到对象的实例。]
ncjttdsyqmjdrb_cx.GridView1_RowEditing(Object sender, GridViewEditEventArgs e) in e:\10.24\yuxuelitable\ncjttdsyqmjdrb_cx.aspx.cs:148
System.Web.UI.WebControls.GridView.OnRowEditing(GridViewEditEventArgs e) +133
System.Web.UI.WebControls.GridView.HandleEdit(Int32 rowIndex) +43
System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +611
System.Web.UI.WebControls.GridView.RaisePostBackEvent(String eventArgument) +207
System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565版本信息: Microsoft .NET Framework 版本:2.0.50727.4971; ASP.NET 版本:2.0.50727.4971
doc.Close(ref doNotSaveChanges, ref missingValue, ref missingValue);vs运行的时候,没有错误.但是iis发布之后,就会出错未将对象引用设置到对象的实例。说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。源错误:
行 146: object missingValue = Type.Missing;
行 147: object doNotSaveChanges = Microsoft.Office.Interop.Word.WdSaveOptions.wdDoNotSaveChanges;
行 148: doc.Close(ref doNotSaveChanges, ref missingValue, ref missingValue);
行 149: appWord.Application.Quit(ref miss, ref miss, ref miss);
行 150: doc = null;源文件: e:\10.24\yuxuelitable\ncjttdsyqmjdrb_cx.aspx.cs 行: 148 堆栈跟踪:
[NullReferenceException: 未将对象引用设置到对象的实例。]
ncjttdsyqmjdrb_cx.GridView1_RowEditing(Object sender, GridViewEditEventArgs e) in e:\10.24\yuxuelitable\ncjttdsyqmjdrb_cx.aspx.cs:148
System.Web.UI.WebControls.GridView.OnRowEditing(GridViewEditEventArgs e) +133
System.Web.UI.WebControls.GridView.HandleEdit(Int32 rowIndex) +43
System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +611
System.Web.UI.WebControls.GridView.RaisePostBackEvent(String eventArgument) +207
System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565版本信息: Microsoft .NET Framework 版本:2.0.50727.4971; ASP.NET 版本:2.0.50727.4971
解决方案 »
- 视频转换
- vista下运行asp.net报错,请问为什么?
- 求树型表格控件的思路或源码(类似project分解任务的那种)
- 如何将DataSet 的数据全部写入到数据库中啊?
- 我用TEXTBOX控件把文字输入数据库,又用LABEL控件显示出来,但是文字没有分段,都连在一块了。
- 用javascript做的推拉门式的导航条
- DataGrid1.CurrentPageIndex = e.NewPageIndex;这个怎么写不上去啊.
- js和.net结合的问题
- ==========怎么才能把ADODB.DLL生成托管对象Interop.adodb.dll==================
- 一个querystring的问题。这是不是.net的bug?
- asp.net资源文件问题,命名空间“Resources”已经包含了“lang”的定义
- 如何在网页中输入和显示数学公式?
是否定义为 object了
输出值看看
定义为object了,改成false,也不行。还有没有其他的原因,比如权限什么的?
这个确实安装的是office 07 。