Hi,
 
here are 2 patches for C# libvirt bindings.
 
These patches create a new solution/project couple for Visual Studio 2010 with also a sample code and a solution/project couple for MonoDevelop with a sample code also.
 
The sample code have been tested under .Net/Windows, Mono/Windows and Mono/Linux. And it works, the sample code consist of the using au virConnectOpenAuth and callback handling. It connect to a URI (I have made my tests with ESX hypervisor only) and list domains in a listbox.
 
So, to summarize, code work under linux or windows, the binary library name depends of a project directive (a kind of pragma). When the directive WINDOWS is declared, DllImport will try to find "libvirt-0.dll" (for windows) otherwise it looks for "libvirt.so.0" (for linux). For now, in the same manner, when the directive WINDOWS is declared, we find _strdup in "msvcrt.dll" otherwise we look in "libc.so.6".
 
I'm currently trying to remove strdup call by Custom Marshaling but it seems that .Net (or Mono anyway) doesn't allow to use custom marshaler with structure (and we need it for virConnectCredential structure). If anyone had an idea...
 
Arnaud