Journal: Starting out with Nancy on Mono Pt.1

posted on 12 Dec 2012 | words

Before starting out, I installed NuGet, per these combined instructions:

Special note on the last item there. I had to put Microsoft.Build.dll into the same directory as NuGet.exe before it would run. (Was failing for 'Could not load type 'NuGet.Commands.ProjectFactory')

Now that I was ready to move on to some code, I created a new C# ASP.NET project in MonoDevelop. I'm using MonoDevelop 3.0.5 that I built from source, but all other versions should have this option.

I downloaded the latest Nancy build from their CI server here:

Added references to Nancy.dll and Nancy.Hosting.Aspnet.dll in MonoDevelop.

On the Nancy wiki's into page, there is a Hello World snippet. Before running it, a web.config file must be created.

I found the default configuration here:

    <compilation debug="true" targetFramework="4.0" />
      <add verb="*" type="Nancy.Hosting.Aspnet.NancyHttpRequestHandler" path="*"/>

    <modules runAllManagedModulesForAllRequests="true"/>
    <validation validateIntegratedModeConfiguration="false"/>
      <add name="Nancy" verb="*" type="Nancy.Hosting.Aspnet.NancyHttpRequestHandler" path="*"/>

Pressed Start program without debugging and watched magic happen!

comments powered by Disqus