I'm trying to make an AppHarbor OWIN app. I took my functioning POC standalone OWIN app and migrated it to use IIS Pipeline (trying both OwinStartup and appSettings)
As near as I can tell, the Startup is not initializing. But, I'm not even that sure. The build succeeds, and it copies the relevant (one) DLL. I was getting 404's and on the / page the stock standard "nginx" page. I modified the appSettings to point to Startup instead of (in addition to, actually) using the OwinStartup attribute, and now the / page is a 403. It's a clue, but I'm still lost
The Startup looks like this:
using Owin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using System.IO;
using Microsoft.Owin;
using Microsoft.Owin.Extensions;
[assembly: OwinStartup(typeof(PGO_6.Startup))]
namespace PGO_6
{
public class Startup
{
public void Configuration(IAppBuilder appBuilder)
{
appBuilder.Use((context, next) =>
{
TextWriter output = context.Get<TextWriter>("host.TraceOutput");
return next().ContinueWith(result =>
{
output.WriteLine("Scheme {0} : Method {1} : Path {2} : MS {3}",
context.Request.Scheme, context.Request.Method, context.Request.Path, getTime());
});
});
appBuilder.Run(async context =>
{
await context.Response.WriteAsync(getTime() + " My First OWIN App");
});
// Configure Web API
var config = new HttpConfiguration();
config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}",
new { id = RouteParameter.Optional });
appBuilder.UseWebApi(config);
}
static string getTime()
{
return DateTime.Now.Millisecond.ToString();
}
}
}
So, almost totally boiler plate code. The {controller} part is direct from my other functioning POC. The other is a direct copy from an MSDN example.
Any advice how I can move this towards functioning? Thank you!
p.s. developing this under the Xamarin environment, targeting .NET 4.5
OK, the AppHarbor support is great. He helped me discover:
Those were the main issues. Works great now