{"record":{"id":"5012e9861d57dd71","repo":"tursodatabase/turso","slug":"sync-interval-requires-embedded-replica-support-w","errorCode":null,"errorMessage":"Sync Interval requires embedded replica support, which is not supported yet by the .NET provider.","messagePattern":"Sync Interval requires embedded replica support, which is not supported yet by the \\.NET provider\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"bindings/dotnet/src/Turso.Data/TursoConnection.cs","lineNumber":326,"sourceCode":"            return;\n\n        try\n        {\n            remoteClient.CloseAsync(DefaultTimeout, CancellationToken.None).GetAwaiter().GetResult();\n        }\n        catch\n        {\n            InvalidateRemoteSession();\n        }\n    }\n\n    private void OpenRemote()\n    {\n        if (_connectionOptions.IsReplica)\n            throw new NotSupportedException(\"Embedded replica connections are not supported yet by the .NET provider. Use a remote URL without Replica Path for direct remote execution.\");\n\n        if (_connectionOptions.SyncInterval > 0)\n            throw new NotSupportedException(\"Sync Interval requires embedded replica support, which is not supported yet by the .NET provider.\");\n\n        if (_connectionOptions.GetEncryptionCipher().HasValue || !string.IsNullOrWhiteSpace(_connectionOptions[\"Encryption Key\"]))\n            throw new InvalidOperationException(\"Encryption Cipher and Encryption Key are local database options and cannot be used with remote Turso URLs.\");\n\n        _remoteClient = new TursoRemoteClient(_connectionOptions.GetRemoteUri(), _connectionOptions.AuthToken);\n    }\n\n    private void ValidateLocalOnlyOptions()\n    {\n        if (!string.IsNullOrWhiteSpace(_connectionOptions.AuthToken))\n            throw new InvalidOperationException(\"Auth Token requires a remote Turso URL Data Source.\");\n        if (!string.IsNullOrWhiteSpace(_connectionOptions.ReplicaPath))\n            throw new InvalidOperationException(\"Replica Path requires a remote Turso URL Data Source.\");\n        if (_connectionOptions.SyncInterval > 0)\n            throw new InvalidOperationException(\"Sync Interval requires a remote embedded replica connection.\");\n        if (_connectionOptions.Tls.HasValue)\n            throw new InvalidOperationException(\"Tls requires a remote Turso URL Data Source.\");\n    }","sourceCodeStart":308,"sourceCodeEnd":344,"githubUrl":"https://github.com/tursodatabase/turso/blob/244cde92a7df7f9b8b8b7a4075c35a12977e303e/bindings/dotnet/src/Turso.Data/TursoConnection.cs#L308-L344","documentation":"OpenRemote's second guard: 'Sync Interval' configures periodic synchronization for embedded replicas, which the .NET provider does not implement, so any Sync Interval greater than zero on a remote connection string throws NotSupportedException at Open() — even when Replica Path is absent.","triggerScenarios":"Open() with 'Sync Interval=10' (or any positive value) on a remote Data Source; connection strings copied from SDKs that support periodic replica sync; config templates that always set a sync interval.","commonSituations":"Shared configuration across services written in different languages; tuning guides written for other Turso bindings; defaults injected by a platform's Turso integration.","solutions":["Remove 'Sync Interval' from the connection string entirely","Direct remote connections need no sync interval — every statement already executes on the server","Note the option is currently unusable anywhere in .NET: local connections reject it too ('Sync Interval requires a remote embedded replica connection')"],"exampleFix":"// before\nvar cs = \"Data Source=libsql://db.turso.io;Auth Token=...;Sync Interval=10\";\nusing var conn = new TursoConnection(cs);\nconn.Open(); // NotSupportedException\n\n// after\nvar cs = \"Data Source=libsql://db.turso.io;Auth Token=...\";\nusing var conn = new TursoConnection(cs);\nconn.Open();","handlingStrategy":"validation","validationCode":"var opts = TursoConnectionOptions.Parse(cs);\nif (opts.SyncInterval > 0)\n    throw new InvalidOperationException(\n        \"Remove 'Sync Interval': embedded replicas are not supported by the .NET provider.\");","typeGuard":"static bool HasNoReplicaOnlyOptions(string cs)\n{\n    var opts = TursoConnectionOptions.Parse(cs);\n    return !opts.IsReplica && opts.SyncInterval <= 0;\n}","tryCatchPattern":"try { conn.Open(); }\ncatch (NotSupportedException ex) when (ex.Message.Contains(\"Sync Interval requires embedded replica support\"))\n{\n    // remove 'Sync Interval' from the connection string and retry\n}","preventionTips":["Drop replica-related options from .NET configs","Validate config at startup with TursoConnectionOptions.Parse","Direct remote connections need no sync interval at all"],"tags":["csharp","dotnet","turso","embedded-replica","connection-string","not-supported"],"backgroundTag":"embedded-replica-not-supported","analyzedSha":"244cde92a7df7f9b8b8b7a4075c35a12977e303e","analyzedAt":"2026-08-20T07:02:18.389Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}