RavenDB supports embedding into your .NET application. That means your application will contain all necessary files to run RavenDB, which will be part of your application. Running RavenDB in Embedded mode is similar to running it in Console mode (launching the Raven.Server.exe
file). The main difference is that RavenDB will start automatically in Embedded mode, while you need to start it manually in Console mode. Also, when running RavenDB in Embedded mode, you can interact programmatically with the server instance.
To run RavenDB in embedded mode, you need to reference the RavenDB Embedded Client in your .NET application. You may add this reference either via the NuGet Package Manager (package name RavenDB Embedded
) or by taking the files from the ~\EmbeddedClient
folder in the RavenDB distribution package.
After the RavenDB Embedded Client is referenced in your application, you need to create a new instance of the EmbeddableDocumentStore
object. Then...