{"record":{"id":"f6573045a5d3f105","repo":"babalae/better-genshin-impact","slug":"config-json","errorCode":null,"errorMessage":"config.json 未找到","messagePattern":"config\\.json 未找到","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"critical","filePath":"BetterGenshinImpact/GameTask/AutoLeyLineOutcrop/AutoLeyLineOutcropTask.cs","lineNumber":226,"sourceCode":"\n        if (_taskParam.FightConfig.Timeout <= 0)\n        {\n            _taskParam.FightConfig.Timeout = _taskParam.Timeout > 0 ? _taskParam.Timeout : 120;\n        }\n        else\n        {\n            _taskParam.Timeout = _taskParam.FightConfig.Timeout;\n        }\n    }\n\n    private void LoadConfigData()\n    {\n        // Load and validate the static ley line route config from disk.\n        var workDir = Global.Absolute(@\"GameTask\\AutoLeyLineOutcrop\");\n        var configPath = Path.Combine(workDir, \"Assets\", \"config.json\");\n        if (!File.Exists(configPath))\n        {\n            throw new FileNotFoundException(\"config.json 未找到\", configPath);\n        }\n\n        var json = File.ReadAllText(configPath);\n        _configData = JsonSerializer.Deserialize<AutoLeyLineConfigData>(json)\n                      ?? throw new Exception(\"config.json 解析失败\");\n    }\n\n    private void LoadRecognitionObjects()\n    {\n        // Template ROIs are tuned for the 1080p capture region.\n        _openRo = BuildTemplate(\"Assets/icon/open.png\");\n        _closeRo = BuildTemplate(\"Assets/icon/close.png\");\n        _paimonMenuRo = BuildTemplate(\"Assets/icon/paimon_menu.png\", new Rect(0, 0, ScaleTo1080(640), ScaleTo1080(216)));\n        _boxIconRo = BuildTemplate(\"Assets/icon/box.png\");\n        _mapSettingButtonRo = BuildTemplate(\"Assets/icon/map_setting_button.bmp\");\n        _handbookTrackActionRo = BuildTemplate(\"Assets/icon/handbook_track_action_left.png\", HandbookTrackActionButtonRoi, 0.72);\n\n        _ocrRo1 = RecognitionObject.Ocr(ScaleTo1080(800), ScaleTo1080(200), ScaleTo1080(300), ScaleTo1080(100));","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/AutoLeyLineOutcrop/AutoLeyLineOutcropTask.cs#L208-L244","documentation":"Thrown as a FileNotFoundException by LoadConfigData when the file GameTask/AutoLeyLineOutcrop/Assets/config.json does not exist on disk. This file contains the static ley line position data, map positions, and error thresholds that the strategy-matching and navigation logic depend on. It is a bundled asset that should ship with the application; its absence indicates a corrupted or incomplete installation.","triggerScenarios":"LoadConfigData (called from Initialize at task start) resolves the path via Global.Absolute and checks File.Exists. Fires when the deployment is missing the Assets/config.json file under the AutoLeyLineOutcrop task directory.","commonSituations":"The application was installed from a partial or interrupted download; an antivirus quarantined the JSON file; a user manually deleted or moved assets; a build/packaging step excluded the JSON from the output directory; running from source without copying assets to the build output.","solutions":["Reinstall or re-download the application to restore the bundled Assets/config.json file.","If building from source, verify the file is marked as CopyToOutputDirectory in the .csproj and exists in the build output.","Check if antivirus software quarantined the file and restore/exclude it.","Manually verify the file exists at Global.Absolute(@\"GameTask\\AutoLeyLineOutcrop\\Assets\\config.json\")."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before starting the task, verify config.json exists\nvar configPath = Path.Combine(Global.Absolute(@\"GameTask\\AutoLeyLineOutcrop\"), \"Assets\", \"config.json\");\nif (!File.Exists(configPath))\n{\n    Logger.LogError(\"config.json 不存在，请重新安装程序: {Path}\", configPath);\n    return;\n}","typeGuard":null,"tryCatchPattern":"catch (FileNotFoundException ex) when (ex.Message.Contains(\"config.json 未找到\"))\n{\n    logger.LogError(\"地脉花配置文件缺失，请重新安装程序: {Path}\", ex.FileName);\n    ThemedMessageBox.Error(\"配置文件缺失，请重新安装程序\", \"文件未找到\");\n}","preventionTips":["Use a complete application installation with all bundled assets.","If building from source, verify JSON assets have CopyToOutputDirectory set.","Add antivirus exclusions for the application directory to prevent file quarantine."],"tags":["ley-line","file-not-found","assets","installation"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}