Forum


HomeHomePremiumPremiumDevelopmentDevelopmentUnable to Access Controller in Child PortalUnable to Access Controller in Child Portal
Previous
 
Next
New Post
10/2/2017 10:29 AM
 

Came across a brand new issue today that after an hour of googling I couldn't find a solution.

Here's the issue. I have installed a custom module (I manage around 30 of these so it's not like this is my first one) the same way I do every time on our test environment which happens to have a child portal attached to it.

When I try to hit the API with this URL: http://demo.website.com/DesktopModules/AdminUIEmployer/Api/Employer/Get?employerId=1

I get the message: Unable to locate a controller for http://demo.website.com/DesktopModules/AdminUIEmployer/Api/Employer/Get?employerId=1. Searched in namespaces: AdminUIEmployer.Api.Controllers.

However when I try almost the exact same URL to the parent: http://test.website.com/DesktopModules/AdminUIEmployer/Api/Employer/Get?employerId=1

I get what I expected to get when linking routes in the browser: Authorization has been denied for this request.

What could possibly be wrong. Both sites (child and parent) share the same file system and every single other module works as expected in both environment. Just not this one.

I've checked and made sure the DLL's are installing correctly and they are. I can't understand why this functions correctly in two environments (my local and the parent portal) but not my child portal...

Relevant code:

public class RouteMapper : IServiceRouteMapper
    {
        public void RegisterRoutes(IMapRoute mapRouteManager)
        {
            mapRouteManager.MapHttpRoute(
                "AdminUIEmployer", 
                "default",
                "{controller}/{action}",
                new[] { "AdminUIEmployer.Api.Controllers" }
            );
        }
    }

namespace AdminUIEmployer.Api.Controllers
{
    public class EmployerController : BaseDnnApiController
    {
        [ValidateAntiForgeryToken]
        [HttpGet]
        public HttpResponseMessage Get(int employerId)
        { }
}

 
Previous
 
Next
HomeHomePremiumPremiumDevelopmentDevelopmentUnable to Access Controller in Child PortalUnable to Access Controller in Child Portal



Try FREE
30 days money back guaranteed