Trying to connect RavenDB Cloud service using AWS Lambda function, for one of my POC, but failed to connect.
I am using the client certificate (.pfx) file for this. It throws error exactly during certificate assign with X509Certificate2. I have converted the certificate to byte[] and passed. The certificate I am using has full access to the database. I am included the error below
if (_bClientCertificate != null)
{
if (_bClientCertificate.Length > 0)
{
xclientCertificate = new X509Certificate2(_bClientCertificate);
}
}
IDocumentStore store = new DocumentStore()
{
Certificate = xclientCertificate, //Error occured here
Urls = _Urls,
Database = _DBName
}.Initialize();
System.IO.FileLoadException
HResult=0x80131509
Message=Could not load file or assembly 'Sparrow, Version=4.2.2.0, Culture=neutral, PublicKeyToken=37f41c7f99471593'. An operation is not legal in the current state. (Exception from HRESULT: 0x80131509)
Source=Raven.Client
StackTrace:
at Raven.Client.Documents.Subscriptions.DocumentSubscriptions..ctor(IDocumentStore store) in C:\Builds\RavenDB-Stable-4.2\42017\src\Raven.Client\Documents\Subscriptions\DocumentSubscriptions.cs:line 33
at Raven.Client.Documents.DocumentStoreBase..ctor() in C:\Builds\RavenDB-Stable-4.2\42017\src\Raven.Client\Documents\DocumentStoreBase.cs:line 28
at Firecloud.DataAccess.RavenDB.SessionStore.CreateStore() in C:\Works\SourceCode\FC\Library\RavenDB\FC.DataAccess.Raven\SessionStore.cs:line 87
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
I've had this issue before, apparently some visual C++ libraries could be missing. Try installing Visual C++ Redistributable for Visual Studio 2015.
User contributions licensed under CC BY-SA 3.0