Question

I am working on adding Nancy Framework to my C# console application (followed the very short tutorial here and it loads a blank page when I go to http://localhost:1234 so I know it is starting, but it doesn't show my text properly. I have gone over my code various times, but don't see any issues.

I have added both Nancy and Nancy.Hosting.Self to my project.

        static void Main(string[] args)
        {
            var nancyHost = new Nancy.Hosting.Self.NancyHost(new Uri("http://localhost:1234"));
            nancyHost.Start();
            Console.ReadLine();
            nancyHost.Stop();
        }

namespace DaemonApp
{
    class MainModule : Nancy.NancyModule
    {
        public MainModule()
        {
            Get["/"] = parameters =>
            {
                return "Hello world!";
            };
        }
    }
}

I added some print lines, and it never calls the module when I visit the page. Does anyone have any clue what the issue is?

Was it helpful?

Solution

I didn't make the Module class public, that fixed it instantly =/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top