我正在使用nopCommerce平臺。主要項目是ASP.NET MVC 5.您可以將其他插件項目添加爲類庫。如何在同一個項目中運行多個Web API 2實例?
我實現了一個REST服務使用Web API 2插件,現在我們購買的相同,使用Web API 2插件,我們可以得到以下錯誤:
Server Error in '/' Application.
A route named 'MS_attributerouteWebApi' is already in the route collection. Route names must be unique. Parameter name: name
我發現這個問題是因爲這兩個插件叫GlobalConfiguration.Configuration.MapHttpAttributeRoutes();
。
你知道我能解決這個問題嗎?
如何在單個項目中運行Web API的兩個實例?
你真的可以看到這兩個插件調用,或者你只是猜測? –
是的。我有兩個插件的源代碼。一個是我開發的,另一個是買的,但我有源代碼。在這個問題中,我只寫了與問題相關的代碼。 –