I don't understand why this error in my screen):

EdiUseDLL:
using System; using System.Runtime.InteropServices; class Program { const string Path = @"C:\Users\Maxim\Desktop\EdiUseDLL\EdiLibraryExample\bin\Release\net7.0\EdiLibraryExample.dll"; [DllImport(Path, CallingConvention = CallingConvention.Cdecl)] public static extern int Add(int a, int b); static void Main() { int result = Add(5, 3); Console.WriteLine("Result of addition: " + result); } } EdiLibraryExample:
namespace EdiLibraryExample { public class Class1 { public static int Add(int a, int b) { return a + b; } } }

How to create dll which I can use with DLLImport in c#
I hope you will help me!)
Источник: https://stackoverflow.com/questions/772 ... -dont-work
Мобильная версия