Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The controller for path '/Default.aspx' was not found or does not implement IController. #77

Open
lmakue opened this issue Aug 10, 2022 · 0 comments

Comments

@lmakue
Copy link

lmakue commented Aug 10, 2022

Hi
We have created many MVC modules using the DNN MVC Template and all deployed into the same Evoq instance
In the past we used to have issues with implementations stating clash with ItemController from multiple modules as DNN would not know which to use Solution is then to make use of the RouteConfig & setup the routing accordingly

However when we implement custom routing by adding the RouteConfig file example below

public class RouteConfig : IMvcRouteMapper
{
public void RegisterRoutes(IMapRoute mapRouteManager)
{
mapRouteManager.MapRoute(
"DNNPharmSelection",
"DNNPharmSelection",
"{controller}/{action}",
new[] {"Netcare.Dnn.Modules.DNNPharmSelection.Controllers"});
}
}

we then get the error below

DotNetNuke.Services.Exceptions.ModuleLoadException:
The controller for path '/Default.aspx' was not found or does not implement IController. --->
System.Web.HttpException: The controller for path '/Default.aspx' was not found or does not implement IController.

We have tried many different variations of naming and options but still get the same error when deploying.
All modules are located in the "DesktopModules/MVC" folder
the .dnn file has also been edited to point to the custom controller as below

"Netcare.Dnn.Modules.DNNPharmSelection.Controllers/Provider/Index.mvc"

Controller as below

namespace Netcare.Dnn.Modules.DNNPharmSelection.Controllers
{
[DnnHandleError]
public class ProviderController : DnnController
{

    public ProviderController() { }

    public ActionResult Index()
    {
        return View();
    }

}

}

no extra code added just the basic creation of a new controller to not clash with any default ItemControllers,
Also note that this error fires even without a custom controller when the custom RoutConfig is added

Steps we follow-
Create new VS2019 project using the DNN MVC Template
Create New Controller implementing DNNController
Update the .dnn file to point to new controller
Create & Add the RouteConfig File
Buid & Deploy to Evoq instance
Error then happens

Without the routeconfig it will state the below
DotNetNuke.Services.Exceptions.ModuleLoadException: Multiple types were found that match the controller named 'Item'. This can happen if the route that services this request does not specify namespaces to search for a controller that matches the request. If this is the case, register this route by calling an overload of the 'MapRoute' method that takes a 'namespaces' parameter.

Issue happens with custom or default item controller & we are stuck as to what could be the issue

i hope i have given enough information

Please let me know what can be checked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant