Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 

System.Web.PipelineModuleStepContainer.GetEventCount 에서 NullReferenceException 이 발생한다면?


참고로, HTTP 상태 코드는 500 을 반환하는데요. 웹 브라우저로 방문한 경우에는 단순하게 다음과 같이 예외가 발생합니다.

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.]
   System.Web.PipelineModuleStepContainer.GetEventCount(RequestNotification notification, Boolean isPostEvent) +30
   System.Web.PipelineStepManager.ResumeSteps(Exception error) +1503
   System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb) +133
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +597

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18033  

이에 대한 Q&A는 다음의 글에서 쉽게 확인할 수 있습니다. ^^

NullReferenceException on PipelineModuleStepContainer after deploying
; https://github.com/Glimpse/Glimpse/issues/174

따라서, 다음과 같이 BeginRequest 이벤트 핸들러를 Global.asax.cs에 걸어두었다면,

public class Global : System.Web.HttpApplication
{
    void Application_Start(object sender, EventArgs e)
    {
        this.BeginRequest += new EventHandler(Global_BeginRequest);
    }

    void Global_BeginRequest(object sender, EventArgs e)
    {
    }

    // ... [생략] ...
}

이를 제거하고 다음과 같이 그냥 Event-Wireup 에 따라 자동으로 핸들러가 걸리는 구문으로 바꿔주시면 됩니다.

public class Global : System.Web.HttpApplication
{
    void Application_Start(object sender, EventArgs e)
    {
    }

    void Application_BeginRequest(object sender, EventArgs e)
    {
    }
    
    // ... [생략] ...
}




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]







[최초 등록일: ]
[최종 수정일: 4/5/2013]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




... 136  137  138  139  140  [141]  142  143  144  145  146  147  148  149  150  ...
NoWriterDateCnt.TitleFile(s)
1632정성태2/12/201448005.NET Framework: 423. C#에서 DirectShow를 이용한 미디어 재생 [2]파일 다운로드1
1631정성태2/11/201427053개발 환경 구성: 217. Realtek 사운드 장치에서 재생되는 오디오를 GraphEditor로 녹음하는 방법
1630정성태2/5/201428088개발 환경 구성: 216. Hyper-V에 올려진 윈도우 XP VM에서 24bit 컬러 및 ClearType 활성화하는 방법
1629정성태2/5/201437396개발 환경 구성: 215. DOS batch - 하나의 .bat 파일에서 다중 .bat 파일을 (비동기로) 실행하는 방법 [1]
1628정성태2/4/201438787Windows: 87. 윈도우 8.1에서 .NET 3.5 설치가 안된다면? [2]
1627정성태2/4/201433630개발 환경 구성: 214. SQL Server Reporting Services를 이용해 간단한 리포트 제작하는 방법
1626정성태2/4/201426152Windows: 86. 윈도우 8.1의 Skydrive 내용이 동기화가 안된다면?
1625정성태2/2/201433220.NET Framework: 422. C++과 C#의 Event 공유파일 다운로드1
1624정성태2/2/201429072.NET Framework: 421. ASP.NET에서 Server.CreateObject와 COM Interop 클래스 생성의 차이점
1623정성태2/1/201433748개발 환경 구성: 213. x86/x64별로 나뉘어진 어셈블리를 한 프로젝트에서 참조하는 방법 [1]파일 다운로드1
1622정성태1/31/201433825VC++: 74. 어떤 것을 쓰면 좋을까요? wvnsprintf, _vsnwprintf_s, StringCbVPrintfW [4]
1621정성태1/31/201425362.NET Framework: 420. 베트남의 11학년(한국의 고2)이 45분만에 푼다는 알고리즘 문제파일 다운로드1
1620정성태1/30/201435788.NET Framework: 419. C# - BigDecimal파일 다운로드1
1619정성태1/30/201432011VS.NET IDE: 85. T4를 이용한 INotifyPropertyChanged 코드 자동 생성파일 다운로드1
1618정성태1/29/201447639Linux: 2. 우분투에서 Active Directory 계정을 이용한 파일 공유
1617정성태1/29/201429324.NET Framework: 418. Thread.Abort 호출의 hang 현상 [1]
1616정성태1/29/201430151디버깅 기술: 63. windbg 디버깅 사례: AppDomain 간의 static 변수 사용으로 인한 crash
1615정성태1/29/201431773.NET Framework: 417. WPF WebBrowser 컨트롤에서 SHDocVw.IWebBrowser2 인터페이스를 구하는 방법 및 순수 WPF 웹 브라우저 컨트롤 소개
1614정성태1/29/201428942.NET Framework: 416. System.Net.Sockets.NetworkStream이 Thread-safe할까?파일 다운로드1
1613정성태1/29/201430471.NET Framework: 415. IIS 작업자 프로세스 재생(recycle)하는 방법 [1]
1612정성태1/29/201426945오류 유형: 219. IIS 500 Internal Server Error - Skydrive에 공유된 경우
1611정성태1/27/201459578.NET Framework: 414. C# - 컴퓨터에서 알아낼 수 있는 고윳값 정리 [3]파일 다운로드1
1610정성태1/26/201442626.NET Framework: 413. C# - chromiumembedded 사용 [11]파일 다운로드1
1609정성태1/26/201425788오류 유형: 218. wsDualHttpBinding + Windows Server 2003인 경우 발생하는 오류
1608정성태1/26/201431585.NET Framework: 412. HttpContext.Current를 통해 이해하는 CallContext와 ExecutionContext [4]
1607정성태1/26/201430785.NET Framework: 411. 유니코드의 "compatibility character"가 뭘까요? [4]파일 다운로드1
... 136  137  138  139  140  [141]  142  143  144  145  146  147  148  149  150  ...