I've been experimenting with ASP.NET Core application parts, but have ran into two problems:
The reason I am asking is due to some of my application parts having identically named controllers and views (i.e., Home/Index) which causes AmbiguousMatchExceptions. I have already relocated the controllers using a namespace routing scheme detailed here: .net core replacement for MvcCodeRouting. Namespace based routing.
Any help would be appreciated. Thanks.
An implementation of the IViewLocationExpander
interface did the job in this case.
By creating an implementation of the IViewLocationExpander
, you can specify alternative locations, in which, views may be located. The "default" locations are passed into the ExpandViewLocations
method (which returns an IEnumerable<string>
), only the locations returned are searched, meaning that you get the choice to either include the defaults or leave them out, forcing only your newly specified locations to be searched.