http://www.codeproject.com/Articles/49003/SCSI-Library-in-C-Burn-CDs-and-DVDs-Access-Hard-Di的第三方库(Helper.dll)使用.NET 2.0。主要应用程序使用.NET 4.5。 有下面的代码库:使用第三方库(带反射)的.NET应用程序旧版本.NET版本
memcpyimpl = (memcpyimplDelegate) Delegate.CreateDelegate(typeof(memcpyimplDelegate), typeof(Buffer).GetMethod("memcpyimpl", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static));
其中
public unsafe delegate void memcpyimplDelegate(byte* src, byte* dest, int len);
在运行时引发错误
,因为,也许,这段代码利用最新的组装Buffer类,但没有Buffer.memcpyimpl方法.NET 4.5。
如何让库使用.NET 2.0中的Buffer类?