[Gtk-sharp-list] GIO Uri property: System.DllNotFoundException
Dan Saul
daniel.saul at gmail.com
Sun Jan 11 13:49:19 EST 2009
Hi,
I believe I have found a bug in the file
gtk-sharp/gio/FileAdapter.custom:35, [DllImport("gio")] has not been
changed to [DllImport("libgio-2.0-0.dll")], this is causing the Uri
property to fail, changing this line resolves the issue.
Thanks,
Dan
############ Ignore Below, resolved during troubleshooting.
Hi,
I've been experimenting with GIO in SVN. So far everything seems to
work except for the URI property which generates a
System.DllNotFoundException. I'm fairly certain I forgot a step,
however I am unsure which.
One thing I have found that might be the cause of the problem. When
building the GIO SVN, taking a look in
gtk-sharp/gio/generated/FileAdapter.cs:2264 we find [DllImport("gio")]
above static extern IntPtr g_file_get_uri(IntPtr raw); instead of
[DllImport("libgio-2.0-0.dll")] which is referenced everywhere else in
the file. I tried changing it and recompiling however it would appear
this is regenerated for each build. I even tried modifying it as soon
as the build started but same error.
I have attached a small example project that shows the problem. It is
short enough however to be posted in the email. The following compiles
fine, however errors at runtime. Any thoughts on how I should proceed
in troubleshooting from here?
Code:
using GLib;
using System;
namespace Test
{
public class AppMain : GLib.Object
{
public static void Main()
{
Gtk.Application.Init();
File afile = FileFactory.NewForUri("file:///home");
//Console.WriteLine("test "+afile.Path); // Works
Console.WriteLine("test "+afile.Uri); // Doesn't Work
}
}
}
Backtrace:
Unhandled Exception: System.DllNotFoundException: gio
at (wrapper managed-to-native) GLib.FileAdapter:g_file_get_uri (intptr)
at GLib.FileAdapter.get_Uri () [0x00000]
at Test.AppMain.Main () [0x00000]
Thanks,
Dan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: uritest.tar.gz
Type: application/x-gzip
Size: 524 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20090111/1d7878db/attachment-0001.gz
More information about the Gtk-sharp-list
mailing list