Ext.Net and Mono   March 15th, 2011

I like ext.js/Sencha for having a rich client in the browser.

On the other hand, we are using Mono for running our .Net server.

ext.net is a good library that helps you to easily write web applications, based on your .net libraries.

For OpenPetra, I have created an online application system, and the backend for the registration office is written with ext.net.
Here are some problems I came across, and how I solved them:
First, I had to recompile the ext.net dlls and also the Newtonsoft.Json.Net20.dll.
The Newtonsoft.Json.Net20.dll has been compiled with the latest compiler built from Mono 2.8 trunk. This was necessary so that no Microsoft dlls were linked in.
The ext.net dll was built against the Mono compiled Newtonsoft.Json.Net20.dll on Windows with SharpDevelop. The mono compiler crashed on Linux when trying to build the ext.net solution.
The resulting files are available from the online source repository of OpenPetra, eg. http://bazaar.launchpad.net/~openpetracore/openpetraorg/trunkhosted/files/head:/csharp/ThirdParty/ext.net/
I was not able to get Ext.Net to run with the latest Mono 2.8, but it is working fine with 2.6.7.
I had to build it from the sources.
Some links related to the problems I had with Mono 2.8 and Ext.Net:
compile ext.net: There is no implicit reference conversion from `Ext.Net.ComboBox’ to `Ext.Net.ComboBoxBase
Running ext.net on Mono 2.8: get the error: Cannot add a Ext.Net.Parameter to System.String
For the moment, the solution for me was to use Mono 2.6.7.
The examples of ext.net only show the c# code inside the aspx file, but with growing size of the code it would be good to be able to split the code behind code from the UI code.
This is possible, but you need to define all controls in the .cs file, at least those you want to use in your code behind code.
In the aspx file, make sure you have at the top:
<%@ Page Language="C#"
Inherits=”Ict.Petra.WebServer.MConference.TPageOnlineApplication”
src=”Desktop.aspx.cs” %>

<%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>

see the whole file here: OnlineRegistrationBackend/Desktop.aspx

Now I ran into errors like this when Mono was compiling the code on the fly:

Compiler Error Message: CS1644: Feature `anonymous types’ cannot be used because it is not part of the C# 2.0 language specification

I found on the Internet this page: http://www.4guysfromrolla.com/articles/121207-1.aspx

linked from http://web.archiveorange.com/archive/v/c2PM7RMRJf7Ti7PP7uVb, where they discuss how to use “extension methods” and “collection initializers” with Mono.
I have added all those settings to my web.config, see the result here:
You can see a running demo here: http://demo.openpetra.org:8009/

BsDiff for Windows and .net   November 18th, 2007

This program is based on the excellent unix tool bsdiff from Colin Percival.

I made some adjustments, so that it would compile in C++ mode in Dev-C++ IDE (mingw compiler), using the libbzip2 package.

This version is based on bsdiff 4.1. The difference between 4.1 and 4.2 is only in the patch program, instead of using lseek and read he now uses pread, which I find this text about it:
source
Another thing to take note of is that Linux 2.2 introduces the pread() and pwrite() system calls. These allow a process to read and write from a specified position in a file. This is similar, but not identical, to using the lseek() system call followed by an ordinary read() or write() system call. In particular, concurrent access to a file (required for asynchronous I/O (AIO) support) requires the pread() and pwrite() system calls.

In the windows version, I had to adjust the code anyway, because I am not using pipes, but keep the file open for reading. I guess the bug of the official bsdiff had to do with the concurrent access of the several forks of the program to the file. That does not happen in the windows version at all, the file is opened only once.

For questions, write to Timotheus Pokorra.

Here are the sources (including the .dev files for Dev-C++): bsdiff_win_src.zip
Here are the 2 executables: bsdiff_win_exe.zip
The code is licensed under the BSD Protection License (see the original LICENSE file in bsdiff-4.1.tar.gz).

See also Andreas John’s bsdiff for Visual C++.

May 2007: I have ported the program to Delphi.net, and with small modifications (make it a proper dll) you can use it even with C# programs. If anyone is interested in the code, I will be happy to share it. Drop me an email…
June 2007: Ok, someone has dropped me an email, and here is the delphi.net version, with all required dlls. also read the readme.txt included in the archive, and the documentation in bsdiff.pas. If you have questions, ask!
bsdiff.net.zip