An unhandled exception of type 'System.Configuration.ConfigurationErrorsException' occurred in System.Configuration.dll Additional information: Unrecognized attribute 'OperationLifeSpan'. Note that attribute names are case-sensitive


#1

I am creating One POC for CRUD opeartions using Couchbase, but getting exception as

"An unhandled exception of type ‘System.Configuration.ConfigurationErrorsException’ occurred in System.Configuration.dll

Additional information: Unrecognized attribute ‘OperationLifeSpan’. Note that attribute names are case-sensitive."

while connecting to couchbase server. I am attaching C# code and config, Please let me know if I am doing anything wrong.

-------C# code-----------------------

public static void CreateOrder()
{
using (var cluster = new Cluster(“couchbaseClients/couchbase”))
{
IBucket bucket = null;
try
{
bucket = cluster.OpenBucket();

                var order = new Document<Order>
                {
                    Id = Guid.NewGuid().ToString(),
                    Content = new Order
                    {
                        Name="Tiffin",
                        Location="WITP",
                        Quantity=2
                    }

                };

                var result = bucket.Insert(order);

                if(result.Success)
                {
                    Console.WriteLine("Order Created '{0}'", order.Id);
                }                   
            }
            finally
            {
                if (bucket != null)
                {
                    cluster.CloseBucket(bucket);
                }
            }
        }
	
    }

---------------------Config----------------------------

<?xml version="1.0" encoding="utf-8" ?>

#2

Looks like config part truncated,

<?xml version="1.0" encoding="utf-8" ?>

#3

@maheshbansode51

The problem is probably in your XML configuration file. Based on the error, I think you have set “OperationLifeSpan” instead of “operationLifespan”. Note that it’s case sensitive.

You can see an example here:
http://docs.couchbase.com/developer/dotnet-2.1/configuring-the-client.html

Brant