Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/312.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 将应用程序部署到测试环境时Couchbase.Net SDK错误_C#_Asp.net Mvc_Memcached_Couchbase_Enyim - Fatal编程技术网

C# 将应用程序部署到测试环境时Couchbase.Net SDK错误

C# 将应用程序部署到测试环境时Couchbase.Net SDK错误,c#,asp.net-mvc,memcached,couchbase,enyim,C#,Asp.net Mvc,Memcached,Couchbase,Enyim,我已经编写了一个ASP.NET MVC应用程序,该应用程序基本上使用了couchbase 1.8。当我在我的开发环境中运行应用程序时,它可以工作,但是当我将它部署到我的测试环境中时,我得到以下错误 System.NullReferenceException: Object reference not set to an instance of an object. at Enyim.Caching.Memcached.DefaultKeyTransformer.Transform(String

我已经编写了一个ASP.NET MVC应用程序,该应用程序基本上使用了couchbase 1.8。当我在我的开发环境中运行应用程序时,它可以工作,但是当我将它部署到我的测试环境中时,我得到以下错误

System.NullReferenceException: Object reference not set to an instance of an object.
at Enyim.Caching.Memcached.DefaultKeyTransformer.Transform(String key) at
Enyim.Caching.Memcached.KeyTransformerBase.Enyim.Caching.Memcached.IMemcachedKeyTransforme
.Transform(String key) at Couchbase.CouchbaseClient.PerformStore(StoreMode mode,
String key, Object value, UInt32 expires, UInt64& cas, Int32& statusCode) at
Enyim.Caching.MemcachedClient.Store(StoreMode mode, String key, Object value, DateTime
expiresAt) at MyApp.AddInActiveSession(String key, DateTime expires)...
我的配置如下所示:

<couchbase>
  <servers bucket="default" bucketPassword="">
    <add uri="http://xxxxx:8091/pools"/>
  </servers>
</couchbase>

有人知道问题出在哪里吗?

你能发布你的配置和调用代码吗?@JohnZablocki你在这里。如果您还需要其他信息,请告诉我?鉴于堆栈跟踪和您发布的代码,这很奇怪,但您的密钥似乎是null-DefaultKeyTransformer。Transform是因null引用异常而中断的调用。如何生成idString?另外请注意,您不希望以每个操作一个实例的方式使用CouchbaseClient,因为当您新建一个实例时,需要进行昂贵的握手,而应该尝试每个应用程序域的模型(即全局静态实例)。嘿,mate,当我面临相同的问题时,您找到了这个问题的解决方案了吗
using (var client = new CouchbaseClient())            
{
  var session = client.Get<string>(idString);
  return session;
}
using (var client = new CouchbaseClient())
{
    client.Store(StoreMode.Set, idString,
    "Logged Out",
    expires);                
}