Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OWIN cannot run multiple apps in isolation using webapp.start

When I try and start two apps on different url's, I get problems with attribute routing middleware. If I have two similar routes in seperate apps but with different http methods web.api seems find only one of the methods.

Microsoft.Owin.Hosting.WebApp.Start<Admin.Startup>("http://localhost:1000");
Microsoft.Owin.Hosting.WebApp.Start<Startup>("http://localhost:1001");

How can I isolate both apps so that attribute routing don't conflict?

like image 537
AndyD Avatar asked Oct 02 '22 00:10

AndyD


1 Answers

Based on your last comment, an example below to filter out the assemblies:

config.Services.Replace(typeof(IAssembliesResolver), new CustomAssembliesResolver());

public class CustomAssembliesResolver : DefaultAssembliesResolver
{
    public override ICollection<Assembly> GetAssemblies()
    {
        ICollection<Assembly> defaultProbedAssemblies = base.GetAssemblies();

        //TODO: filter out the assemblies that you do not want to be probed

        return defaultProbedAssemblies;
    }
}
like image 154
Kiran Avatar answered Oct 13 '22 10:10

Kiran