c# - How to add `System.Web.Extensions` assembly to .net core project in vscode -


i have installed c# support vscode(version 1.15.0) , created helloworld project via dotnet new console.

now in program.cs, use javascriptserializer class depends on system.web.extensions assembly. typed using system.web.script.serialization; , run dotnet restore ,but vscode cannot resolve it. error is,

the type or namespace name 'web' not exist in namespace 'system' (are missing assembly reference?)

it seems system.web not part of .net core, there way add assembly project?

i cannot find project.json file refered in other posts since csproj project.

system.web.extensions part of full .net framework . if want serialize , deserialize object,you can use newtonsoft.json,

#using newtonsoft.json .... jsonconvert.deserializeobject(json); 

update

just package name , version number nuget , add .csproj save. prompted run restore import new packages.

<itemgroup>      <packagereference include="newtonsoft.json" version="9.0.1" />   </itemgroup> 

Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -