RavendB -EmbeddableDocumentStoreを使用した簡単な例が必要ですか?

StackOverflow https://stackoverflow.com/questions/4750341

  •  13-10-2019
  •  | 
  •  

質問

アプリケーションに埋め込まれたRavendbを実験しています。私は受け取っています 「タイプ「EmbeddableDobledocumentStore」は定義されていません」 エラー。しかし、私は参照しています 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
役に立ちましたか?

解決

間違ったフレームワークをターゲットにしたとき、私は同様の問題を抱えていました。プロジェクトの「クライアントプロファイル」をターゲットにしていないことを確認しましたか?私が正しく覚えていれば、組み込みクライアントを使用するときに完全なフレームワークをターゲットにする必要があります。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top