Unhandled exception of type “System.IO.FileNotFoundException” in VkNet.dll
More Information: Could not load file or assembly
“Newtonsoft.Json, Version = 4.5.0.0, Culture = neutral,
PublicKeyToken = 30ad4fe6b2a6aeed “or one of their dependencies.
the specified file can be found.
This error appears when trying to get all the user’s photos.
private void button1_Click (object sender, EventArgs e)
{
var getAll = vk.Photo.GetAll (Convert.ToInt32 (textBox1.Text), true, 20, 0, true, false);
foreach (var photos in getAll)
{
textBox1.Text = photos.CreateTime.ToString ();
}
}
Tell me, please, what is the problem? Authorization is successful.
Answer 1, authority 100%
The VkNet.dll library apparently needs the Newtonsoft.Json.dll library. Install Json.NET via nuget or manually add a link to the project. You can also add the dll itself to the project, specify in the properties “Copy to output directory – Copy later version” and “Build action – no”