3

protobuf-net から enyim キャッシュへのトランスコーダーは非推奨ですか? protobuff-net による分散キャッシング

このapp.configのように Enyim 構成を設定すると、MemcachedClient() を開始しようとするとエラーが発生します

transcoder type="ProtoBuf.Caching.Enyim.NetTranscoder"/

System.TypeInitializationException was unhandled by user code
HResult=-2146233036
Message=The type initializer for 'Enyim.Caching.MemcachedClient' threw an exception.
Source=Enyim.Caching
TypeName=Enyim.Caching.MemcachedClient
StackTrace:
   at Enyim.Caching.MemcachedClient..ctor()
   at Global.asax.cs:line 31
InnerException: System.Configuration.ConfigurationErrorsException
   HResult=-2146232062
   Message=The value of the property 'transcoder' cannot be parsed. The error is: Object reference   not set to an instance of an object. (\web.config line 207)
   Source=System.Configuration
   BareMessage=The value of the property 'transcoder' cannot be parsed. The error is: Object reference not set to an instance of an object.
   StackTrace:
        at System.Configuration.BaseConfigurationRecord.EvaluateOne(String[] keys, SectionInput input, Boolean isTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult)
        at System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult, Boolean getLkg, Boolean getRuntimeObject, Object& result, Object& resultRuntimeObject)
        at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
        at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
        at System.Web.HttpContext.GetSection(String sectionName)
        at System.Web.Configuration.HttpConfigurationSystem.GetSection(String sectionName)
        at System.Web.Configuration.HttpConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String configKey)
        at System.Configuration.ConfigurationManager.GetSection(String sectionName)
        at Enyim.Caching.MemcachedClient..cctor() in MemcachedClient.cs:line 25
   InnerException: 

どちらも nuget 経由でインストールされ、利用可能な最新バージョンを使用しています。

4

1 に答える 1

3

はい(咳)、もちろんあります!「protobuf-net.Enyim」を参照してください。

PM> インストール パッケージ protobuf-net.Enyim

(または GUI クライアントを使用)

初期化するには、トランスコーダを のインスタンスになるように構成する必要がありますProtoBuf.Caching.Enyim.NetTranscoder(元の指示に従って)。構成を介してこれを行う場合、このタイプのアセンブリは現在 であることに注意してくださいprotobuf-net.Enyim。構成ファイルが標準表記を使用すると仮定すると、(構成で) 指定する必要があることを意味します。

<transcoder type="ProtoBuf.Caching.Enyim.NetTranscoder,protobuf-net.Enyim" />

元の答え:

enyim トランスコーダーは現在 nuget に含まれていません。ただし、これを元に戻す別の NuGet パッケージ (EnyimMemcached と protobuf-net を参照) を追加することで、今すぐ自分でそれを復活させます。

ランダムな質問です... テスト用のバイナリ memcached ダウンロードを教えていただけないでしょうか?

これが遅れた理由の 1 つは、私が最初に enyim トランスコーダーを作成したとき、memcached は単純な「これを実行する」だけだったということです。 memcached サーバー。それが今どこにあるのか教えていただければ、今週末に動かします。

于 2012-11-30T14:19:49.190 に答える