1

I have a simple console app to learn OWIN/Katana and I am stuck.

class Program
{
    static void Main(string[] args)
    {
        string url = ConfigurationManager.AppSettings["url"];
        using (var app = WebApp.Start<Startup>(url))
        {
            Console.WriteLine("Started listening on {0}", url);
            Console.ReadKey();
            Console.WriteLine("Stopping");
        }
    }
}

This starts up just fine and hits my using block. Console fired up ready to listen to requests

I then see that my Startup is called: Use() Methods are being hit during debugging

Next I startup Postman in Chrome and submit a GET Request. At this point my break points never get hit in either module. Postman GET setup

No matter what changes I make it does not log my messages out to the console. Is there a way to find what is failing if anything? In Postman I do receive a HTTP 200 with a payload. The OwinMiddleware class is from the Microsoft.Owin namespace.

Owin Middleware Module Components

EDIT: Tech stack of the Project:

Website (Not Web Application) running AngularJs 1.4 using $resource. WebApi 2.2 with OData V4

Running on .Net 4.5

jjhayter
  • 352
  • 4
  • 19
  • Your `WebApiMiddleware` is before the `LoggingMiddleware` in the pipeline so the request may have been terminated there and may never reach the logging. Add the logging on top, before `StartupPrerequsites(app);` and try again. – Angel Yordanov Sep 29 '15 at 13:23
  • @AngelYordanov That was exactly it. Please submit that as the answer so I can accept it. Many thanks! – jjhayter Sep 29 '15 at 16:45

1 Answers1

1

Your WebApiMiddleware is before the LoggingMiddleware in the pipeline so the request may have been terminated there and may never reach the logging. Add the logging on top, before StartupPrerequsites(app); and try again.

Angel Yordanov
  • 3,112
  • 1
  • 22
  • 19