Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.Binder.Convert'
Getting this error while compiling the code from documentation. Could be due to the missing "Microsoft.CSharp" assembly. What configuration required to fix this ?
private string CreateJson(IDataReader dataReader)
{
var list = new List();
var cnt = dataReader.FieldCount;
var fields = new List();
for (int i = 0; i < cnt; i++)
{
fields.Add(dataReader.GetName(i));
}
while (dataReader.Read())
{
dynamic exo = new System.Dynamic.ExpandoObject();
foreach (var field in fields)
{
((IDictionary)exo).Add(field, dataReader.GetColumnValue(field));
}
list.Add(exo);
}
return JsonConvert.SerializeObject(list);
}
Like
Hello,
The issue you mentioned is related to the missing compiler member 'Microsoft.CSharp'. To fix this, you need to add a reference to this library in your project. Add a reference to Microsoft.CSharp.dll.
You can also read the documentation that may help you: