GNOME Bugzilla – Bug 608959
GstResolveType throws "The path is not of a legal form."
Last modified: 2010-02-04 19:52:18 UTC
I have run into a problem using gstreamer sharp bindings whcih relates to the code in Application.cs as follows: private static System.Type GstResolveType (Gst.GLib.GType gtype, string gtype_name) { Assembly[] assemblies = (Assembly[]) AppDomain.CurrentDomain.GetAssemblies ().Clone (); ...... ...... ...... foreach (Assembly asm in assemblies) { foreach (AssemblyName ref_name in asm.GetReferencedAssemblies()) { string asm_dir = Path.GetDirectoryName(asm.Location); try { .... .... } During the process of iteration to load asssemblies some of the entries at the end (with weird "dynamic" names like w2fzia3w.dll) has the asm.Location set to an empty string. This causes GetDirectoryName to throw the "The path is not a legal form" exception causing (in my case) Parse.Launch(..) of any valid trivial description to fail. I have found that the list off assmblies depends on the application and the bug is therefore dificult to reproduce (i.e. the same code executed perfectly in another application). My solution was to simply check for empty string as follows: foreach (Assembly asm in assemblies) { foreach (AssemblyName ref_name in asm.GetReferencedAssemblies()) { if (asm.Location != "") { string asm_dir = Path.GetDirectoryName(asm.Location); try { Hope this helps somebody else to save a day of debugging !
Thanks for taking the time to report this bug. This particular bug has already been reported into our bug tracking system, but we are happy to tell you that the problem has already been fixed. It should be solved in the next software version. You may want to check for a software upgrade. *** This bug has been marked as a duplicate of bug 604810 ***