title: Is it possible to use two different Owin startup file at run time?
body: <p>I am using an Asp.net MVC 5 app with <a href="https://docs.microsoft.com/en-us/dotnet/framework/mef/" rel="nofollow noreferrer">MEF framework</a> to allow me to design MVC app as a plugin to in the main app.</p>
  
  <p>I have a need where one of my plugin needs to have its own <code>OwinStart</code> up class that runs after the the master Owin class which belongs to my main app.</p>
  
  <p>In other words <code>main.dll</code> has <code>Startup</code> class which always needs to run first, then <code>plugin.dll</code> has a <code>Startup</code> class that needs to run second.</p>
  
  <p>Is it possible to have 2 Own Startup classes?</p>
  
  <p>From the <a href="https://docs.microsoft.com/en-us/aspnet/aspnet/overview/owin-and-katana/owin-startup-class-detection" rel="nofollow noreferrer">Docs about detecting</a> the StartUp class</p>
  
  <blockquote>
    <p>The <code>OwinStartup</code> attribute overrides the naming convention. You can
    also specify a friendly name with this attribute, however, using a
    friendly name requires you to also use the <code>appSetting</code> element in the
    configuration file.</p>
  </blockquote>
  
  <p>So I tried adding a friendly name like so </p>
  
  <pre><code>[assembly: OwinStartup("pluginStartup", typeof(plugin.Startup))]
  </code></pre>
  
  <p>The added the following in the config file</p>
  
  <pre><code>&lt;appSettings&gt;  
    &lt;add key="owin:appStartup" value="Main.Startup, Main" /&gt;
  &lt;/appSettings&gt;
  </code></pre>
  
  <p>But that does not file my <code>Plugin.Startup</code> it only runs <code>Main.Startup</code>.</p>
  
  <p>Is there a way to run two different <code>Startup</code> classes?</p>
  
  <p><a href="https://docs.microsoft.com/en-us/aspnet/aspnet/overview/owin-and-katana/owin-startup-class-detection" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/aspnet/aspnet/overview/owin-and-katana/owin-startup-class-detection</a></p>