title: Owin provide startup class in web.config (no automatic startup discovery)
body: <p>I try to do the following in my web.config:</p>
  
  <pre><code>&lt;appSettings&gt;
     &lt;add key="owin:AutomaticAppStartup" value="false" /&gt;
     &lt;add key="owin:appStartup" value="MyNamespace.MyStartupClass" /&gt;
  &lt;/appSettings&gt;
  </code></pre>
  
  <p>If I understand this <a href="http://www.asp.net/aspnet/overview/owin-and-katana/owin-startup-class-detection" rel="noreferrer">documentation</a> correctly automatic startup detection should be disabled. So I do not require a startup attribute.</p>
  
  <p>Unfortunately it looks like OWIN does not start. (I see this because I get the error: <code>HTTP Error 403.14 - Forbidden</code>. I use a controller to handle requests to the index file.)</p>
  
  <p>if I use <code>&lt;add key="owin:AutomaticAppStartup" value="true" /&gt;</code> and add the startup attribute <code>[assembly: OwinStartup(typeof(MyStartupClass))]</code> then the application does startup as expected.</p>
  
  <p>So the question is why? What can I do to resolve the issue?</p>
  
  <p>I am using OWIN 3.0.0.0</p>
  
  <p><strong>Update:</strong></p>
  
  <p>This is how my startup class looks like (minified version with relevant parts):</p>
  
  <pre><code>using System.Web.Http;
  using Microsoft.AspNet.SignalR;
  using Microsoft.Owin;
  using Owin;
  using MyOtherNamespace;
  
  namespace MyNamespace
  {
      public class MyOnlineStartup : MyOtherStartup
      {
          public new void Configuration(IAppBuilder app)
          {
              base.Configuration(app); //Call base method! This is important because otherwise ther serilization will not be correct
              HttpConfiguration config = CreateRouting();
              config.Routes.MapHttpRoute("exampleAppNone", "", new { controller = "MyIndex" }, null, null);
              config.Routes.MapHttpRoute("exampleAppIndex", "index.html", new { controller = "MyIndex" }, null, null);
              app.UseWebApi(config); // Use the WebAPI technology.
          }
      }
  }
  </code></pre>
  
  <p>it derives from</p>
  
  <pre><code>using System.Linq;
  using System.Web.Http;
  using Microsoft.AspNet.SignalR;
  using Newtonsoft.Json;
  using Owin;
  
  namespace MyOtherNamespace
  {
      public class MyOtherStartup
      {
          protected static HttpConfiguration CreateMyRouting()
          {
              HttpConfiguration config = new HttpConfiguration();
              config.Routes.MapHttpRoute(
                  "myIndex",
                  "my/",
                  new
                  {
                      controller = "MyIndex"
                  },
                  null,
                  null
                  );
              config.Routes.MapHttpRoute(
                  "myIndex2",
                  "my/index.html",
                  new
                  {
                      controller = "MyIndex"
                  },
                  null,
                  null
                  );
              var appXmlType = config.Formatters.XmlFormatter.SupportedMediaTypes.FirstOrDefault(t =&gt; t.MediaType == "application/xml");
              config.Formatters.XmlFormatter.SupportedMediaTypes.Remove(appXmlType);
              config.Formatters.JsonFormatter.SerializerSettings.TypeNameHandling = TypeNameHandling.Auto
              return config;
          }
  
          public void Configuration(IAppBuilder app)
          {
              JsonSerializer serializer = Serialization.ClientJsonSerializer();
              serializer.ContractResolver = new MySerializationContractResolver(false);
              GlobalHost.DependencyResolver.Register(typeof(JsonSerializer), () =&gt; serializer);
              app.MapSignalR("/" + MyRequestHandler.MySignalRPath, new HubConfiguration());          
          }
      }
  }
  </code></pre>