Set MaxNumberOfCachedRequests before Initialize throw NullReferenceException with Raven build #2261

155 views
Skip to first unread message

maxx

unread,
Feb 8, 2013, 6:55:57 AM2/8/13
to rav...@googlegroups.com
Hello,

I have updated my project to the new Raven build 2261 and after start the my application a NullReferenceException was thrown on Initialize the DocumentStore.

Code:
            var raven = new Raven.Client.Document.DocumentStore { ConnectionStringName = "RavenDB", DefaultDatabase = env };
            raven.Conventions.DisableProfiling = true;
            raven.Conventions.ShouldCacheRequest = url => false;
            raven.MaxNumberOfCachedRequests = 10;

            raven.Initialize(); <- NullReferenceException Object reference not set to an instance of an object.

The problem is MaxNumberOfCachedRequests, if I set MaxNumberOfCachedRequests after Initialize() it works fine, should it be so?

regards
 maxx

Iulian Margarintescu

unread,
Feb 8, 2013, 7:13:53 AM2/8/13
to rav...@googlegroups.com
I had a similar problem:

documentStore.MaxNumberOfCachedRequests = 10;
store.JsonRequestFactory.ConfigureRequest += JsonRequestFactoryOnConfigureRequest();

If i set MaxNumberOfCachedRequests the JsonRequestFactory on the next line is null and throws. If i don't set MaxNumberOfCachedRequests everything works fine. 
Reply all
Reply to author
Forward
0 new messages