{"record":{"id":"0857e968c2e0d25f","repo":"Humanizr/Humanizer","slug":"could-not-find-the-humanizer-repository-root-from","errorCode":null,"errorMessage":"Could not find the Humanizer repository root from '{start}'.","messagePattern":"Could not find the Humanizer repository root from '(.+?)'\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"tools/Humanizer.UnicodeDataGenerator/Program.cs","lineNumber":139,"sourceCode":"}\nelse\n{\n    Console.WriteLine(\"Regenerated Unicode 16 inflection data from all five hash-pinned inputs.\");\n}\n\nreturn 0;\n\nstatic string FindRepositoryRoot(string start)\n{\n    for (var current = new DirectoryInfo(start); current is not null; current = current.Parent)\n    {\n        if (File.Exists(Path.Combine(current.FullName, \"Humanizer.slnx\")))\n        {\n            return current.FullName;\n        }\n    }\n\n    throw new InvalidOperationException(\n        $\"Could not find the Humanizer repository root from '{start}'.\");\n}\n\nstatic string NormalizeLineEndings(string value) =>\n    value.Replace(\"\\r\\n\", \"\\n\", StringComparison.Ordinal)\n        .Replace('\\r', '\\n');\n\nstatic bool CheckOrWrite(string path, string expected, bool check)\n{\n    var current = NormalizeLineEndings(File.ReadAllText(path));\n    if (current == expected)\n    {\n        return false;\n    }\n\n    if (!check)\n    {\n        File.WriteAllText(","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/tools/Humanizer.UnicodeDataGenerator/Program.cs#L121-L157","documentation":"Thrown by FindRepositoryRoot when the generator cannot locate Humanizer.slnx by walking up the directory tree from the given start path. The generator needs the repository root to resolve the path to the output file (src/Humanizer/Inflections/InflectionUnicodeData.cs).","triggerScenarios":"Running the generator from a directory that is not inside the Humanizer repository tree (e.g. from /tmp or a sibling directory). Also when the slnx file was renamed or removed.","commonSituations":"Contributor clones only a subfolder. Running the generator in a CI environment with an unexpected working directory. The repository was restructured and Humanizer.slnx was moved.","solutions":["Run the generator from within the Humanizer repository so it can find Humanizer.slnx.","Verify Humanizer.slnx exists at the repository root.","If the repository was restructured, update FindRepositoryRoot to look for the new marker file."],"exampleFix":"# before: running from outside the repo tree\ncd /tmp && dotnet run --project /path/to/Humanizer/tools/Humanizer.UnicodeDataGenerator -- /tmp/ucd\n\n# after: run from inside the repo\n cd /path/to/Humanizer && dotnet run --project tools/Humanizer.UnicodeDataGenerator -- ./ucd","handlingStrategy":"validation","validationCode":"static string? TryFindRepoRoot(string start)\n{\n    for (var dir = new DirectoryInfo(start); dir is not null; dir = dir.Parent)\n    {\n        if (File.Exists(Path.Combine(dir.FullName, \"Humanizer.slnx\")))\n            return dir.FullName;\n    }\n    return null;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always run the generator from within the Humanizer repository.","Verify Humanizer.slnx exists at the root before running.","Use a wrapper script that sets the working directory to the repo root."],"tags":["unicode-generator","tooling","path-resolution","environment"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}