在隔离使用webapp.start OWIN不能运行多个应用程序 [英] OWIN cannot run multiple apps in isolation using webapp.start

查看:1481
本文介绍了在隔离使用webapp.start OWIN不能运行多个应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我试着开始在不同的URL的两个应用程序,我得到属性的路由中间件的问题。如果我有单独的应用程序,但不同的HTTP方法两个类似的路线web.api似乎发现只有其中的一种方法。

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?

推荐答案

根据您最后的评论,下面一个例子来筛选出集:

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;
    }
}

这篇关于在隔离使用webapp.start OWIN不能运行多个应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆