Browsing the archives for the Gtk tag.


Cropper – Not much better

Software

I found a C#/.NET version of a program that does something similar to what Miguel de Icaza’s Gecko# code does (albeit with a lot more features, and more desktop-oriented focus). It’s called Cropper, and is a program developed by Brian Scott and hosted at CodePlex under a shared-source license called the Microsoft Reciprocal License (Ms-RL, formerly called the Microsoft Community License). Aha, thinks me, this is just what I was looking for. (Why are you looking to do this, again? – ed. I don’t know. I’m like a dog with a bone.)

So of course there are a few problems. This has really been no better than the Mono/Gtk#/Gecko# experience, except as a .NET developer I would have been expecting an easier time of it. Here’s what happened:

  1. The source-control bindings are present in the source code download .zip file. Not a major problem, but annoying.
  2. There are duplicate zero-byte folders in the distro that prompt you for an “Overwrite?” confirmation. Is this some problem with the zip process? Odd. Also annoying.

  1. No README file. How the hell am I supposed to build/install this thing? I’m a .NET dev by trade, so it took me 2 seconds to figure out the deployment build, which creates your .MSI Windows Installer, but this is a big annoyance for anyone not used to the code. (UPDATE: the CropperSetup project contains a ReadMe.htm file, but it’s effectively buried from a new-user point of view)
  2. Biggest problem: When I run Cropper from Start|Program Files, I get the following error:

When I debug using the Microsoft CLR Debugger, I see:

Look familiar? This is the same error I got with my Gecko# test project earlier today. So I can figure out what it’s looking for via the Assembly Bind Failure Logging stuff I figured out earlier: Only this time running cropper from the command line doesn’t give me any log output at all. Running FUSLOGVW.EXE from the command line as per the original MSFT article doesn’t show anything either. Rebuilding with Release (instead of AutomatedRelease, which gave me the .MSI) and running from the \bin\release\ directory didn’t work either. Manually copying the missing assembly from the build directory to the installation directory didn’t work. At this point, I’m thinking WTF? Do I have to rebuild the deployment project from scratch? How much time should I spend on this anyway?

Funny thing: when I debug the error in the VS 2005 Debugger, and not the CLR debugger, I get:

Cropper - 2nd Exception in VS 2005 Debugger

This is why companies like Krugle will have a tough time. Source code is great; free source code is fantastic; but the SCM aspects of it can be a real pain in the ass. Add in abandonware issues with free source and you’re looking at real potential problems.

No Comments

First Attempts at Mono / C# on Windows

Software

I’ve been attempting for the past day to get this simple code example from Miguel de Icaza to work. It uses the Gecko rendering engine from Mozilla to take a snapshot of a web page. Seems like it should be fairly easy, right? Well, let’s see:

Where to get the Gtk# and Gecko# libraries? From Mono, I suppose – since Miguel de Icaza is or was a Mono contributor. Fine, so I get the latest stable build of Mono (1.2.5.2) from mono-project.com, install it locally, and then fire up a text editor to do the recommended HelloWorld test:

using System;
using Gtk;
 
public class GtkHelloWorld {
 
public static void Main() {
Console.WriteLine("HelloWorld");
}
 
}

That compiles fine using the sample command line:

mcs -pkg:gtk-sharp-2.0 helloworld.cs

And when I run it, I get the expected output with no errrors. However, when I try the de Icaza code, which includes the additional reference:

using Gecko;

it doesn’t compile. OK, no problem. I’ll take a guess at the name of the package I’m missing and add the package to the compile command:

mcs -pkg:gtk-sharp-2.0 -pkg:gecko-sharp-2.0 x.cs

(note: source file name changed to x.cs)

.. and I get a successful compile (apparently, as there is no feedback — I (heart) *NIX. Not!).

However, when I run the newly-compiled x.exe, I get this error:

Wait a minute. Why did it compile if it couldn’t find the required libraries? It’s probably some dumb PATH problem. However, I can’t seem to locate *ANY* file in the mono distro called gtk-sharp*.dll.

… so I’m momentarily stumped.

5 Comments