RAVENDB-需要使用EmbedDabledobumentStore的简单示例?
题
我正在使用嵌入在应用程序中的Ravendb进行实验。我正在接受 “'embeddabledocumentStore'键入未定义” 错误。但是,我确实提到了 raven.client.embedded 在我的项目中。
这是我的vb.net代码:
Imports Raven.Client.Client
Imports Raven.Client
Sub Main()
Dim documentStore As EmbeddableDocumentStore = New EmbeddableDocumentStore()
documentStore.DataDirectory = "c:\dbdata"
documentStore.Initialize()
Dim session As Document.DocumentSession = documentStore.OpenSession()
session.Store(New LineItem With {
.draftpostingdate = Nothing,
.forumdate = "#12/1/2010#",
.pfvolume = Nothing,
.pfissue = Nothing,
.change = "change",
.sectiontext = "Revision",
.rs = Nothing,
.revisionid = 51438,
.mononum = "100249",
.webtype = "PCA"
})
session.SaveChanges()
Dim lineItems = session.Query(Of LineItem)()
For Each li As LineItem In lineItems
Console.WriteLine(li.mononum)
Next
End Sub
解决方案
当我针对错误的框架时,我遇到了类似的问题。您是否检查过是否没有针对项目中的“客户端配置文件”?如果我没记错的话,使用嵌入式客户端时必须定位全框架。
不隶属于 StackOverflow