You're welcome, glad to help you.
depends.exe really helps!
it turns out that there are 7 dlls I'm missing. Thanks to the dll-files.com, I can download all of them.
And put all of them in the same dir with my test exe, it works.
Thank you arnaud, you really help a lot.
发送时间： 2010-10-29 15:38:47
主题： Re: System.DllNotFoundException
what do you mean when you say "I use the .cs file you release to create a dll project" ?
C# bindings are provided with a visual studio 2010 solution, I think it's better to use it if you can. If you can't (because you have vs2005 or vs2008), please re-create a solution with all C# bindings codes.
Be sure you have the dll in your Debug directory :
Also, be carefull about one thing : these dll must be in the directory of the executable. I mean if you create a project "testBinding" which produce "testBindings.exe", then these dlls must be in the same directory of "testBindings.exe".
You can also use "depends.exe" (http://www.dependencywalker.com/) which is a tool used to check dll dependency. You open your libvirt-0.dll with it and see if there is no missing dll (maybe a dll miss you, and I don't see it because my system ever own it, I don't know).
I've compiled libvirt using photron scripts and got the libvirt-0.dll
I use the .cs file you released to create a dll project, and get CSharpDll.dll
Then I create a new project to invoke CSharpDll.dll, I got a System.DllNotFoundException while "Libvirt.Connect.Open" is trying to work.
The exception shows libvirt-0.dll cannot be found.
I tried to put libvirt-0.dll everywhere. In the same dir with .sln, with .cs file, in Debug dir, even in Windows/System32 dir. But I got no luck. It's still stuck.
So I need your help to get me out of the mess. Would you please tell me where I may go wrong?
__________ Information from ESET Smart Security, version of virus signature database 5573 (20101028) __________
The message was checked by ESET Smart Security.