I created a DLL in C#, and try to call a function from it. But it has an error:
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
My DLL code:
using System;
namespace Draf_Lib
{
public class Class1
{
public static int add(int x, int y) { return x + y; }
}
}
And here is my C# code to call the function from it:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
//using MacroLib;
using Draf_Lib;
namespace Draft1
{
internal class Program
{
static void Main(string[] args)
{
System.Console.WriteLine("Hello");
Class1 c = new Class1();
int b = Class1.add(9, 8);
Console.WriteLine(b);
}
}
}
I already included the library as a reference. Can anyone suggest me a way to fix it?