Nancy Empty Self Hosting - System.AccessViolationException

69 Views Asked by At

I am using Visual Studio 2015 Community Edition in Administrator mode. I installed SideWaffle Template Pack v1.21.400. I created a new Nancy Empty Self Host Project. The below is the Source Code:

using System;
using Nancy.Hosting.Self;

namespace NancyEmptySelfHost
{
    class Program
    {
        static void Main(string[] args)
        {
            var uri =
                new Uri("http://localhost:3579");

            using (var host = new NancyHost(uri))
            {
                host.Start();

                Console.WriteLine("Your application is running on " + uri);
                Console.WriteLine("Press any [Enter] to close the host.");
                Console.ReadLine();
            }
        }
    }
}

On execution, I am getting System.AccessViolationException in the line host.Start(); with the below message:

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

I get the same exception, when I create Projects with other Nancy Templates. If I create a Console application (without using Nancy template) and refer Nancy dlls, it's working fine. How should this be fixed?

0

There are 0 best solutions below