-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArgumentNullException in mscorlib when attempting to enumerate with First() #252
Comments
Hey Tom. I'm so sorry that I didn't reply to this issue a couple of months earlier; it flew by my inbox without me noticing until today. The error that is occurring here must be something specific to your model class. The DataContractDatumConverterFactory attempts to emit a new datum converter class with IL generation so that it is very efficient, but, clearly is hitting an exception in the process. Is there any chance you can post the type you're encountering this on? Looking closely at the stack trace and the code, it looks like what might be failing is that typeof(T).GetConstructor(new Type[0]) is null. That would indicate that your model class doesn't have a parameterless constructor, so, the datum converter doesn't know how to construct instances of the model class. That would make sense to be an error (albeit, ideally a clear and legible one!). |
Hello mfenniak, thank you for replying to this. I never did find a way around this (it's for a toy project) but the original Models.Accounts class (which inherits RethinkModel, declares some datamembers, and sets its table) was missing a parameterless constructor. Per your reponse, I added one, and the error seems to have morphed into something else (exception throws on the same line):
So now it's a TypeLoadException with "Access Denied". I'm hoping this is something simple that I've missed. Also, I'm a little unclear on what you mean by type; do you mean the I can post the Models.Account source if you like; it's fairly boring but perhaps incomplete... but I'm hoping this error is something simple :) Thank you, Tom PS/edit- in the off-chance that either of these two factoids are useful: the rethinkdb data folder lives in a Dropbox folder and the two-line version header that rethinkdb starts up with is as follows:
|
Hello everyone,
I'm brand new to rethinkdb, rethinkdb-net, and LINQ, so please forgive me in advance if this is a simple error on my part or misposted in any way.
With rethinkdb 2.3.0-windows-beta (MSC 190023506) and rethinkdb-net 0.12.1, I am experiencing an ArgumentNullException when attempting to enumerate a rethinkdb query with First(). I believe I have configured the database correctly as I am able to Query.DbList() -- the app will crash if its database is missing -- so I am not really sure what is going on. I also believe the model to be defined correctly, as I have copied the provided example with only a minimum of changes.
The line that crashes is supposed to be a fairly mundane account lookup. The app is a new project so I can not say I have seen rethinkdb-net work prior, other than the example I gave. The lines are (assuming the rest of this code works):
If I attempt to explore the model with Intermediate Window, whatever result is obscured:
Expanding this view using debug tooltips reveals... the same exception, buried inside.
Theres a bunch of references to DataContractDatumConverterFactory near the top of the stack trace, though I am not sure what to make of the entire trace. Am I experiencing a bug?
The entire stack trace is as follows:
Thank you for looking into this.
Tom
The text was updated successfully, but these errors were encountered: