【问题标题】:ASP.NET Web Application Not Working After DevelopmentASP.NET Web 应用程序在开发后不工作
【发布时间】:2014-01-12 15:43:37
【问题描述】:

我是 ASP.NET 的新手,刚刚被分配为公司的 CMS(内容管理系统)Web 应用程序(用 c#.net 编写)创建安装程序。

在任何客户的服务器上使用Xcopy 开发时都可以正常工作。但是,我在VS2010中创建了.msi安装程序并安装了应用程序后,里面的一些web表单无法显示,异常如下:


'/cms-vodoke' 应用程序中的服务器错误。

对象引用未设置为对象的实例。

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. 

异常详情:

System.NullReferenceException: Object reference not set to an instance of an object.

来源错误:

[No relevant source lines]

Source File: c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\cms-vodoke\9f7fc69b\77cb7e4\App_Web_nlj0wmz0.7.cs    Line: 0 

堆栈跟踪:

[NullReferenceException: Object reference not set to an instance of an object.]

CuteEditor.Impl.b..ctor(Type type, String key) +77
CuteEditor.a.i(HtmlTextWriter A_0) +156
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +11249515
ASP.cmscontrol_cm_rteditor_catwallpaper_ascx.__RenderuiRTEditor(HtmlTextWriter __w,     Control parameterContainer) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\cms-vodoke\9f7fc69b\77cb7e4\App_Web_nlj0wmz0.7.cs:0
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +130
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +11249515
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +245
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +11249515
ASP.cmsadmin_cm_category_form_aspx.__RenderpgContent1(HtmlTextWriter __w, Control parameterContainer) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET    Files\cms-vodoke\9f7fc69b\77cb7e4\App_Web_xq4tbmg1.0.cs:0
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +130
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +11249515
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +245
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +314
System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +47
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +11249515
ASP.cmsadmin_system_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\inetpub\wwwroot\cms-vodoke\cmsadmin\system.master:28
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +130
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +11249515
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +245
System.Web.UI.Page.Render(HtmlTextWriter writer) +39
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)    +11249515
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5273

Web 设置项目构建良好,安装没有任何问题,但应用程序无法正常工作,即使在我的本地计算机上也是如此。我已经被这个绊倒了好几天了,

谁能帮我确定这个问题来自哪里?非常感谢。

【问题讨论】:

    标签: c# asp.net web-applications installation setup-deployment


    【解决方案1】:

    请转到部署应用程序的服务器并查看 Windows 事件日志。您应该能够在那里看到详细的事件日志。请粘贴与您的应用程序相关的内容,以便我们查看发生了什么。

    【讨论】:

      【解决方案2】:

      这不是显示错误是什么以及抛出它的原因的行。由于没有要阅读的代码行,我也很难找到错误的根源。

      一般来说,当您尝试引用空值或对象类型不是阶段预期的对象时,会引发此异常。这可能是您正在处理的依赖项或您为使该应用程序正常工作而拥有的程序集文件中的错误。

      页面是空的吗?可能会引发此错误的代码是什么?

      http://msdn.microsoft.com/en-us/library/system.nullreferenceexception(v=vs.110).aspx 到这里阅读异常信息。

      【讨论】:

      • 您好 Afzaal Ahmad Zeeshan,感谢您的回复。实际上我只是想知道在 IIS 中手动添加虚拟目录并运行时应用程序在什么情况下可以正常工作,但是在创建安装程序然后安装并运行后抛出此异常。因为 VS2010 中的预构建过程进展顺利,所以我只是不明白哪一部分是错误的。谢谢。
      • 页面不是空的,是一个普通的web表单,后面有C#代码。在构建设置项目时,我通过选择应用程序文件夹下的内容输出和主输出来添加项目输出。然后我得到警告:两个或多个对象具有相同的目标位置('[targetdir]\bin\gembox.spreadsheet.dll')。那么这会导致程序集文件错误吗?我不确定如何检查依赖项是否正常工作。谢谢。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-15
      • 1970-01-01
      相关资源
      最近更新 更多