Advertisement
Guest User

OWIN simple startup class

a guest
May 20th, 2019
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.77 KB | None | 0 0
  1. The OWIN startup class below generates the following error on ubuntu 18.04 xsp4 on .net 4.6 :  
  2.  
  3. Application Exception
  4. System.Web.HttpException
  5. The resource cannot be found.
  6.  
  7. Description: HTTP 404.The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
  8.  
  9. Details: Requested URL: /
  10. Exception stack trace:
  11.   at System.Web.StaticFileHandler.ProcessRequest (System.Web.HttpContext context) [0x00094] in /build/mono-5.18.1.3/mcs/class/System.Web/System.Web/StaticFileHandler.cs:77
  12.   at System.Web.DefaultHttpHandler.BeginProcessRequest (System.Web.HttpContext context, System.AsyncCallback callback, System.Object state) [0x0007f] in /build/mono-5.18.1.3/mcs/class/System.Web/System.Web/DefaultHttpHandler.cs:101
  13.   at System.Web.HttpApplication+<Pipeline>d__225.MoveNext () [0x008d4] in /build/mono-5.18.1.3/mcs/class/System.Web/System.Web/HttpApplication.cs:1335
  14.   at System.Web.HttpApplication.Tick () [0x00000] in /build/mono-5.18.1.3/mcs/class/System.Web/System.Web/HttpApplication.cs:927
  15. Version Information: 5.18.1.3 (tarball Tue Apr 9 16:16:30 UTC 2019); ASP.NET Version: 4.0.30319.42000
  16.  
  17.  
  18.  
  19. using System;
  20. using Microsoft.Owin;
  21. using Microsoft.Owin.Diagnostics;
  22. using Owin;
  23.  
  24. [assembly: OwinStartup(typeof(KatanIIS.Startup))]
  25.  
  26. namespace KatanIIS
  27. {
  28.     public class Startup
  29.     {
  30.  
  31.         public void Configuration(IAppBuilder app)
  32.         {
  33.  
  34.  
  35.             app.Run(context =>
  36.             {
  37.                context.Response.ContentType = "text/plain";
  38.                 //context.Response.Write("test");
  39.                 return context.Response.WriteAsync("Hello");
  40.             });
  41.        
  42.         }
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement