{"record":{"id":"7fecba6a7c37e4ab","repo":"lucasg/Dependencies","slug":"the-binary-caching-preference-has-been-modified-y","errorCode":null,"errorMessage":"The binary caching preference has been modified, you need to restart Dependencies for the modifications to be actually reloaded.","messagePattern":"The binary caching preference has been modified, you need to restart Dependencies for the modifications to be actually reloaded\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"DependenciesGui/UserSettings.xaml.cs","lineNumber":231,"sourceCode":"\t\t\tint TreeDepth = Dependencies.Properties.Settings.Default.TreeDepth;\n\t\t\tif (Int32.TryParse(TreeDepthValue.Text, out TreeDepth))\n\t\t\t{\n\t\t\t\tDependencies.Properties.Settings.Default.TreeDepth = TreeDepth;\n\t\t\t}\n\t\t\t\n\n\t\t\tif (TreeBuildCombo.SelectedItem != null)\n            {\n                Dependencies.Properties.Settings.Default.TreeBuildBehaviour = TreeBuildCombo.SelectedItem.ToString();\n            }\n\n            if (BinaryCacheCombo.SelectedItem != null)\n            {\n                bool newValue = (bool) (new BinaryCacheOption()).ConvertBack(BinaryCacheCombo.SelectedItem, null, null, null);\n\n                if (Dependencies.Properties.Settings.Default.BinaryCacheOptionValue != newValue)\n                {\n                    System.Windows.MessageBox.Show(\"The binary caching preference has been modified, you need to restart Dependencies for the modifications to be actually reloaded.\");\n                }\n\n                Dependencies.Properties.Settings.Default.BinaryCacheOptionValue = newValue;\n            }\n\n\n            Dependencies.Properties.Settings.Default.Font = FontFamilyListItem.GetDisplayName(SelectedFontFamily);\n            this.Close();\n        }\n\n        private bool SelectListItem(System.Windows.Controls.ListBox list, object value)\n        {\n            ItemCollection itemList = list.Items;\n\n            // Perform a binary search for the item.\n            int first = 0;\n            int limit = itemList.Count;\n","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/lucasg/Dependencies/blob/1997a40000b77bd3326cbc33672a7b9f78bb23f3/DependenciesGui/UserSettings.xaml.cs#L213-L249","documentation":"This is an informational WPF MessageBox shown by UserSettings.OnValidate, not a thrown exception. BinaryCacheOptionValue controls whether Dependencies caches parsed binaries; the cache engine is initialized at startup, so changing the value at runtime cannot take effect immediately. When the newly selected combo value differs from the stored setting, the user is told to restart for it to reload.","triggerScenarios":"The user opens the Settings dialog, changes the BinaryCacheCombo selection, and clicks OK. OnValidate converts the selection back to a bool via BinaryCacheOption.ConvertBack; if it differs from Settings.Default.BinaryCacheOptionValue the message is shown, then the new value is persisted and the dialog closes.","commonSituations":"Toggling binary caching on/off mid-session to save memory or speed up loads; first-time configuration on a fresh profile; expecting the change to apply to the already-loaded tree.","solutions":["Simply restart Dependencies after changing the setting so the cache engine reinitializes.","If the prompt is undesirable, refactor BinaryCacheOption to hot-reload (dispose/rebuild the cache) so a restart is not required.","Verify the setting persisted (Settings.Default.BinaryCacheOptionValue) so the restart actually picks up the new value.","Confirm BinaryCacheCombo is bound to the expected BinaryCacheOption values so ConvertBack returns a meaningful bool."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"bool newValue = (bool)(new BinaryCacheOption()).ConvertBack(BinaryCacheCombo.SelectedItem, null, null, null);\nbool changed = Dependencies.Properties.Settings.Default.BinaryCacheOptionValue != newValue;\n// only show the restart notice (or trigger a hot reload) when `changed` is true","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Design the binary-cache engine to reload on change so no restart is needed.","Persist the setting immediately so a restart actually applies the new value.","Surface the restart requirement in the UI label next to the combo, not only after OK."],"tags":["settings","restart-required","binary-cache","wpf","gui"],"backgroundTag":null,"analyzedSha":"1997a40000b77bd3326cbc33672a7b9f78bb23f3","analyzedAt":"2026-08-13T18:14:41.696Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}