Closed lbsx closed 3 months ago
Invalid routers configuration: the same router is used in more than one Application object. 搞了两个"/",路由重复了,写的清清楚楚
@mingwiki 那个代码是https://www.neoteroi.dev/blacksheep/mounting/ 里的官方示例,把路由改成其他的,也一样报这个错,把路由全删了只留两个app也报这个错.
@lbsx The documentation has not been updated, but fix is to instantiate a specific router in one of your applications as described in this issue.
@sinisaos Thank you for helping me solve my doubts
I got the code from blacksheep When I run it, it throws an error, Traceback (most recent call last): File "/home/leib/code/py/web/xy/multiapp.py", line 12, in
child = Application()
File "/home/leib/.pyenv/versions/3.10.13/lib/python3.10/site-packages/blacksheep/server/application.py", line 213, in init
validate_router(self)
File "/home/leib/.pyenv/versions/3.10.13/lib/python3.10/site-packages/blacksheep/server/routing.py", line 963, in validate_router
raise SharedRouterError()
blacksheep.server.routing.SharedRouterError: Invalid routers configuration: the same router is used in more than one Application object. When working with multiple applications, ensure that each application is configured to use different routers. For more information, refer to: https://www.neoteroi.dev/blacksheep/routing/