collapse Blogs I Read
collapse Table of Contents
  1. Linq to SQL on Mono 2.6: NerdDinner on Mono - Jonathan Pryor's web log
    1. Linq to SQL on Mono 2.6: NerdDinner on Mono

Linq to SQL on Mono 2.6: NerdDinner on Mono - Jonathan Pryor's web log

« Mono.Data.Sqlite & System.Data in MonoTouch 1.2 [Preview] | Main | Re-Introducing mdoc »

Linq to SQL on Mono 2.6: NerdDinner on Mono

NerdDinner is an ASP.NET MVC sample, licensed under the Ms-PL with sources hosted at CodePlex.

Back on May 14th, I wrote that NerdDinner could be run under Mono using trunk.

Now, I'm pleased to note that the just-released Mono 2.6 includes these changes. Furthermore, thanks to ankit's progress on xbuild, installation and setup is easier than before:

  1. Build (or otherwise obtain) Mono 2.6. The Parallel Mono Environments page may be helpful.
  2. Download the NerdDinner 1.0 sources through a web browser. (curl or wget won't work.)
  3. Extract the NerdDinner sources:
    $ mkdir -p $HOME/tmp
    $ cd $HOME/tmp
    $ unzip "/path/to/NerdDinner 1.0.zip"
  4. Build NerdDinner 1.0:
    $ cd "$HOME/tmp/NerdDinner 1.0"
    $ xbuild NerdDinner/NerdDinner.csproj
    (Unfortunately we can't build just run xbuild (or build NerdDinner.sln) as this requires access to the MSTest assemblies used by the NerdDinner unit tests, which aren't currently present on Mono.)
  5. Only the web portion runs under Mono, as does the data access layer (System.Data.Linq, more affectionately known as Linq to SQL). The database is still Microsoft SQL Server. Go forth and configure the NerdDinner server (if you don't already have one configured).
  6. Back on the Linux side of things, edit $HOME/tmp/NerdDinner 1.0/NerdDinner/ConnectionStrings.config, and change the NerdDinnerConnectionString connection string to:
    <add name="NerdDinnerConnectionString"
        connectionString="Data Source=gourry\SQLEXPRESS;
        Initial Catalog=NerdDinner;
        User ID=gourry\jonp;
        Password=123456; 
        Integrated Security=true"/>
    
    You will need to adjust the machine name in the Data Source parameter to contain your actual computer name, and change the User ID and Password to whatever values you chose when configuring SQL Server.
  7. Configure a MembershipProvider for NerdDinner username/password storage.
  8. Run the web app:
    $ cd "$HOME/tmp/NerdDinner 1.0/NerdDinner"
    $ MONO_IOMAP=all xsp2
    The MONO_IOMAP environment variable is needed because some link targets used within NerdDinner require case insensitivity.

Some things worth noting since May. First, openSUSE has released openSUSE 11.2, which is apparently more stringent than 11.1. Consequently, you may need to open the firewall so that port 8080 is accessible. You can do this by:

  1. Opening YaST.
  2. Starting the Firewall applet.
  3. In the Allowed Services area, add the HTTP Server and Mono XSP2 ASP.NET Host Service services.
  4. Click Next, then Finish.

One other oddity I encountered is that a url of http://localhost:8080 isn't permitted; using telnet(1) shows that it attempts to connect to ::1... (i.e. a IPv6 address), and the connection is refused. Instead, I needed to connect to http://127.0.0.1:8080.

NerdDinnner on Linux!

Posted on 15 Dec 2009 | Path: /development/mono/ | Permalink
blog comments powered by Disqus