I am building a project in .NET Core where I need to use the Framework Assembly System.Web.Extension
. I install the assembly via Reference -> Add Reference -> System.Web.Extension 4.0.0.0
. After it installed it appears under DNX 4.5.1 -> FrameworkAssemblies
. Package restoration was successful as well.
Following entry is added in project.json
file as expected.
"frameworkAssemblies": {"System.Web.Extensions": "4.0.0.0"}
But when I am trying to compile the project using dnu build
, following error appears!
D:\Projects\ColemanApi\src\ColemanApi\Controllers\ValuesController.cs(7,14): DNXCore,Version=v5.0 error CS0234: The type or namespace name 'Web' does not exist in the namespace 'System' (are you missing an assembly reference?)
D:\Projects\ColemanApi\src\ColemanApi\Controllers\ValuesController.cs(51,27): DNXCore,Version=v5.0 error CS0246: The type or namespace name 'JavaScriptSerializer' could not be found (are you missing a using directive or an assembly reference?)
I was following this post but it does not have a solution for .net 5 or I don't know how to Copy Local
in .net 5 as I did not see any Properties option in Assembly's fly-out menu.
And here is a screenshot of the compilation error:
Somebody please help. I am totally screwed up!
UPDATE
I ran dnu list
and it shows the System.Web.Extensions
is resolved. Please see the screenshot below:
Thanks in advance.
JSON.Net provides this functionality. If you want to use this on Core...
https://github.com/JamesNK/Newtonsoft.Json/issues/618#issuecomment-186441534