asp.net中的“服务器错误"/“应用程序"(相同的代码在测试服务器中正常工作) [英] Server Error in / Application in asp.net (the same code is working fine in test server)

查看:52
本文介绍了asp.net中的“服务器错误"/“应用程序"(相同的代码在测试服务器中正常工作)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

发布网站代码时出现以下错误.

I am getting the following error when i publish the website code.

对象引用未设置为对象的实例.说明:执行当前Web请求期间发生未处理的异常.请查看堆栈跟踪,以获取有关错误及其在代码中起源的更多信息.

Object reference not set to an instance of an object. 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:对象引用未设置为对象的实例.

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

源错误:

[没有相关的源代码行]

[No relevant source lines]

源文件:c:\ WINDOWS \ Microsoft.NET \ Framework64 \ v2.0.50727 \ Temporary ASP.NET Files \ dubs_test \ 4fc875e9 \ c05ca91a \ App_Web_dataentry.aspx.cdcab7d2.v9c2efde.0.cs行:0

Source File: c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\dubs_test\4fc875e9\c05ca91a\App_Web_dataentry.aspx.cdcab7d2.v9c2efde.0.cs Line: 0

堆栈跟踪:

[NullReferenceException:对象引用未设置为的实例对象.] DataEntry..ctor()+96 ASP.dataentry_aspx..ctor()在c:\ WINDOWS \ Microsoft.NET \ Framework64 \ v2.0.50727 \临时ASP.NET文件\ dubs_test \ 4fc875e9 \ c05ca91a \ App_Web_dataentry.aspx.cdcab7d2.v9c2efde.0.cs:0__ASP.FastObjectFactory_app_web_dataentry_aspx_cdcab7d2_v9c2efde.Create_ASP_dataentry_aspx()在c:\ WINDOWS \ Microsoft.NET \ Framework64 \ v2.0.50727 \ Temporary ASP.NET中文件\ dubs_test \ 4fc875e9 \ c05ca91a \ App_Web_dataentry.aspx.cdcab7d2.v9c2efde.1.cs:0System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPathvirtualPath,类型requiredBaseType,HttpContext上下文,布尔值allowCrossApp,布尔值noAssert)+146
System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext上下文,字符串requestType,VirtualPath,virtualPath,字符串physicalPath)+62System.Web.HttpApplication.MapHttpHandler(HttpContext上下文,字符串requestType,VirtualPath路径,String pathTranslated,布尔useAppConfig)+573
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()+182 System.Web.HttpApplication.ExecuteStep(IExecutionStep步骤,布尔值和已完成同步)+276

[NullReferenceException: Object reference not set to an instance of an object.] DataEntry..ctor() +96 ASP.dataentry_aspx..ctor() in c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\dubs_test\4fc875e9\c05ca91a\App_Web_dataentry.aspx.cdcab7d2.v9c2efde.0.cs:0 __ASP.FastObjectFactory_app_web_dataentry_aspx_cdcab7d2_v9c2efde.Create_ASP_dataentry_aspx() in c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\dubs_test\4fc875e9\c05ca91a\App_Web_dataentry.aspx.cdcab7d2.v9c2efde.1.cs:0 System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +146
System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +62 System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +573
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +182 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +276

推荐答案

请确保您在测试服务器和生产服务器中都具有相同的数据库对象和配置设置.

please make sure you have same database objects, configuration settings in both test and production server.

这篇关于asp.net中的“服务器错误"/“应用程序"(相同的代码在测试服务器中正常工作)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆