ootb System.MissingMethodException: Method not found

250 views
Skip to first unread message

Wallace Turner

unread,
Nov 23, 2017, 10:22:34 PM11/23/17
to RavenDB - 2nd generation document database
I'm getting this error from a File -> New Project -> Console App (.NET Framework)

The exact same code works on a Console App (.NET Core) Project.

To get to this point (in both) I had to apply [this fix] [1] with the point being am falling over very early in the tryout process
I understand this may not be a ravendb bug per se but it is still an impediment to 'getting going quickly'

using (var session = store.OpenSession())



System.MissingMethodException: Method not found: 'System.Func`5<System.Net.Http.HttpRequestMessage,System.Security.Cryptography.X509Certificates.X509Certificate2,System.Security.Cryptography.X509Certificates.X509Chain,System.Net.Security.SslPolicyErrors,Boolean> System.Net.Http.HttpClientHandler.get_ServerCertificateCustomValidationCallback()'.
   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)
   at Raven.Client.Http.RequestExecutor.Create(String[] urls, String databaseName, X509Certificate2 certificate, DocumentConventions conventions)
   at Raven.Client.Documents.DocumentStore.<>c__DisplayClass20_0.<GetRequestExecutor>b__0()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at System.Lazy`1.get_Value()
   at Raven.Client.Documents.DocumentStore.GetRequestExecutor(String database)
   at Raven.Client.Documents.DocumentStore.OpenSession(SessionOptions options)
   at Raven.Client.Documents.DocumentStore.OpenSession()
   at ConsoleApp2.Program.Main(String[] args) in c:\Users\wal\source\repos\ConsoleApp2\ConsoleApp2\Program.cs:line 23

[1]: https://groups.google.com/forum/#!searchin/ravendb/installing$20index$20with$20certificate%7Csort:date/ravendb/LgKIOyhkIQs/DXPx_vROBgAJ

Oren Eini (Ayende Rahien)

unread,
Nov 24, 2017, 3:21:52 AM11/24/17
to ravendb
Please make sure that you are using the right version of the framework there. It looks like you are building against .NET Core 1.1 and not 2.0

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Wallace Turner

unread,
Nov 25, 2017, 4:21:04 PM11/25/17
to RavenDB - 2nd generation document database
Oren, what version(s) of the .net framework have you been testing your raven4 client library on ?

After investigating this further it appears there are  200 missing APIs that were part of .NET Standard 2.0 but not actually implemented by .NET Framework 4.6.1, 4.6.2 or 4.7 [1]: 

Those missing are detailed here [2] which includes `ServerCertificateCustomValidationCallback`  


To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.

Oren Eini (Ayende Rahien)

unread,
Nov 26, 2017, 8:04:59 AM11/26/17
to ravendb
We are testing mostly on the CoreCLR. We have also tested somewhat on the full framework, but apparently not enough.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Fitzchak Yitzchaki

unread,
Dec 4, 2017, 4:42:32 AM12/4/17
to RavenDB - 2nd generation document database
Hello,

This was fixed, please try with the next nightly build.

Note, that you might need to add the following in your code:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
ServicePointManager.ServerCertificateValidationCallback += OnServerCertificateCustomValidationCallback;

Wallace Turner

unread,
Dec 4, 2017, 7:12:04 AM12/4/17
to RavenDB - 2nd generation document database
what is the body of `OnServerCertificateCustomValidationCallback`

Oren Eini (Ayende Rahien)

unread,
Dec 4, 2017, 7:47:45 AM12/4/17
to ravendb
Whatever you want it to be is you need to actually do certificate validation
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Wallace Turner

unread,
Dec 4, 2017, 7:53:51 AM12/4/17
to RavenDB - 2nd generation document database
sure but why 'might' we need to provide it ? the default-shipped code will check the certs properly vs bypassing/implementing it yourself

Oren Eini (Ayende Rahien)

unread,
Dec 4, 2017, 7:58:02 AM12/4/17
to ravendb
For example, if you are using self signed certs, or require the certs to be from a particular issuer.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Wallace Turner

unread,
Dec 4, 2017, 8:04:01 AM12/4/17
to RavenDB - 2nd generation document database
yes i know but Fitzchak implying you might need to implement it as part of the fix; its confusing
if you're using raven.client and lets encrypt you shouldnt need it. (unless you say otherwise for some reason)

Wallace Turner

unread,
Dec 4, 2017, 8:04:43 AM12/4/17
to RavenDB - 2nd generation document database
yes i know but Fitzchak implying you might need to implement it as part of the fix; its confusing
if you're using raven.client and lets encrypt you shouldnt need it. (unless you say otherwise for some reason)

On Monday, 4 December 2017 20:58:02 UTC+8, Oren Eini wrote:

Oren Eini (Ayende Rahien)

unread,
Dec 4, 2017, 8:04:47 AM12/4/17
to ravendb
Correct.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages