Pergunta

I am experimenting with RavenDB embedded in my application. I am receiving a "Type 'EmbeddableDocumentStore' is not defined" error. I do, however, have a reference to Raven.Client.Embedded in my project.

Here's my VB.Net code:

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
Foi útil?

Solução

I have had similar problems before when I targeted the wrong framework. Have you checked that you're not targeting the "Client Profile" in your project? If I remember correctly you have to target the full framework when using Embedded client.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top