In my case I have one project which has one console project(.Net Framework 4.7.2) and one Class library project (.Net standard 2.0). I am calling class library method which using "Newtonsoft.Json" from console app, and I receive a runtime error below:
System.IO.FileNotFoundException:" 'Could not load file or assembly 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.'"
Console project code:
using TestSdk;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
ConnectWeb obj = new ConnectWeb("");
string pin = obj.test("test");
}
}
}
Class library code:
using Newtonsoft.Json;
namespace TestSdk
{
public class ConnectWeb
{
public string test(string testStr)
{
return JsonConvert.DeserializeObject<string>(testStr);
}
}
}