title: An exception was thrown while activating Castle.Proxies.AlertAppServiceProxy
body: <p>I am trying to leverage the Book and Author abp tutorial to build a sample application.</p>
  <p>In my sample app, I have sites (rather than books) and alerts (rather than authors).</p>
  <p>Everything seems to be right. However, as soon as I load the /alerts page, I get the following error.</p>
  <p>Looking for some direction in how to resolve....</p>
  <p>The closest I have come is this link: <a href="https://stackoverflow.com/questions/58321628/abp-io-exception-an-exception-was-thrown-while-activating-castle-proxies-proces/58321986#58321986">Abp.io Exception: An exception was thrown while activating Castle.Proxies.ProcessesServiceProxy</a></p>
  <p>However, I am not sure what exactly that user did to resolve their issue.</p>
  <pre><code>[14:56:47 INF] Authorization was successful.
  [14:56:47 INF] Executing endpoint 'MyApp.Alerts.AlertAppService.GetListAsync (MyApp.Application)'
  [14:56:47 INF] Route matched with {action = &quot;GetList&quot;, controller = &quot;Alert&quot;, area = &quot;&quot;, page = &quot;&quot;}. Executing controller action with signature System.Threading.Tasks.Task`1[Volo.Abp.Application.Dtos.PagedResultDto`1[MyApp.Alerts.AlertDto]] GetListAsync(Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto) on controller MyApp.Alerts.AlertAppService (MyApp.Application).
  [14:56:47 ERR] ---------- RemoteServiceErrorInfo ----------
  {
    &quot;code&quot;: null,
    &quot;message&quot;: &quot;An internal error occurred during your request!&quot;,
    &quot;details&quot;: null,
    &quot;data&quot;: {
      &quot;ActivatorChain&quot;: &quot;Castle.Proxies.AlertAppServiceProxy&quot;
    },
    &quot;validationErrors&quot;: null
  }
  
  [14:56:47 ERR] An exception was thrown while activating Castle.Proxies.AlertAppServiceProxy.
  Autofac.Core.DependencyResolutionException: An exception was thrown while activating Castle.Proxies.AlertAppServiceProxy.
   ---&gt; Autofac.Core.DependencyResolutionException: None of the constructors found with 'Volo.Abp.Autofac.AbpAutofacConstructorFinder' on type 'Castle.Proxies.AlertAppServiceProxy' can be invoked with the available services and parameters:
  Cannot resolve parameter 'MyApp.Sites.ISiteRepository siteRepository' of constructor 'Void .ctor(Castle.DynamicProxy.IInterceptor[], Volo.Abp.Domain.Repositories.IRepository`2[MyApp.Alerts.Alert,System.Guid], MyApp.Sites.ISiteRepository)'.
     at Autofac.Core.Activators.Reflection.ReflectionActivator.GetAllBindings(ConstructorBinder[] availableConstructors, IComponentContext context, IEnumerable`1 parameters)
     at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
     at Autofac.Core.Activators.Reflection.ReflectionActivator.&lt;ConfigurePipeline&gt;b__11_0(ResolveRequestContext ctxt, Action`1 next)
     at Autofac.Core.Resolving.Middleware.DisposalTrackingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
     at Autofac.Builder.RegistrationBuilder`3.&lt;&gt;c__DisplayClass41_0.&lt;PropertiesAutowired&gt;b__0(ResolveRequestContext ctxt, Action`1 next)
     at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
     --- End of inner exception stack trace ---
     at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
     at Autofac.Builder.RegistrationBuilder`3.&lt;&gt;c__DisplayClass35_0.&lt;OnPreparing&gt;b__0(ResolveRequestContext ctxt, Action`1 next)
     at Autofac.Core.Resolving.Middleware.CoreEventMiddleware.Execute(ResolveRequestContext context, Action`1 next)
     at Autofac.Core.Resolving.Middleware.SharingMiddleware.Execute(ResolveRequestContext context, Action`1 next)
     at Autofac.Core.Resolving.Middleware.CircularDependencyDetectorMiddleware.Execute(ResolveRequestContext context, Action`1 next)
     at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, ResolveRequest request)
     at Autofac.Core.Resolving.ResolveOperation.ExecuteOperation(ResolveRequest request)
     at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object&amp; instance)
     at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
     at Microsoft.AspNetCore.Mvc.Controllers.ServiceBasedControllerActivator.Create(ControllerContext actionContext)
     at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.&lt;&gt;c__DisplayClass5_0.&lt;CreateControllerFactory&gt;g__CreateController|0(ControllerContext controllerContext)
     at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State&amp; next, Scope&amp; scope, Object&amp; state, Boolean&amp; isCompleted)
     at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
  --- End of stack trace from previous location ---
     at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.&lt;InvokeNextExceptionFilterAsync&gt;g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)[14:56:47 ERR] ---------- Exception Data ----------
  ActivatorChain = Castle.Proxies.AlertAppServiceProxy
  
  [14:56:47 INF] Executing ObjectResult, writing value of type 'Volo.Abp.Http.RemoteServiceErrorResponse'.
  [14:56:47 INF] Executed action MyApp.Alerts.AlertAppService.GetListAsync (MyApp.Application) in 4.1234ms
  [14:56:47 INF] Executed endpoint 'MyApp.Alerts.AlertAppService.GetListAsync (MyApp.Application)'
  </code></pre>
  <p>EDIT: Here is the &quot;ISiteRepository.cs&quot; within MyApp.Domain/Sites/</p>
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Threading.Tasks;
  using Volo.Abp.Domain.Repositories;
  
  namespace MyApp.Sites
  {
      public interface ISiteRepository : IRepository&lt;Site, Guid&gt;
      {
          Task&lt;Site&gt; FindByNameAsync(string company);
  
          Task&lt;List&lt;Site&gt;&gt; GetListAsync(
              int skipCount,
              int maxResultCount,
              string sorting,
              string filter = null
          );
      }
  }
  </code></pre>
  <p>EDIT 2: ISiteRepository Registration (I think) - in &quot;MyApp.Application/Alerts/AlertAppService.cs&quot;</p>
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Threading.Tasks;
  using MyApp.Sites;
  using MyApp.Permissions;
  using Microsoft.AspNetCore.Authorization;
  using Volo.Abp.Application.Dtos;
  using Volo.Abp.Application.Services;
  using Volo.Abp.Domain.Entities;
  using Volo.Abp.Domain.Repositories;
  
  namespace MyApp.Alerts
  {
      [Authorize(MyAppPermissions.Alerts.Default)]
      public class AlertAppService :
          CrudAppService&lt;
              Alert, //The  Alert entity
              AlertDto, //Used to show  alerts
              Guid, //Primary key of the  alert entity
              PagedAndSortedResultRequestDto, //Used for paging/sorting
              CreateUpdateAlertDto&gt;, //Used to create/update a  alert
          IAlertAppService //implement the IAlertAppService
      {
          private readonly ISiteRepository _siteRepository;
  
          public AlertAppService(
              IRepository&lt;Alert, Guid&gt; repository,
              ISiteRepository siteRepository)
              : base(repository)
          {
              _siteRepository = siteRepository;
              GetPolicyName = MyAppPermissions.Alerts.Default;
              GetListPolicyName = MyAppPermissions.Alerts.Default;
              CreatePolicyName = MyAppPermissions.Alerts.Create;
              UpdatePolicyName = MyAppPermissions.Alerts.Edit;
              DeletePolicyName = MyAppPermissions.Alerts.Delete;
          }
  
  
          public override async Task&lt;AlertDto&gt; GetAsync(Guid id)
          {
              //Get the IQueryable&lt;Alert&gt; from the repository
              var queryable = await Repository.GetQueryableAsync();
  
              //Prepare a query to join sites and alerts
              var query = from Alert in queryable
                          join site in _siteRepository on Alert.SiteId equals site.Id
                          where Alert.Id == id
                          select new { Alert, site };
  
              //Execute the query and get the Alert with site
              var queryResult = await AsyncExecuter.FirstOrDefaultAsync(query);
              if (queryResult == null)
              {
                  throw new EntityNotFoundException(typeof(Alert), id);
              }
  
              var AlertDto = ObjectMapper.Map&lt;Alert, AlertDto&gt;(queryResult.Alert);
              AlertDto.SiteName = queryResult.site.Name;
              return AlertDto;
          }
  
          public override async Task&lt;PagedResultDto&lt;AlertDto&gt;&gt; GetListAsync(PagedAndSortedResultRequestDto input)
          {
              //Set a default sorting, if not provided
              if (input.Sorting.IsNullOrWhiteSpace())
              {
                  input.Sorting = nameof(Alert.SiteName);
              }
  
              //Get the IQueryable&lt;Book&gt; from the repository
              var queryable = await Repository.GetQueryableAsync();
  
              //Prepare a query to join Alerts and sites
              var query = from Alert in queryable
                          join site in _siteRepository on Alert.SiteId equals site.Id
                          orderby input.Sorting //TODO: Can not sort like that!
                          select new { Alert, site };
  
              //Paging
              query = query
                  .Skip(input.SkipCount)
                  .Take(input.MaxResultCount);
  
              //Execute the query and get a list
              var queryResult = await AsyncExecuter.ToListAsync(query);
  
              //Convert the query result to a list of AlertDto objects
              var AlertDtos = queryResult.Select(x =&gt;
              {
                  var AlertDto = ObjectMapper.Map&lt;Alert, AlertDto&gt;(x.Alert);
                  AlertDto.SiteName = x.site.Name;
                  return AlertDto;
              }).ToList();
  
              //Get the total count with another query
              var totalCount = await Repository.GetCountAsync();
  
              return new PagedResultDto&lt;AlertDto&gt;(
                  totalCount,
                  AlertDtos
              );
          }
  
          public async Task&lt;ListResultDto&lt;SiteLookupDto&gt;&gt; GetSiteLookupAsync()
          {
              var sites = await _siteRepository.GetListAsync();
  
              return new ListResultDto&lt;SiteLookupDto&gt;(
                  ObjectMapper.Map&lt;List&lt;Site&gt;, List&lt;SiteLookupDto&gt;&gt;(sites)
              );
          }
      }
  }
  </code></pre>