gpt4 book ai didi

RavenDB 内存数据库错误 : Method not found: 'Raven. Json.Linq.RavenJObject

转载 作者:行者123 更新时间:2023-12-01 16:03:14 25 4
gpt4 key购买 nike

我在使用 RavenDB 设置内存数据库时遇到问题。

我得到的错误是: 我得到的是: 设置:System.MissingMethodException:未找到方法:'Raven.Json.Linq.RavenJObject Raven.Abstractions.Extensions.JsonExtensions.ToJObject(Byte[])'

完整的错误跟踪:

SetUp : System.MissingMethodException :
Method not found: 'Raven.Json.Linq.RavenJObject Raven.Abstractions.Extensions.JsonExtensions.ToJObject(Byte[])'.
at Raven.Storage.Managed.DocumentsStorageActions.DeleteDocument(String key, Nullable1 etag, ref RavenJObject metadata)
at Raven.Database.DocumentDatabase.<>c__DisplayClass4e.<Delete>b__48(IStorageActionsAccessor actions)
in c:\Builds\raven\Raven.Database\DocumentDatabase.cs: line 518
at Raven.Storage.Managed.TransactionalStorage.Batch(Action1 action)
in c:\Builds\raven\Raven.Storage.Managed\TransactionalStorage.cs: line 112
at Raven.Database.DocumentDatabase.Delete(String key, Nullable`1 etag, TransactionInformation transactionInformation)
in c:\Builds\raven\Raven.Database\DocumentDatabase.cs: line 509
at Raven.Database.Backup.RemoveBackupDocumentStartupTask.Execute(DocumentDatabase database)
in c:\Builds\raven\Raven.Database\Backup\RemoveBackupDocumentStartupTask.cs: line 17
at Raven.Database.DocumentDatabase.ExecuteStartupTasks()
in c:\Builds\raven\Raven.Database\DocumentDatabase.cs: line 214
at Raven.Database.DocumentDatabase..ctor(InMemoryRavenConfiguration configuration)
in c:\Builds\raven\Raven.Database\DocumentDatabase.cs: line 173
at Raven.Client.Embedded.EmbeddableDocumentStore.InitializeInternal()
at Raven.Client.Document.DocumentStore.Initialize()
in c:\Builds\raven\Raven.Client.Lightweight\Document\DocumentStore.cs: line 484
at Aqueduct.Dashboard.Web.Tests.RavenInMemoryDatabase.InMemoryDatabase.DocumentStore()
in InMemoryDatabase.cs: line 27
at Aqueduct.Dashboard.Web.Tests.MonitoringServiceTests.Setup()
in MonitoringServiceTests.cs: line 24

我的 InMemory 数据库定义如下:

public EmbeddableDocumentStore DocumentStore()
{

string path = Path.GetDirectoryName(Assembly.GetAssembly(typeof(InMemoryDatabase)).CodeBase);
path = Path.Combine(path, "testing").Substring(6);

var documentStore = new EmbeddableDocumentStore()
{
Configuration =
{
DataDirectory = path,
RunInUnreliableYetFastModeThatIsNotSuitableForProduction = true,
DefaultStorageTypeName = "munin",
RunInMemory = true
}
};

documentStore.Initialize();

new RavenDocumentsByEntityName().Execute(documentStore);

return documentStore;
}

我的测试是:

 [TestFixture]
public class MonitoringServiceTests
{
private IMonitoringService m_monitoringService;
private PerformanceRepository m_performanceRepository;
private InMemoryDatabase m_inMemoryDatabase;

[TestFixtureSetUp]
public void Setup()
{
m_inMemoryDatabase = new InMemoryDatabase();

m_performanceRepository = new PerformanceRepository(m_inMemoryDatabase.DocumentStore().OpenSession());
m_monitoringService = new MonitoringService(m_performanceRepository);
}

[Test]
public void RecordSnapShot_RecordsCpuUsage()
{
m_monitoringService.RecordSnapShot();
var allMeasurements = m_performanceRepository.GetAll();
Assert.IsTrue(allMeasurements.Where(x => x.MeasurementType == MeasurementType.ProcessorUsage).Count() == 1);
}
}

最佳答案

您可能有混合版本的 ravendb dll,这是唯一可能导致此错误的原因

关于RavenDB 内存数据库错误 : Method not found: 'Raven. Json.Linq.RavenJObject,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8088324/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com