Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Asp.net MVC 5.x & jQuery #3586


User avatar
0
sdelot created

We success fully downloaded and it is running perfectly. We tried to develop a page like "Phone Book" and we done all step by step instructions. There is no building errors but, i am getting a server error listed below. how can i solve this?

Server Error in '/' Application. Can't create component 'LICIEL.LICIELWeb.Web.Areas.Mpa.Controllers.JobsController' as it has dependencies to be satisfied.

'LICIEL.LICIELWeb.Web.Areas.Mpa.Controllers.JobsController' is waiting for the following dependencies:

  • Service 'LICIEL.LICIELWeb.Jobs.IjobAppService' which was not registered. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Castle.MicroKernel.Handlers.HandlerException: Can't create component 'LICIEL.LICIELWeb.Web.Areas.Mpa.Controllers.JobsController' as it has dependencies to be satisfied.

'LICIEL.LICIELWeb.Web.Areas.Mpa.Controllers.JobsController' is waiting for the following dependencies:

  • Service 'LICIEL.LICIELWeb.Jobs.IjobAppService' which was not registered.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HandlerException: Can't create component 'LICIEL.LICIELWeb.Web.Areas.Mpa.Controllers.JobsController' as it has dependencies to be satisfied.

'LICIEL.LICIELWeb.Web.Areas.Mpa.Controllers.JobsController' is waiting for the following dependencies:

  • Service 'LICIEL.LICIELWeb.Jobs.IjobAppService' which was not registered. ] Castle.MicroKernel.Handlers.DefaultHandler.AssertNotWaitingForDependency() +18 Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext context, Boolean requiresDecommission, Boolean instanceRequired, Burden& burden) +186 Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context, Boolean instanceRequired) +23 Castle.MicroKernel.Handlers.AbstractHandler.Resolve(CreationContext context) +12 Castle.MicroKernel.DefaultKernel.ResolveComponent(IHandler handler, Type service, IDictionary additionalArguments, IReleasePolicy policy) +107 Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, IDictionary arguments, IReleasePolicy policy) +42 Castle.MicroKernel.DefaultKernel.Resolve(Type service, IDictionary arguments) +14 Castle.Windsor.WindsorContainer.Resolve(Type service) +13 Abp.Dependency.IocManager.Resolve(Type type) +38 Abp.Web.Mvc.Controllers.WindsorControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) +69 System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +88 System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +194 System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +50 System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +48 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +16 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +103 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

12 Answer(s)
  • User Avatar
    0
    alper created
    Support Team

    hi

    seems like you didn't derived IjobAppService from IApplicationService. Can you check that

    <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Application-Services">https://aspnetboilerplate.com/Pages/Doc ... n-Services</a>

  • User Avatar
    0
    sdelot created

    Yes, i created one IjobAppService Listed as below

    namespace LICIEL.LICIELWeb.Jobs { public interface IjobAppService : IApplicationService { ListResultDto<JobListDto> GetJob(GetJobInput input);

    }
    

    }

  • User Avatar
    0
    sdelot created

    do you have any idea? i am waiting for the solution...

  • User Avatar
    0
    sdelot created

    Interface .............. namespace LICIEL.LICIELWeb.Jobs { public interface IJobAppService : IApplicationService { ListResultDto<JobListDto> GetJob(GetJobInput input); } }

    Dto ..................... namespace LICIEL.LICIELWeb.Jobs.Dto { public class GetJobInput { public string Filter { get; set; } } } ................................................ namespace LICIEL.LICIELWeb.Jobs.Dto { [AutoMapFrom(typeof(JobsTable))]

    public class JobListDto : FullAuditedEntityDto
    {
    
        public virtual string Name { get; set; }
    
    
        public virtual string Dept { get; set; }
    
    
        public virtual string Desc { get; set; }
    
    }
    

    }

    Appservicees ...................................................

    namespace LICIEL.LICIELWeb.Jobs { public class JobAppService : LICIELWebAppServiceBase, IJobAppService { private readonly IRepository<JobsTable> _JobRepository;

        public JobAppService(IRepository&lt;JobsTable&gt; JobRepository)
        {
            _JobRepository = JobRepository;
        }
    
    
        public ListResultDto&lt;JobListDto&gt; GetJob(GetJobInput input)
        {
            var Jobs = _JobRepository
                .GetAll()
                .WhereIf(
                !input.Filter.IsNullOrEmpty(),
                p => p.Name.Contains(input.Filter) ||
                        p.Dept.Contains(input.Filter) ||
                        p.Desc.Contains(input.Filter)
                )
                .OrderBy(p => p.Name)
    
                .ToList();
    
            return new ListResultDto&lt;JobListDto&gt;(Jobs.MapTo&lt;List&lt;JobListDto&gt;>());
    
    
            //throw new NotImplementedException();
        }
    
    }
    

    }

    I can't do nothing in your project... i done the test... it was failed.

    do you guys have any idea about it?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @SDELOT,

    Your code seems fine. Have you added JobsTable entity to dbContext ? If so, please send your project to us <a href="mailto:[email protected]">[email protected]</a> and we will take a look at it.

    Thanks.

  • User Avatar
    0
    sdelot created

    Yes i did

    public class LICIELWebDbContext : AbpZeroDbContext<Tenant, Role, User> { /* Define an IDbSet for each entity of the application */

        public virtual IDbSet&lt;BinaryObject&gt; BinaryObjects { get; set; }
    
        public virtual IDbSet&lt;Friendship&gt; Friendships { get; set; }
    
        public virtual IDbSet&lt;ChatMessage&gt; ChatMessages { get; set; }
    
        public virtual IDbSet&lt;JobsTable&gt; JobsTables { get; set; }
    
        public LICIELWebDbContext()
            : base("Default")
        {
            
        }
    

    I tried to send the project, but it is larger than i can send!! how can i?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    After copying solution files to a temp folder, remove bin, obj folders and all content of packages folder. Then project size must be around 20 MB when you zip it.

    Then, you can share it via private google drive link.

    Thanks.

  • User Avatar
    0
    sdelot created

    Thanks, I send to your email !!

  • User Avatar
    0
    sdelot created

    Hi, I send the project to <a href="mailto:[email protected]">[email protected]</a>.

    thank you

  • User Avatar
    0
    sdelot created

    Hi, I solved it...thanks

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @SDELOT,

    Sorry for not being able to look at your problem. I'm glad that you have managed to solve it.

    Thanks.

  • User Avatar
    0
    liuhongan created

    This question is ultimately how to solve?