找到你要的答案

Q:Object reference not set to an instance of an object - VS2010 vs VS2013

Q:未将对象引用设置到对象的实例VS2010与下

I am getting the following exception in an application using Framework 4.0. The exception only occurs when I am running the application using visual studio 2010, opening the application with Visual Studio 2013 it works without any problem (using Managed Pipeline Mode Integrated or classic).

The modules are registered for system.web/httpModules and system.webServer modules.

If I downgrade Framework 3.5 then works fine in Visual studio 2010.

Main problem is that, I am not able to trace the error, as it looks that the error is internal, I am not able to check what exactly chunk of code VS2010 does not like it.

If anyone can give some hints it'll be very appreciated.

Server Error in '/' Application.

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.

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

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.] Microsoft.VisualStudio.WebHost.Connection.get_RemoteIP() +0 Microsoft.VisualStudio.WebHost.Request.GetRemoteAddress() +68 System.Web.HttpWorkerRequest.IsLocal() +16
System.Web.HttpRequest.get_IsLocal() +13
Microsoft.VisualStudio.Web.PageInspector.Runtime.Tracing.PageInspectorHttpModule.OnPreRequestHandlerExecute(Object sender, EventArgs e) +98
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34248

I am getting the following exception in an application using Framework 4.0. The exception only occurs when I am running the application using visual studio 2010, opening the application with Visual Studio 2013 it works without any problem (using Managed Pipeline Mode Integrated or classic).

该模块是注册system.web/httpmodules和system.webserver模块。

如果我降级框架3.5,然后在Visual Studio 2010工程罚款。

主要的问题是,我不能够跟踪误差,看起来,错误是内部的,我不能检查什么代码块VS2010不喜欢它。

如果有人能给我一些提示,我会很感激。

服务器错误在“/”应用程序。

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.

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

源误差:

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.

堆栈跟踪:

[NullReferenceException: Object reference not set to an instance of an object.] Microsoft.VisualStudio.WebHost.Connection.get_RemoteIP() +0 Microsoft.VisualStudio.WebHost.Request.GetRemoteAddress() +68 System.Web.HttpWorkerRequest.IsLocal() +16
System.Web.HttpRequest.get_IsLocal() +13
Microsoft.VisualStudio.Web.PageInspector.Runtime.Tracing.PageInspectorHttpModule.OnPreRequestHandlerExecute(Object sender, EventArgs e) +98
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34248

asp.net  visual-studio  nullreferenceexception