【发布时间】:2018-07-07 04:27:55
【问题描述】:
我在 c# 中创建了一个 dll,正如您使用这种方法所看到的:
namespace Dll
{
public class Check
{
public string JoinString(string fristName, string Lastname)
{
return fristName + " " + Lastname;
}
}
}
我构建了这个 DLL,我想在另一个应用程序 DLLImport 中使用它,如您在此处看到的:
[DllImport("Dll.dll", EntryPoint = "JoinString")]
public static extern string JoinString (string fristName, string Lastname);
private void button1_Click(object sender, EventArgs e)
{
string s = JoinString("aaa", "bbbb");
MessageBox.Show(s.ToString());
}
但我收到此错误:
An unhandled exception of type 'System.EntryPointNotFoundException' occurred in WindowsFormsApplication3.exe
Additional information: Unable to find an entry point named 'JoinString' in DLL 'Dll.dll'.
【问题讨论】: