{"record":{"id":"10d200d3c0576995","repo":"tursodatabase/turso","slug":"unsupported-remote-turso-url-scheme-uri-scheme","errorCode":null,"errorMessage":"Unsupported remote Turso URL scheme: {uri.Scheme}","messagePattern":"Unsupported remote Turso URL scheme: (.+?)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"bindings/dotnet/src/Turso.Data/TursoConnectionOptions.cs","lineNumber":148,"sourceCode":"        if (!Uri.TryCreate(DataSource, UriKind.Absolute, out var uri) || !IsRemoteScheme(uri.Scheme))\n            throw new InvalidOperationException($\"Data Source is not a remote Turso URL: {DataSource}\");\n\n        if (!string.IsNullOrEmpty(uri.Query) || !string.IsNullOrEmpty(uri.Fragment))\n            throw new InvalidOperationException(\"Remote Turso URLs must not include query strings or fragments.\");\n        if (!string.IsNullOrEmpty(uri.UserInfo))\n            throw new InvalidOperationException(\"Remote Turso URLs must not include embedded user information; use Auth Token instead.\");\n        if (string.IsNullOrEmpty(uri.Host))\n            throw new InvalidOperationException(\"Remote Turso URLs must include a host.\");\n\n        var scheme = uri.Scheme.ToLowerInvariant() switch\n        {\n            \"libsql\" => Tls == false ? \"http\" : \"https\",\n            \"turso\" => ValidateTls(uri.Scheme, expectedTls: true, normalizedScheme: \"https\"),\n            \"http\" => ValidateTls(uri.Scheme, expectedTls: false),\n            \"https\" => ValidateTls(uri.Scheme, expectedTls: true),\n            \"ws\" => ValidateTls(uri.Scheme, expectedTls: false, normalizedScheme: \"http\"),\n            \"wss\" => ValidateTls(uri.Scheme, expectedTls: true, normalizedScheme: \"https\"),\n            _ => throw new InvalidOperationException($\"Unsupported remote Turso URL scheme: {uri.Scheme}\")\n        };\n\n        var builder = new UriBuilder(uri)\n        {\n            Scheme = scheme,\n            Port = uri.IsDefaultPort ? -1 : uri.Port,\n            UserName = string.Empty,\n            Password = string.Empty,\n        };\n\n        return builder.Uri;\n    }\n\n    public static TursoConnectionOptions Parse(string connectionString)\n    {\n        return new TursoConnectionOptions(new TursoConnectionStringBuilder(connectionString));\n    }\n","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/tursodatabase/turso/blob/6c7252267988c76e632af00a671e4b9788dfae13/bindings/dotnet/src/Turso.Data/TursoConnectionOptions.cs#L130-L166","documentation":"The switch in GetRemoteUri() throws this when the URL scheme is not libsql/http/https/ws/wss. In the current code it is effectively defensive dead code: the same five schemes were already accepted case-insensitively by IsRemoteScheme() earlier in the method, so a well-behaved call cannot reach it. If you do see it, the scheme check set and the switch have drifted apart (e.g. after a partial edit or version mismatch between compiled units).","triggerScenarios":"Not reachable through the public API today because IsRemoteScheme(uri.Scheme) already gates the exact same scheme list with OrdinalIgnoreCase comparison; it could only fire if IsRemoteScheme were extended with a new scheme without updating this switch, or if mismatched assembly versions are loaded.","commonSituations":"Essentially never in shipped code; a report of it usually indicates stale/mixed assembly versions in the output folder (an old Turso.Data DLL paired with a newer dependency) rather than a user configuration error.","solutions":["Verify you are not loading mixed versions of the Turso assemblies (clean bin/obj, reinstall the Turso.Data package).","Confirm the URL scheme really is one of libsql, http, https, ws, wss (spelled exactly).","If it reproduces on the latest package, report it — the switch and IsRemoteScheme have drifted in the library."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Practically unreachable: IsRemoteScheme already gates the same schemes.\n// If hit, verify assembly versions match:\ntypeof(TursoConnectionOptions).Assembly.GetName().Version.Dump();","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep a single Turso.Data package version across the solution.","Clean bin/obj after upgrading the package."],"tags":["csharp","dotnet","connection-string","url-validation","defensive-code"],"backgroundTag":"invalid-connection-url","analyzedSha":"6c7252267988c76e632af00a671e4b9788dfae13","analyzedAt":"2026-08-20T07:02:18.389Z","contentChangedAt":"2026-08-20T07:02:18.389Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}