2012-09-20 28 views
0

我复制并从一个服务器粘贴我的应用程序(正常工作)到另一台服务器(这是行不通的罚款)。.NET未处理的异常从母版

我得到这个新的服务器上,即使代码并没有改变:

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.] 
    MasterPagePS_Index.Page_Load(Object sender, EventArgs e) +117 
    System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 
    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 
    System.Web.UI.Control.OnLoad(EventArgs e) +99 
    System.Web.UI.Control.LoadRecursive() +50 
    System.Web.UI.Control.LoadRecursive() +141 
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627 
+1

调试完这个之后,你发现了什么,或者跟踪状态是什么? –

+1

您需要逐步完成这一点,并确定哪些空引用的来源是 – JDandChips

+0

它的作品在我的地方,我的旧服务器上的罚款,试图将此移动到新的一个 – cdub

回答

0

是不是访问一个数据库,文件或任何外部资源?听起来你有配置差异,请检查你的web.config。

+0

我在数据库中使用外部的东西。但这似乎是好的。我所有的组件也都在bin文件夹中。 – cdub

0

不要使用relative path在奥德访问您的ressource(文件,页面,风格,装配等...)

所以ASP.Net没有找到您的文件,扔空例外。

0

您提供的错误并不能提供多少信息。我建议你执行远程调试并检查哪一行导致错误。

也可以添加Global.asax文件和赶上的Application_Error错误并通过电子邮件发送错误给自己。

Dim ex As Exception = Server.GetLastError() 
Dim hue As System.Web.HttpUnhandledException = New System.Web.HttpUnhandledException(ex.Message, ex) 
Dim html As String = hue.GetHtmlErrorMessage() 
' TODO: Send the html string. This will send you the formatted html of the exception including the source of the error and stacktrace.