diff --git a/dotnet/src/dotnetframework/GxClasses/Core/gxconfig.cs b/dotnet/src/dotnetframework/GxClasses/Core/gxconfig.cs index 34406657f..fcee42c6b 100644 --- a/dotnet/src/dotnetframework/GxClasses/Core/gxconfig.cs +++ b/dotnet/src/dotnetframework/GxClasses/Core/gxconfig.cs @@ -877,7 +877,9 @@ internal static string AppMainNamespace } internal static bool IsBeforeConnectEventConfigured() { - return (Config.GetValueOf("EVENT_BEFORE_CONNECT", out string evtProcName) && !string.IsNullOrEmpty(evtProcName)); + + return (Config.GetValueOrEnvironmentVarOf("ApplyBeforeConnectToWebSession", out string value) && value == YES && + Config.GetValueOf("EVENT_BEFORE_CONNECT", out string evtProcName) && !string.IsNullOrEmpty(evtProcName)); } internal static string DefaultDatastore {