我从c#调用以下代码:
[DllImport("u3dapi10.dll", CharSet=CharSet.Auto)]
public static extern uint dapiCreateSession(out uint hSession);.NET在哪里寻找u3dapi10.dll文件?这是以前的工作,但现在我得到了一个DLLNotFoundException。
u3dapi10.dll文件位于项目的根目录下。我尝试将其复制到bin/debug目录,只是想看看发生了什么,但在那里也找不到它。
可能的原因:会不会是u3dapi10.dll与64位不兼容?例如,如果您尝试从64位计算机访问32位动态链接库,是否会抛出DllNotFoundException?或者它会像BadImageFormatException when loading 32 bit DLL, target is x86建议的那样抛出一个BadImageFormatException
发布于 2011-05-12 05:23:59
请参阅:Specify the search path for DllImport in .NET
和
http://msdn.microsoft.com/en-us/library/ms682586%28VS.85%29.aspx
https://stackoverflow.com/questions/5970639
复制相似问题