将xxx.dll文件的访问地址改为绝对地址解决 将:[DllImport(xxx.dll)]; 修改为:[DllImport(@"C:\Users\hu\Desktop\新建文件夹\OPCServer\xxx.dll")];设置为绝对地址