{"record":{"id":"5bebadeb7c2b00c5","repo":"SubtitleEdit/subtitleedit","slug":"unsupported-windows-architecture","errorCode":null,"errorMessage":"Unsupported Windows architecture.","messagePattern":"Unsupported Windows architecture\\.","errorType":"exception","errorClass":"PlatformNotSupportedException","httpStatus":null,"severity":"critical","filePath":"src/ui/Logic/Download/LibVlcDownloadService.cs","lineNumber":44,"sourceCode":"    }\n\n    public async Task DownloadLibVlc(Stream stream, IProgress<float>? progress, CancellationToken cancellationToken)\n    {\n        await DownloadHelper.DownloadFileAsync(httpClient, GetUrl(), stream, progress, cancellationToken);\n    }\n\n    private string GetUrl()\n    {\n        if (OperatingSystem.IsWindows())\n        {\n            switch (RuntimeInformation.ProcessArchitecture)\n            {\n                case Architecture.X64:\n                    return WindowsX64Url;\n                case Architecture.X86:\n                    return WindowsX86Url;\n                default:\n                    throw new PlatformNotSupportedException(\"Unsupported Windows architecture.\");\n            }\n        }\n\n        if (OperatingSystem.IsMacOS())\n        {\n            switch (RuntimeInformation.ProcessArchitecture)\n            {\n                // case Architecture.Arm64:\n                //     return MacArmUrl; // e.g., for M1, M2, M3, M4, M5 chips\n                case Architecture.X64:\n                    return MacX64Url;\n            }\n        }\n\n        throw new PlatformNotSupportedException(\"LibVLC download is not supported on this platform\");\n    }\n}","sourceCodeStart":26,"sourceCodeEnd":61,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/ui/Logic/Download/LibVlcDownloadService.cs#L26-L61","documentation":"Thrown by LibVlcDownloadService.GetUrl() in the default case of the Windows architecture switch. Windows URLs are defined only for X64 (WindowsX64Url) and X86 (WindowsX86Url); an ARM64 Windows process (or any other Architecture) hits the default PlatformNotSupportedException.","triggerScenarios":"Running on Windows where ProcessArchitecture is neither X64 nor X86 — most notably Windows-on-ARM64 (Surface Pro X, Snapdragon X). Also reachable on any future Architecture enum value on Windows.","commonSituations":"Windows-on-ARM devices; .NET process forced to ARM64 on an ARM64 Windows host; ARM64 dev/CI runner on Windows. LibVLC binaries for Windows ARM64 are not wired up here, hence the guard.","solutions":["Run the app as an x64 (or x86) process on Windows so the matching LibVLC URL is selected.","If Windows-on-ARM64 must be supported, obtain an ARM64 LibVLC build and add a WindowsArm64Url plus its case in the switch.","At the caller, detect Windows+non-X64/X86 and disable LibVLC-based playback gracefully."],"exampleFix":"// before\nswitch (RuntimeInformation.ProcessArchitecture)\n{\n    case Architecture.X64: return WindowsX64Url;\n    case Architecture.X86: return WindowsX86Url;\n    default: throw new PlatformNotSupportedException(\"Unsupported Windows architecture.\");\n}\n\n// after: add ARM64 Windows support\nswitch (RuntimeInformation.ProcessArchitecture)\n{\n    case Architecture.X64:   return WindowsX64Url;\n    case Architecture.X86:   return WindowsX86Url;\n    case Architecture.Arm64: return WindowsArm64Url;\n    default: throw new PlatformNotSupportedException($\"Unsupported Windows architecture: {RuntimeInformation.ProcessArchitecture}.\");\n}","handlingStrategy":"validation","validationCode":"static bool IsLibVlcSupportedOnWindows()\n    => !OperatingSystem.IsWindows()\n       || RuntimeInformation.ProcessArchitecture is Architecture.X64 or Architecture.X86;\n\nif (!IsLibVlcSupportedOnWindows()) { DisableLibVlcPlayback(); return; }","typeGuard":"static bool LibVlcWindowsSupported()\n    => !OperatingSystem.IsWindows()\n       || RuntimeInformation.ProcessArchitecture is Architecture.X64 or Architecture.X86;","tryCatchPattern":"try { var url = vlcService.GetUrl(); }\ncatch (PlatformNotSupportedException ex) when (OperatingSystem.IsWindows() && ex.Message.Contains(\"Windows architecture\"))\n{ _logger.Warning(\"LibVLC has no build for Windows {Arch}\", RuntimeInformation.ProcessArchitecture); DisableLibVlcPlayback(); }","preventionTips":["Disable LibVLC playback on Windows-on-ARM or run the app as x64.","Add a WindowsArm64Url + case if ARM64 Windows support is required.","Surface supported arches in the UI for Windows users."],"tags":["platform","windows","arm64","libvlc","download"],"backgroundTag":null,"analyzedSha":"17a9f0748781032255db3526b7215d2fb891e3af","analyzedAt":"2026-08-13T18:11:43.374Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}