C#调用动态链接库DLL

Source

vs2017生成动态链接库:

https://blog.csdn.net/qq_23229787/article/details/87786373

C#调用动态链接库方法

[DllImport("mydll.dll")]
public static extern int Add(int a,int b);

 private void btn_add_Click(object sender, EventArgs e)
        {
            int sum=Add(5,6);
            MessageBox.Show(sum.Tostring());            
        }

出现问题列表:

1.