Method not found: "void newtonsoft. JSON. serialization. defaultcontractresolver. set_ignoreserializableattribute (Bo

Source: Internet
Author: User

I recently wrote. Net mvc4.0ProgramThe following error occurs:

Method not found: "void newtonsoft. JSON. serialization. defaultcontractresolver. set_ignoreserializableattribute (Boolean )".

After repeated debugging, it is found that the newtonsoft. JSON package version is incorrect. After the update, the problem is solved. The following describes the cause and solution of the error.

My development tool is vs2010 and the project is mvc4.0

I. Reasons

When my project was almost done, I had a little free time, so I wanted to take a deeper look at vs2010. By the way, I updated web components, and some components were updated to vs2012. After the update, start to sort out your projects. This is an error that occurs when the program always jumps to routeconfig. CS.Method not found: "void newtonsoft. JSON. serialization. defaultcontractresolver. set_ignoreserializableattribute (Boolean )".It seems that the MVC routing configuration cannot be executed.

Ii. Solution Process

After searching for it online for half a day, it may be newtonsoft. JSON. DLL, so I want to use nuget to compare the new version. It turns out that nuget cannot be used. Well, I went to the nuget release website to update nuget, after updating nuget, newtonsoft is found in my project. JSON is 4.5.1 and the latest version is 4.5.9. It is updated immediately and the final problem is solved.

Iii. Doubts

After the newtonsoft. JSON package is updated, the page can be viewed normally, but the previous error may occur occasionally, but this situation is rare and I don't know why. If you encounter the same problem, contact me to thoroughly investigate this bug.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.