Could not load file or assembly System.Runtime.InteropServices.RuntimeInformation

2,564 views
Skip to first unread message

Daniel Pilon

unread,
Apr 19, 2018, 9:29:33 PM4/19/18
to RavenDB - 2nd generation document database
I'm referencing RavenDb.Client from NuGet in a .NET Framework 4.6.2 (machine doesn't have either coreclr or framework 4.7.x installed) targeted app and getting the following error:

System.TypeInitializationException: The type initializer for 'Sparrow.Platform.PlatformDetails' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime.InteropServices.RuntimeInformation, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
   at Sparrow.Platform.PlatformDetails..cctor()
   --- End of inner exception stack trace ---
   at Raven.Client.Http.RequestExecutor.CreateHttpMessageHandler(X509Certificate2 certificate, Boolean setSslProtocols)
   at Raven.Client.Http.RequestExecutor.CreateClient()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at System.Lazy`1.get_Value()
   at Raven.Client.Http.RequestExecutor..ctor(String databaseName, X509Certificate2 certificate, DocumentConventions conventions, String[] initialUrls)
   at Raven.Client.Http.ClusterRequestExecutor..ctor(X509Certificate2 certificate, DocumentConventions conventions, String[] initialUrls)
   at Raven.Client.Http.ClusterRequestExecutor.Create(String[] initialUrls, X509Certificate2 certificate, DocumentConventions conventions)
   at Raven.Client.ServerWide.Operations.ServerOperationExecutor..ctor(DocumentStoreBase store)
   at Raven.Client.Documents.Operations.MaintenanceOperationExecutor.get_Server()

Couldn't find System.Runtime.InteropServices.RuntimeInformation as a dependency in the NuGet package, however installing it manually from NuGet did the trick. Shouldn't we have an explicit dependency for it in the package?

Paweł Pekról

unread,
Apr 20, 2018, 6:55:08 AM4/20/18
to RavenDB - 2nd generation document database
Hi,

I've tried to reproduce this on a clean Windows 10 (version 1709) but everything seems to be working fine. The machine does not have anything installed (beside Microsoft OneDrive). Can you tell us what is the setup that you are using?

P.

Daniel Pilon

unread,
Apr 20, 2018, 12:09:02 PM4/20/18
to RavenDB - 2nd generation document database
I'm trying in a machine with Windows 10 and the latest .NET Framework installed is .NET Framework 4.6.2.

Paweł Pekról

unread,
Apr 20, 2018, 2:37:11 PM4/20/18
to RavenDB - 2nd generation document database
Thanks Daniel, it appears to be a common issue when netstandard is ussed with .NET Framework <= 4.6.2. We will add this dependency: http://issues.hibernatingrhinos.com/issue/RavenDB-10975

Daniel Pilon

unread,
Apr 21, 2018, 9:59:22 AM4/21/18
to RavenDB - 2nd generation document database

hanks Paweł.

I've also had trouble to Initialize a DocumentStore because of a missing System.ValueTuple, which I had to manually install via NuGet.

I did some more digging with DependencyWalker, and looks like netstandard is screwed among other parts. I don't know when these will bug me on the client usage, but on the screenshot below you can see that 7 more dependencies are missing.

Daniel Pilon

unread,
Apr 21, 2018, 10:00:36 AM4/21/18
to RavenDB - 2nd generation document database
8, in fact.
Reply all
Reply to author
Forward
0 new messages