{"record":{"id":"c4c16048499c6c09","repo":"abpframework/abp","slug":"mobile-app-folder-name-is-not-set","errorCode":null,"errorMessage":"Mobile app folder name is not set!","messagePattern":"Mobile app folder name is not set!","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/MobileApp.cs","lineNumber":24,"sourceCode":"{\n    None,\n    ReactNative,\n    Maui\n}\n\npublic static class MobileAppExtensions\n{\n    public static string GetFolderName(this MobileApp mobileApp)\n    {\n        switch (mobileApp)\n        {\n            case MobileApp.ReactNative:\n                return \"react-native\";\n            case MobileApp.Maui:\n                return \"MAUI\";\n        }\n\n        throw new Exception(\"Mobile app folder name is not set!\");\n    }\n}\n","sourceCodeStart":6,"sourceCodeEnd":27,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/MobileApp.cs#L6-L27","documentation":"Thrown by `MobileAppExtensions.GetFolderName` when the `MobileApp` enum value does not match any of the handled cases (`ReactNative`, `Maui`). It is a raw `Exception` representing an unhandled/default enum branch.","triggerScenarios":"Passing a `MobileApp` value that is `None`/`0`/undefined, or a newly added enum member that `GetFolderName` has not been updated to handle.","commonSituations":"Defaulting `MobileApp` to `None`/0 in project-building code; an ABP version adds a new `MobileApp` member and this switch is not updated; casting an invalid int to the enum.","solutions":["Ensure the `MobileApp` value passed is one of the supported members: `ReactNative` or `Maui`.","If you added a new enum member, extend the `switch` in `GetFolderName` with its folder name.","Validate the enum is defined (`Enum.IsDefined`) before calling `GetFolderName`."],"exampleFix":"// before\nvar folder = mobileApp.GetFolderName(); // mobileApp = MobileApp.None\n// after\nvar folder = (mobileApp == MobileApp.ReactNative ? \"react-native\"\n            : mobileApp == MobileApp.Maui ? \"MAUI\"\n            : throw new ArgumentOutOfRangeException(nameof(mobileApp)));","handlingStrategy":"validation","validationCode":"if (!Enum.IsDefined(typeof(MobileApp), mobileApp) || mobileApp == 0)\n    throw new ArgumentOutOfRangeException(nameof(mobileApp), \"MobileApp must be ReactNative or Maui.\");\nvar folder = mobileApp.GetFolderName();","typeGuard":"static bool IsSupportedMobileApp(MobileApp m) => m == MobileApp.ReactNative || m == MobileApp.Maui;","tryCatchPattern":"try { folder = mobileApp.GetFolderName(); }\ncatch (Exception ex) when (ex.Message.Contains(\"Mobile app folder name is not set\"))\n{\n    logger.LogError(\"Unsupported MobileApp value {Value}.\", mobileApp);\n    throw;\n}","preventionTips":["Default to a supported value rather than 0/None.","When extending the MobileApp enum, update GetFolderName immediately.","Guard with Enum.IsDefined before calling the extension."],"tags":["cli","project-building","mobile","enum","unhandled-case"],"backgroundTag":null,"analyzedSha":"7ed43b1931b9df46a50c0c59148a18645641d0df","analyzedAt":"2026-08-13T16:26:11.351Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}