EmbeddableDocumentStore 클래스에서 Initialize를 호출 할 때 매우 실망스러운 오류가 발생합니다. 이것은 c : \ temp \ ravenDb에서 RavenDB 데이터베이스를 시작하거나 초기화하려고 시도하는 WPF 응용 프로그램입니다.EsentFileNotFoundException.RavenDb-Embedded를 초기화 할 때 예외가 발생하지 않습니다.
내 코드는 다음과 같습니다 매우 간단
EmbeddableDocumentStore _documentStore = new EmbeddableDocumentStore()
{
DataDirectory = @"C:\temp\RavenDb"
};
using (_documentStore.Initialize())
{
}
. Initialize() 호출시 오류가 발생합니다. 제대로 작동, 나는 새로운 WPF 응용 프로그램을 작성하고 같은 코드를 복사 할 때
Microsoft.Isam.Esent.Interop.EsentFileNotFoundException occurred
Message=File not found
Source=Esent.Interop
StackTrace:
at Microsoft.Isam.Esent.Interop.Api.Check(Int32 err) in C:\Work\ravendb\SharedLibs\Sources\managedesent-61618\EsentInterop\Api.cs:line 2736
InnerException:
은 무엇 초조 것은, 초기화 및 기본 파일을 생성 할 수 있습니다 :이 전체 오류입니다. 난 다시 내 주요 WPF 응용 프로그램에 갈 때 그리고, - DB를은 (파일이 생성 된대로) 지금 초기화 할 수 있지만 다음과 같은 오류의 모든 Session.Query 호출 결과 :
System.IO.FileNotFoundException occurred
Message=segments.gen
Source=Lucene.Net
StackTrace:
at Lucene.Net.Store.RAMDirectory.OpenInput(String name) in z:\Libs\lucene.net\src\core\Store\RAMDirectory.cs:line 301
InnerException:
편집 : 전체 코드 : 그것은이 배경 작업자 대리자라고 : 다음 GetAggregateRoots 호출
private void RefreshGrid()
{
BackgroundWorker bw = new BackgroundWorker();
bw.DoWork += new DoWorkEventHandler(bw_DoWork);
bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);
if (bw.IsBusy != true)
{
bw.RunWorkerAsync(_domainType);
}
}
void bw_DoWork(object sender, DoWorkEventArgs e)
{
e.Result = EventStoreInstance.Instance.GetAggregateRoots((Type)e.Argument);
}
:
//Called in class ctor:
_publisher = publisher;
_documentStore = new EmbeddableDocumentStore()
{
DataDirectory = _dataDir // is "C:\temp\RavenDb"
};
public List<AggregateRootModel> GetAggregateRoots(Type AggregrateRootType)
{
using (_documentStore.Initialize())
{
using (var session = _documentStore.OpenSession())
{
var aggregateRoots = session.Query<AggregateRootModel>()
.Where(p => p.Type == AggregrateRootType.AssemblyQualifiedName).ToList();
return aggregateRoots;
}
}
}
새 WPF 응용 프로그램을 만들 때 코드를 복사하면 나에게 소리가 들립니다. 아마도 .config 파일에 뭔가있을 수 있습니다. .config 파일을 사용하여 우연히 WPF 설정을 읽는 중입니까? ? – MethodMan
아니요, 설정 파일에는 아무 것도 없습니다. 또한 initialise 메서드가 내 주 WPF 프로젝트에서 불면 3 개의 폴더 (로그, 시스템 및 임시 폴더)를 만들 수있었습니다. – seanfitzg
가능하면 주된 wpf의 코드를 보여줄 수 있습니까?보고있는 것일 수도있는 것이 있습니다 ... – MethodMan