diff --git a/mcs/class/referencesource/System.Configuration/System/Configuration/ClientConfigPaths.cs b/mcs/class/referencesource/System.Configuration/System/Configuration/ClientConfigPaths.cs index 3b21c19d2d93..200f3a1b3e57 100644 --- a/mcs/class/referencesource/System.Configuration/System/Configuration/ClientConfigPaths.cs +++ b/mcs/class/referencesource/System.Configuration/System/Configuration/ClientConfigPaths.cs @@ -650,6 +650,16 @@ private string Validate(string str, bool limitSize) { if (limitSize) { validated = (validated.Length > MAX_LENGTH_TO_USE) ? validated.Substring(0, MAX_LENGTH_TO_USE) : validated; } + + /* + * For Mono compatibility: + * Mono creates/accesses the generated user configuration file paths + * through a different set of API calls than referencesource does. + * As a result of this, the trailing period in directory names is + * not truncated, which results in an inability to access the user + * configuration file. We'll add a workaround for this here. + */ + validated = validated.TrimEnd('.'); } return validated;