0

We are getting Error "'System.Diagnostics.Eventing.EventProviderTraceListener' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.)'" When posting data into Cosmos DB.

Please help me out from this.

try { // var client1 = new DocumentClient(new Uri(EndpointUrl),AuthorizationKey,ConnectionPolicy);

            using (var client = new DocumentClient(
                new Uri(EndpointUrl),
                AuthorizationKey, ConnectionPolicy))
            {
                var functionClass = new FunctionClass(client);
                var docs = await client.ReadDocumentFeedAsync(collectionLink, new FeedOptions { MaxItemCount = -1 });
                foreach (var d in docs)
                {
                    lineName.Add(d.name);
                }

We need to post data into Azure Cosmos db using Azure functions C#

  • 1
    What is the exact error message you're getting? Also the code you posted is reading documents and not posting anything. Please share the code that is giving you errors. – Gaurav Mantri Jun 07 '19 at 11:57
  • Yes gaurav , We are trying read documents with document Client , But We are getting Error at Client Line **"System.Diagnostics.Eventing.EventProviderTraceListener' from assembly 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.)'"** – ajay abburi Jun 07 '19 at 13:25
  • Can you post the entire stack trace? Is this error local or when deployed? What type of Function Host are you using (Windows or Linux)? Also, are you referencing the Cosmos DB SDK Nuget package in your Functions project? There are 2, one is "Microsoft.Azure.DocumentDB", and the other "Microsoft.Azure.DocumentDB.Core" – Matias Quaranta Jun 07 '19 at 14:25

1 Answers1

0

you have a mismatch between SDK of Cosmos DB and your .Net project. Please refer to this answer.

100mil
  • 104
  • 8