C# Windows app updating JSON file error.

I am writing a application that reads and updates a JSON file.
I can read it OK but when I try to updaed it, I get the following error:
Severity      Code      Description      Project      File      Line      Suppression State
Error      CS0656      Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create'

The code I am using to update is:

 public bool SetSystemOptions(int MinRxLThreshold, ref string messag)
            SysSettings SysSetting;
            bool Success = true;
            string json = File.ReadAllText("settings.json");
            dynamic jsonObj = Newtonsoft.Json.JsonConvert.DeserializeObject(json);
            jsonObj[0]["Password"] = "new password";
            string output = Newtonsoft.Json.JsonConvert.SerializeObject(jsonObj, Newtonsoft.Json.Formatting.Indented);
            File.WriteAllText("settings.json", output);

            return Success;
Spike UKCTOAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Fernando SotoRetiredCommented:
Please post a sample json file that the code is using. Thanks.
Spike UKCTOAuthor Commented:
    "min_scans": 5,
    "password": 5,
    "user": 40,
    "threshold_meters": 50,
    "min": 1000,
    "max": 100,
    "invalidthreshold": 120,
    "invalid_drop": false,
    "filter_params": false
Fernando SotoRetiredCommented:
Try changing the following line in your code from this
 jsonObj[0]["Password"] = "new password";

Open in new window

to this
 jsonObj["Password"] = "new password";

Open in new window

Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

Spike UKCTOAuthor Commented:
Tried that- didn't help. Any other ideas?
Fernando SotoRetiredCommented:
In the solution I posted I used the Jason structure you posted and got the result. So what did it returned In your project and what where you expecting.
Spike UKCTOAuthor Commented:
Istill get the error (when I try to cmpile the project):

Severity      Code      Description      Project      File      Line      Suppression State
Error      CS0656      Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create'
Fernando SotoRetiredCommented:
Please see this Microsoft link on this issue.  Compiler Error CS0656

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Spike UKCTOAuthor Commented:
Fernando SotoRetiredCommented:
Please supply the resolution for others in the future having the same issue.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.