zoukankan      html  css  js  c++  java
  • Unable to start Ocelot because either a ReRoute or GlobalConfiguration

    在ASP.Net Core项目APIGateway中添加Ocelot+Consul然后运行时 ,VS2017报如下错 :

    内部异常 1: Exception: Unable to start Ocelot, errors are: Unable to start Ocelot, errors are: Unable to start Ocelot because either a ReRoute or GlobalConfiguration are using ServiceDiscoveryOptions but no ServiceDiscoveryFinderDelegate has been registered in dependency injection container. Are you missing a package like Ocelot.Provider.Consul and services.AddConsul() or Ocelot.Provider.Eureka and services.AddEureka()?,Unable to start Ocelot, errors are: Unable to start Ocelot because either a ReRoute or GlobalConfiguration are using ServiceDiscoveryOptions but no ServiceDiscoveryFinderDelegate has been registered in dependency injection container. Are you missing a package like Ocelot.Provider.Consul and services.AddConsul() or Ocelot.Provider.Eureka and services.AddEureka()?

    问题原因: 容器中缺少相应的服务

    解决办法:

    1. install-package Ocelot.Provider.Consul
    2. ConfigureServices服务注册中修改为 : services.AddOcelot(Configuration).AddConsul();

    正常运行!
    如果有帮助,记得点赞~~~~

  • 相关阅读:
    我喜欢网站
    我喜欢网站
    wpf Textbox 回车就换行
    wpf Textbox 回车就换行
    arguments.callee的用法
    与您分享
    Examples — guidata v1.5.1 documentation
    与您分享
    与您分享
    hierarchical clustering algorithms
  • 原文地址:https://www.cnblogs.com/zhan520g/p/10424203.html
Copyright © 2011-2022 走看看