Base solution for your next web application
Open Closed

Public Login #4310


User avatar
0
dalepalmer created

Hi,

we are developing a solution that requires a log-in on the public site (Help directory and a few other bits including pricing that we want to gather log-in details for before allowing access).

At this point we don't want to redirect to external or other site for registration or login. We are using latest build (5.0.2) Core & JQuery (.net framework 4.6.1.

I've tried to copy the Account controller, associated views and registered services/config into the public project, but am getting the following error when trying to access the public login page:

An unhandled exception occurred while processing the request.

HandlerException: Can't create component 'LandHuddle.CrowdSite.Web.Controllers.AccountController' as it has dependencies to be satisfied.

'LandHuddle.CrowdSite.Web.Controllers.AccountController' is waiting for the following dependencies:

  • Service 'LandHuddle.CrowdSite.Url.IAppUrlService' which was not registered. Castle.MicroKernel.Handlers.DefaultHandler.AssertNotWaitingForDependency()

I can't see where/how this service is registered in the mvc project and can't replicate into the public project.

Can anyone please help?

Thanks in advance

Dale


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @DalePalmer,

    If you are not going to use AppUrlService in public website, you can register <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/blob/master/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Application/Url/NullAppUrlService.cs">https://github.com/aspnetzero/aspnet-ze ... Service.cs</a>.

    Something like this in your public website module's postInitialize method

    IocManager.RegisterIfNot<IAppUrlService, NullChatCommunicator>();
    

    If you are going to use it in public website, create a class in public website project like this <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/blob/master/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Core/Url/AppUrlServiceBase.cs">https://github.com/aspnetzero/aspnet-ze ... iceBase.cs</a>.

    This service can be used for email activation and password reset if you are planning to include those features into the public website as well.