diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ClientConfigPaths.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ClientConfigPaths.cs index 583a1330fb530..b6523eeed486e 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ClientConfigPaths.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ClientConfigPaths.cs @@ -70,7 +70,7 @@ private ClientConfigPaths(string exePath, bool includeUserConfig) // Try to find the native entry point. using (Process currentProcess = Process.GetCurrentProcess()) { - ApplicationUri = currentProcess.MainModule.FileName; + ApplicationUri = currentProcess.MainModule?.FileName; } } }