天天看點

企業庫5.0——緩存使用說明(及初級錯誤解決)

---------------------------------------------------

問題1:未能加載檔案或程式集“Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”或它的某一個依賴項。找到的程式集清單定義與程式集引用不比對。 (異常來自 HRESULT:0x80131040)

原因:PublicKeyToken=31bf3856ad364e35時,DLL是有數字簽名的,但如果引用自己生成的DLL就不比對了,因為安裝生成的DLL是簽了名的。

解決:添加 Enterprise Library Caching Application Block 和 Enterprise Library Shared Library (如果企業庫安裝正确引用中會有企業庫的引用)

企業庫5.0——緩存使用說明(及初級錯誤解決)

如果沒有看看這個位置:C:\Program Files\Microsoft Enterprise Library 5.0\Bin\

---------------------------------------------------

問題2:The current type, Microsoft.Practices.EnterpriseLibrary.Caching.ICacheManager, is an interface and cannot be constructed. Are you missing a type mapping?

原因:沒有在 config 中配置緩存設定節點

解決:在開始菜單找到:開始\Microsoft patterns & practices\Enterprise Library 5.0\Enterprise Library Configuration\EntLib Config .NET 4

儲存一個預設的配置就可以了,設定完後儲存設定,之後找到儲存的config 檔案,将裡面内容拷貝到應用程式 config 指定節點就可以了)!

企業庫5.0——緩存使用說明(及初級錯誤解決)

繼續閱讀