[libvirt] [PATCH] Change/create solution and project for Visual Studio and MonoDevelop for C# bindings

arnaud.champion at devatom.fr arnaud.champion at devatom.fr
Tue Oct 19 14:22:31 UTC 2010


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20101019/7530069b/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Add-Visual-Studio-2010-and-MonoDevelop-solutions.patch
Type: application/octet-stream
Size: 110992 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20101019/7530069b/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Files cleanup.patch
Type: application/octet-stream
Size: 83837 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20101019/7530069b/attachment-0003.obj>


More information about the libvir-list mailing list