I have this code for my web-part for sharepoint:
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.Script.Serialization;
using Newtonsoft.Json.Linq;
namespace ScheduleWeeks.WP_ScheduleWeek
{
public partial class WP_ScheduleWeekUserControl : UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (Request.Params["jsonData"] != null)
{
string jsonStr = Request.Params["jsonData"];
JObject root = JObject.Parse(jsonStr);
}
else
{
Response.Write("nothing there");
}
}
}
}
But it doesn't work and show an error like
[FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. Couldn't locate a file.]
But then I comment string "JObject root = JObject.Parse(jsonStr);
" all works without any errors. What I do in a wrong way?
P.S.: Json.net was installed with NuGet.