diff --git a/src/coreclr/vm/exinfo.cpp b/src/coreclr/vm/exinfo.cpp index a38cf79104560c..da05037a9f4531 100644 --- a/src/coreclr/vm/exinfo.cpp +++ b/src/coreclr/vm/exinfo.cpp @@ -179,7 +179,15 @@ void ExInfo::MakeCallbacksRelatedToHandler( if (fIsFilterHandler) { m_EHClauseInfo.SetEHClauseType(COR_PRF_CLAUSE_FILTER); - EEToDebuggerExceptionInterfaceWrapper::ExceptionFilter(pMD, (TADDR) dwHandlerStartPC, pEHClause->FilterOffset, (BYTE*)sf.SP); + + // Suppress the debugger filter notification for the runtime helper that invokes + // the main program entrypoint (Environment.CallEntryPoint). This method has + // a filter clause that may return false, but the debugger intercepts at the notification + // before the filter evaluates, preventing the exception from propagating as unhandled. + if (pMD != g_pEnvironmentCallEntryPointMethodDesc) + { + EEToDebuggerExceptionInterfaceWrapper::ExceptionFilter(pMD, (TADDR) dwHandlerStartPC, pEHClause->FilterOffset, (BYTE*)sf.SP); + } EEToProfilerExceptionInterfaceWrapper::ExceptionSearchFilterEnter(pMD); ETW::ExceptionLog::ExceptionFilterBegin(pMD, (PVOID)dwHandlerStartPC);