Experiment: Deploying C# / Mono on Heroku

Over the past couple of days I’ve been trying to get Mono running on top of Heroku.

I’m pleased to report that I have successfully deployed Nancy (a C# web framework) on top of Heroku.

It’s far from a production ready solution and is completely unsupported by Heroku but it’s an interesting experiment. More technical details in future posts but here’s some proof.

Server response headers:
$ curl -i http://deep-moon-1452.herokuapp.com/
HTTP/1.1 200 OK
Content-Type: text/html
Date: Tue, 03 Jan 2012 16:33:02 GMT
Nancy-Version: 0.9.0.0
Server: Mono-HTTPAPI/1.0

Screenshot:

This is the output when you push your git repository to Heroku. The source code is built on Heroku.

$ git push heroku master
Counting objects: 9, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 514 bytes, done.
Total 5 (delta 3), reused 0 (delta 0)


—–> Heroku receiving push
—–> Fetching custom buildpack… done
—–> Mono app detected
—–> Fetching Mono binaries
tar: Ignoring unknown extended header keyword `SCHILY.dev’
tar: Ignoring unknown extended header keyword `SCHILY.ino’
tar: Ignoring unknown extended header keyword `SCHILY.nlink’
tar: Ignoring unknown extended header keyword `SCHILY.dev’
tar: Ignoring unknown extended header keyword `SCHILY.ino’
tar: Ignoring unknown extended header keyword `SCHILY.nlink’
tar: Ignoring unknown extended header keyword `SCHILY.dev’
tar: Ignoring unknown extended header keyword `SCHILY.ino’
tar: Ignoring unknown extended header keyword `SCHILY.nlink’
tar: Ignoring unknown extended header keyword `SCHILY.dev’
tar: Ignoring unknown extended header keyword `SCHILY.ino’
tar: Ignoring unknown extended header keyword `SCHILY.nlink’
tar: Ignoring unknown extended header keyword `SCHILY.dev’
tar: Ignoring unknown extended header keyword `SCHILY.ino’
tar: Ignoring unknown extended header keyword `SCHILY.nlink’
tar: Ignoring unknown extended header keyword `SCHILY.dev’
tar: Ignoring unknown extended header keyword `SCHILY.ino’
tar: Ignoring unknown extended header keyword `SCHILY.nlink’
tar: Ignoring unknown extended header keyword `SCHILY.dev’
tar: Ignoring unknown extended header keyword `SCHILY.ino’
tar: Ignoring unknown extended header keyword `SCHILY.nlink’
tar: Ignoring unknown extended header keyword `SCHILY.dev’
tar: Ignoring unknown extended header keyword `SCHILY.ino’
tar: Ignoring unknown extended header keyword `SCHILY.nlink’
tar: Ignoring unknown extended header keyword `SCHILY.dev’
tar: Ignoring unknown extended header keyword `SCHILY.ino’
tar: Ignoring unknown extended header keyword `SCHILY.nlink’
—–> Vendoring mono 2.10.8
—–> building via /tmp/mono-GssQ/bin/mono /tmp/mono-GssQ/lib/mono/4.0/xbuild.exe /tmp/build_19y6xv4nr43ic/Nancy.Demo.Hosting.Self.sln
XBuild Engine Version 2.10.8.0
Mono, Version 2.10.8.0
Copyright (C) Marek Sieradzki 2005-2008, Novell 2008-2011.


Build started 01/03/2012 16:28:24.
__________________________________________________
Project “/tmp/build_19y6xv4nr43ic/Nancy.Demo.Hosting.Self.sln” (default target(s)):
Target ValidateSolutionConfiguration:
Building solution configuration “Debug|Mixed Platforms”.
Target Build:
Project “/tmp/build_19y6xv4nr43ic/src/Nancy.Demo.Hosting.Self.csproj” (default target(s)):
Target PrepareForBuild:
Configuration: Debug Platform: x86
Created directory “bin/”
Created directory “obj/x86/Debug/”
Target CopyFilesMarkedCopyLocal:
Copying file from ‘/tmp/build_19y6xv4nr43ic/lib/Nancy.dll’ to ‘/tmp/build_19y6xv4nr43ic/src/bin/Nancy.dll’
Copying file from ‘/tmp/build_19y6xv4nr43ic/lib/Nancy.Hosting.Self.dll’ to ‘/tmp/build_19y6xv4nr43ic/src/bin/Nancy.Hosting.Self.dll’
Target GenerateSatelliteAssemblies:
No input files were specified for target GenerateSatelliteAssemblies, skipping.
Target CoreCompile:
Tool /tmp/mono-GssQ/bin/dmcs execution started with arguments: /noconfig /debug:full /debug+ /optimize- /out:obj/x86/Debug/Nancy.Demo.Hosting.Self.exe Program.cs TestModule.cs /target:exe /define:”DEBUG;TRACE” /main:Nancy.Demo.Hosting.Self.Program /platform:x86 /reference:/tmp/mono-GssQ/lib/mono/4.0/System.dll /reference:../lib/Nancy.dll /reference:../lib/Nancy.Hosting.Self.dll /reference:/tmp/mono-GssQ/lib/mono/4.0/System.Xml.Linq.dll /reference:/tmp/mono-GssQ/lib/mono/4.0/System.Data.DataSetExtensions.dll /reference:/tmp/mono-GssQ/lib/mono/4.0/Microsoft.CSharp.dll /reference:/tmp/mono-GssQ/lib/mono/4.0/System.Data.dll /reference:/tmp/mono-GssQ/lib/mono/4.0/System.Xml.dll /reference:/tmp/mono-GssQ/lib/mono/4.0/System.Core.dll /reference:/tmp/mono-GssQ/lib/mono/4.0/mscorlib.dll /warn:4
Target _CopyDeployFilesToOutputDirectoryAlways:
Creating directory ‘/tmp/build_19y6xv4nr43ic/src/bin/Views’
Copying file from ‘/tmp/build_19y6xv4nr43ic/src/Views/staticview.html’ to ‘/tmp/build_19y6xv4nr43ic/src/bin/Views/staticview.html’
Target _CopyAppConfigFile:
Copying file from ‘/tmp/build_19y6xv4nr43ic/src/app.config’ to ‘/tmp/build_19y6xv4nr43ic/src/bin/Nancy.Demo.Hosting.Self.exe.config’
Target DeployOutputFiles:
Copying file from ‘/tmp/build_19y6xv4nr43ic/src/obj/x86/Debug/Nancy.Demo.Hosting.Self.exe.mdb’ to ‘/tmp/build_19y6xv4nr43ic/src/bin/Nancy.Demo.Hosting.Self.exe.mdb’
Copying file from ‘/tmp/build_19y6xv4nr43ic/src/obj/x86/Debug/Nancy.Demo.Hosting.Self.exe’ to ‘/tmp/build_19y6xv4nr43ic/src/bin/Nancy.Demo.Hosting.Self.exe’
Done building project “/tmp/build_19y6xv4nr43ic/src/Nancy.Demo.Hosting.Self.csproj”.
Done building project “/tmp/build_19y6xv4nr43ic/Nancy.Demo.Hosting.Self.sln”.


Build succeeded.
0 Warning(s)
0 Error(s)


Time Elapsed 00:00:01.0730530
—–> Discovering process types
Procfile declares types -> local, web
—–> Compiled slug size is 78.3MB
—–> Launching… done, v18
http://deep-moon-1452.herokuapp.com deployed to Heroku


To git@heroku.com:deep-moon-1452.git
4d9e07b..6ce44e4 master -> master

One thought on “Experiment: Deploying C# / Mono on Heroku”

Leave a Reply

Your email address will not be published. Required fields are marked *