question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

System.ArgumentNullException: Value cannot be null. Parameter name: method on Xamarin

See original GitHub issue

Im facing System.ArgumentNullException when trying simple query for data var bme280Datas = _database.GetCollection<Bme280Data>().FindAll().ToList(); and Bme280Data is

public sealed class Bme280Data
    {
        public int Id { get; set; }

        public short Temperature { get; set; }

        public ushort Humidity { get; set; }

        public ushort Voltage { get; set; }

        public DateTime SampleTime { get; set; }
    }

Platform - android Stack trace

at System.Dynamic.Utils.ContractUtils.RequiresNotNull (System.Object value, System.String paramName) [0x00003] in <65f4a23934a3468fae9abe3139b55169>:0 
at System.Linq.Expressions.Expression.Call (System.Reflection.MethodInfo method, System.Linq.Expressions.Expression arg0, System.Linq.Expressions.Expression arg1) [0x00000] in <65f4a23934a3468fae9abe3139b55169>:0 
at LiteDB.BsonExpression.ParseSingleExpression (LiteDB.StringScanner s, System.Linq.Expressions.ParameterExpression root, System.Linq.Expressions.ParameterExpression current, System.Boolean isRoot) [0x0004c] in <6f75477a91534fc2988d43bc90c66db1>:0 
at LiteDB.BsonExpression.ParseExpression (LiteDB.StringScanner s, System.Linq.Expressions.ParameterExpression root, System.Linq.Expressions.ParameterExpression current, System.Boolean arithmeticOnly) [0x00000] in <6f75477a91534fc2988d43bc90c66db1>:0 
at LiteDB.BsonExpression.Compile (LiteDB.StringScanner s, System.Boolean pathOnly, System.Boolean arithmeticOnly) [0x00045] in <6f75477a91534fc2988d43bc90c66db1>:0 
at LiteDB.BsonExpression.Compile (System.String expression) [0x0003a] in <6f75477a91534fc2988d43bc90c66db1>:0 
at LiteDB.BsonExpression..ctor (System.String expression) [0x00010] in <6f75477a91534fc2988d43bc90c66db1>:0 
at LiteDB.Query.Run (LiteDB.CollectionPage col, LiteDB.IndexService indexer) [0x0007d] in <6f75477a91534fc2988d43bc90c66db1>:0 
at LiteDB.LiteEngine+<Find>d__9.MoveNext () [0x000cd] in <6f75477a91534fc2988d43bc90c66db1>:0 
at LiteDB.LiteEngine+<Find>d__13.MoveNext () [0x001e4] in <6f75477a91534fc2988d43bc90c66db1>:0 
at LiteDB.LiteCollection`1+<Find>d__17[T].MoveNext () [0x000ba] in <6f75477a91534fc2988d43bc90c66db1>:0 
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList (Newtonsoft.Json.JsonWriter writer, System.Collections.IEnumerable values, Newtonsoft.Json.Serialization.JsonArrayContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract collectionContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty) [0x000e1] in <c3eb1c8f9b8642959353a9d68d902f08>:0 
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue (Newtonsoft.Json.JsonWriter writer, System.Object value, Newtonsoft.Json.Serialization.JsonContract valueContract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty) [0x000d4] in <c3eb1c8f9b8642959353a9d68d902f08>:0 
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize (Newtonsoft.Json.JsonWriter jsonWriter, System.Object value, System.Type objectType) [0x00079] in <c3eb1c8f9b8642959353a9d68d902f08>:0 
at Newtonsoft.Json.JsonSerializer.SerializeInternal (Newtonsoft.Json.JsonWriter jsonWriter, System.Object value, System.Type objectType) [0x00253] in <c3eb1c8f9b8642959353a9d68d902f08>:0 
at Newtonsoft.Json.JsonSerializer.Serialize (Newtonsoft.Json.JsonWriter jsonWriter, System.Object value, System.Type objectType) [0x00000] in <c3eb1c8f9b8642959353a9d68d902f08>:0 
at Newtonsoft.Json.JsonConvert.SerializeObjectInternal (System.Object value, System.Type type, Newtonsoft.Json.JsonSerializer jsonSerializer) [0x00028] in <c3eb1c8f9b8642959353a9d68d902f08>:0 
at Newtonsoft.Json.JsonConvert.SerializeObject (System.Object value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) [0x00007] in <c3eb1c8f9b8642959353a9d68d902f08>:0 
at Newtonsoft.Json.JsonConvert.SerializeObject (System.Object value) [0x00000] in <c3eb1c8f9b8642959353a9d68d902f08>:0 
at App1.MainActivity.GetHumidityAndTemperatureJson (SimpleHttpServer.Models.SimpleHttpRequest arg) [0x00012] in F:\0\13_wtf\repos\App1\App1\MainActivity.cs:83 
at HttpServer.HttpProcessor.RouteRequest (System.IO.Stream inputStream, System.IO.Stream outputStream, SimpleHttpServer.Models.SimpleHttpRequest request) [0x0008d] in F:\0\13_wtf\repos\App1\HttpServer\HttpProcessor.cs:147 

Inserts and Count() works fine Any ideas?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mbdavidcommented, Feb 9, 2018

LiteDB is standalone only for .NET Full… for NetStandard some packages are required by framework

1reaction
tshcherbancommented, Feb 9, 2018

Sorry for bothering you @mbdavid, but after few hours of investigation I found out that somehow System.Reflection.TypeExtensions package was not installed. After i created clean project and added LiteDB, package manager also installed all dependencies correctly, and for now all is working. Sorry for my lack of knowledge.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xamarin Form Error Value cannot be null. Parameter name
It appears if you try to set the Command property to something Xamarin Forms does not know you will get this error. If...
Read more >
Xamarin Forms: "Value cannot be null. Parameter name
Running a Xamarin Forms solution sometimes throws a compile error with the message: Value cannot be null. Parameter name: method
Read more >
"Value cannot be null. Parameter name: method" · Issue ...
Running a Xamarin Forms solution sometimes throws a compile error with the message: Value cannot be null. Parameter name: method pertaining ...
Read more >
System.ArgumentNullException Value cannot be null. ...
Hello,. just updated nugets and both exceptions still occur. We did some tests with the latest Xamarin.Forms version available and it seems that ......
Read more >
System.ArgumentNullException: Value cannot be null. ...
System.ArgumentNullException: Value cannot be null. Parameter name: str when using null values on iOS.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found