.NET 4.0 Cannot resolve reference to System.Web.Extensions assembly

爷,独闯天下 提交于 2019-12-08 03:30:41

问题


I'm trying to import System.Web.Script.Serialization so I can deserialize JSON, but in my Imports statement, Visual Studio can't find the System.Web.Extensions assembly.

Before you dismiss this, I have already made sure I am not using .NET 4.0 Client, and have tried to reference the assembly through the Reference Manager, through the Properties window, and by dragging and dropping the file directly to the Bin folder, then attempting to reference it. I still get the following error.

I have already checked to make sure I'm in .NET 4.0 and not 4.0 Client

And the assembly shows up in my References

It also shows up in my web.config file

and in my file system at the same location it shows in the References dialog

When I go to "Add Reference" > "Assemblies" > "Framework" (it's targeting .NET 4.0) and click on System.Web.Extensions the dialog closes as if it has completed the action, but if I go back in, it's still not checked.

Any ideas?


回答1:


Okay, so I tried a bunch of stuff: reinstalling VS2012, removing all references and re-adding them, changing the physical location of the file, and nothing worked. As it turns out, even though VS2012 claimed it couldn't find the assembly, it still works when being built and executed. I'm still not sure why VS2012 doesn't like only that particular assembly, but at this point, I'll chock it up to a random error and report it to Microsoft.



来源:https://stackoverflow.com/questions/28077469/net-4-0-cannot-resolve-reference-to-system-web-extensions-assembly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!