question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for C# SDK v3

See original GitHub issue

The C# SDK currently does not work with this CosmosDb server. NuGet package: https://www.nuget.org/packages/Microsoft.Azure.Cosmos/

I discovered the following issues while attempting to make it work:

  • SDK can not be configured to ignore SSL validation errors. My workaround was using reflection to configure the SDK internals
  • Addresses endpoint as in https://github.com/zeit/cosmosdb-server/issues/29 is not implemented. Workaround is configuring the C# SDK to use Gateway mode.
  • Whenever an error occurs (>399 status code), the C# SDK expects a case sensitive message property with non-null value in the response body. Otherwise it will throw a NullReferenceException.
  • “Meta” / root endpoint must return certain data, otherwise SDK will throw a NullReferenceException. Additionally the queryEngineConfiguration property is required for querying to work.
  • The C# parses and validates the _rid property. In particular, it requires RID for collections to have a specific bit set to 1 (first bit of 5th byte)
  • A property on partitionKeyRanges is invalid, it is maxInclusive but should be maxExclusive
  • C# SDK sends boolean headers with a "True" value instead of "true", causing the server to not handle them as true
  • C# SDK will query partitionKeys using an “Incremental Feed”. See A-IM header. Essentially it expects an etag when retrieving partition keys, and it expects a 302 status code once all keys have been received. Current behavior causes an infinite loop in the C# SDK

After forking this repo and applying fixes for the above I am able to successfully use this server with the C# SDK.

I noticed you have a current draft PR with some fixes for the Java SDK, which will fix some of the issues here. I can make a PR with the remaining fixes if you’d like

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:9
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
asleirecommented, Jul 11, 2020

@moredatapls I wrote this method for creating a CosmosClient with SSL validation disabled: https://gist.github.com/asleire/73fda6b5e80ae4c85b2794470fb46257 It should work with Microsoft.Azure.Cosmos package version 3.6.0

0reactions
asleirecommented, Jul 11, 2020

I’ll close this issue since my PR has been merged. I found more issues regarding advanced queries with the C# client, but basic usage works now

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support Client - AWS SDK for JavaScript v3
AWS SDK for JavaScript Support Client for Node.js, Browser and React Native. ... The Amazon Web Services Support API Reference is intended for...
Read more >
Couchbase C SDK 3.3
The Couchbase C client, libcouchbase (LCB), enables you to interact with a Couchbase Server cluster from the C language. It is also used...
Read more >
C Application Developer's Guide for SDK v3.x and Higher
This document exposes details that will help developers make the most out of the available hardware resources. KEY POINTS. • Project structure and...
Read more >
AWS SDK for JavaScript v3
The SDK is now split up across multiple packages. The 2.x version of the SDK contained support for every service. This made it...
Read more >
CCS/CCSTUDIO: Cannot build project sdk v3.40.0.02 - TI E2E
The differences between SDK 2.30 and SDK 3.40 are very major. In fact, the two SDK versions are not compatible with each other....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found