I was able to successfully run a simple test for RavenDB based on the code found at: http://ravendb.net/tutorials/hello-world
Next I tried to run it in an Embedded Manner, but I keep on getting the following error:
Message: Could not find transactional storage type: Raven.Storage.Esent.TransactionalStorage, Raven.Storage.Esent
StackTrace: at Raven.Database.Config.InMemoryRavenConfiguration.CreateTransactionalStorage(Action notifyAboutWork) in c:\Builds\raven\Raven.Database\Config\InMemoryRavenConfiguration.cs:line 272
at Raven.Database.DocumentDatabase..ctor(InMemoryRavenConfiguration configuration) in c:\Builds\raven\Raven.Database\DocumentDatabase.cs:line 109
at Raven.Client.Client.EmbeddableDocumentStore.InitializeInternal() in c:\Builds\raven\Raven.Client.Embedded\EmbeddableDocumentStore.cs:line 130
at Raven.Client.Document.DocumentStore.Initialize() in c:\Builds\raven\Raven.Client.Lightweight\Document\DocumentStore.cs:line 388
at Tests.RavenEmbedded.RavenDB..ctor() in C:\Users\Pranav\Documents\Projects\Repositories-Clone\Common-clone\Tests\RavenDB.cs:line 114
at Tests.TestRavenDB.Basics() in C:\Users\Pranav\Documents\Projects\Repositories-Clone\Common-clone\Tests\RavenDB.cs:line 170
Setup:
Target framework is .NET Framework 4
I added the following References to my project:
The code is:
namespace Tests.RavenEmbedded
{
using Raven.Client.Client;
using Raven.Client.Document;
using Raven.Storage.Esent;
using Raven.Storage.Managed;
using Tests.RavenData;
class RavenDB
{
public RavenDB()
{
// EmbeddableDocumentStore store = new EmbeddableDocumentStore { DataDirectory = @"C:\Temp\RavenData" };
//Raven.Storage.Esent.TransactionalStorage
var store = new EmbeddableDocumentStore { DataDirectory = @"C:\Temp\RavenData" };
store.Initialize();
#region Write Data
using (var session = store.OpenSession())
{
var product = new Product
{
Cost = 3.99m,
Name = "Milk",
};
session.Store(product);
session.SaveChanges();
session.Store(new Order
{
Customer = "customers/ayende",
OrderLines =
{
new OrderLine
{
ProductId = product.Id,
Quantity = 3
},
}
});
session.SaveChanges();
}
#endregion
#region Read Data
using (var session = store.OpenSession())
{
var order = session.Load("orders/1");
Debug.Print("Customer: {0}", order.Customer);
foreach (var orderLine in order.OrderLines)
{
Debug.Print("Product: {0} x {1}", orderLine.ProductId, orderLine.Quantity);
}
session.SaveChanges();
}
#endregion
}
}
}
namespace Tests
{
public class TestRavenDB
{
public static void Basics()
{
try
{
//var db = new RavenClientServer.RavenDB();
var db = new RavenEmbedded.RavenDB();
}
catch (Exception ex)
{
Debug.Print("Message: {0} ",ex.Message);
Debug.Print("StackTrace: {0} ",ex.StackTrace);
}
}
}
}
I have tried searching for this for a few days and tried a few different variations too. I am not sure what's going on.
Thanks to Ayende Rahien on groups.google.com/group/ravendb/topics.
The solution was to add "Raven.Storage.Esent" reference to the main project. It's an issue with Visual Studio and indirect references.
Thanks @Derek for suggesting that I post there.
-- Pranav
You need to add a reference to Raven.Storage.Esent.dll
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With