I know there are quite a lot of resources related to this question. However most of them are related to old .Net versions. I checked the following link1 and link2. I tried both and other similar solutions but it doesn't work.
Wierd thing that I failed to figure out so far is in one project it doesn't complain. The other project is what causes the issue. Both of these are using .Net Framework is 4.6 and i am using VS 2017. This is what I get in the console.
Both projects are refering to the same System.Web.Extensions with v4.0.30319. I compared web.config in both projects' related areas to see whether there are any differences but I couldn't find any.
I would appreciate some alternate methods for me to troubleshoot. I am running out of options!!!