我想用在單元測試項目Raven.Client.Embedded.EmbeddableDocumentStore
(建設960),像這樣:爲什麼RavenDB EmbeddableDocumentStore依賴於Raven.Database程序集?
private IDocumentStore CreateDocumentStore()
{
var store = new EmbeddableDocumentStore
{
RunInMemory = true,
Conventions = new DocumentConvention
{
DefaultQueryingConsistency = ConsistencyOptions.QueryYourWrites,
IdentityPartsSeparator = "-"
}
};
store.Initialize();
IndexCreation.CreateIndexes(typeof (RavenIndexes).Assembly, store);
return store;
}
我通過安裝的NuGet以下RavenDB組件:
- RavenDB.Embedded
- RavenDB.Client
上面的代碼失敗,因爲它找不到Raven.Database 1.0.0.0程序集。爲了解決這個問題,我通過nuget安裝了RavenDB.Database包。這增加了一堆我不想要的東西,這是預計給定的nuget description這個包:
如果你想擴展RavenDB,使用這個包。如果 只是想與現有的RavenDB服務器配合使用,請不要使用此包,以便 僅使用RavenDB.Client包中的客戶端API。
現在,當我嘗試卸載使用的NuGet的RavenDB.Database包裝它告訴我,我不能: 因爲「RavenDB無法卸載「RavenDB.Database 1.0.960」:
卸載,包。嵌入式1.0.960'取決於它。
那該怎麼辦?我是否搞亂我的NuGet純度,並從我的單元測試項目中手動刪除所有未使用的參考文獻(RavenDB.Smuggler
等),只留下RavenDB.Database
參考?或者我在某個地方出錯了?當然EmbeddableDocumentStore
不需要我安裝整個RavenDB.Database包。
感謝
好的,這是有道理的。對於那些只想運行內存數據庫(通常用於單元測試)的用戶來說,也許可以減少NuGet包,而不必花費所有的時間和精力。 – biofractal