Skip to content

Commit

Permalink
Temporary remove AspectCore DynamicProxyServiceProviderFactory due to…
Browse files Browse the repository at this point in the history
… incompatibility with Scrutor dotnetcore/AspectCore-Framework#286
  • Loading branch information
panosru committed Aug 6, 2022
1 parent 981cce2 commit a2595ce
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Hosts/RestApi/Application/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ private static IHostBuilder CreateHostBuilder(string[] args) =>

webBuilder.ConfigureServices(SetupServices);
webBuilder.UseStartup<Startup>();
})
.UseServiceProviderFactory(new DynamicProxyServiceProviderFactory());
});
// Replace the default IOC container with the AspectCore one.
// .UseServiceProviderFactory(new DynamicProxyServiceProviderFactory());

/// <summary>
/// </summary>
Expand Down
11 changes: 11 additions & 0 deletions Hosts/RestApi/Application/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
namespace CleanDDDArchitecture.Hosts.RestApi.Application;

using System.Reflection;
using AspectCore.Configuration;
using AspectCore.Extensions.DependencyInjection;
using AutoMapper;
using Aviant.Application.ApplicationEvents;
using Aviant.Application.Behaviours;
Expand All @@ -9,6 +11,7 @@ namespace CleanDDDArchitecture.Hosts.RestApi.Application;
using Aviant.Application.Jobs;
using Aviant.Application.Processors;
using Aviant.Application.Services;
using Aviant.Core.Aspects;
using Aviant.Core.Messages;
using Aviant.Core.Services;
using Aviant.Infrastructure.CrossCutting;
Expand All @@ -34,6 +37,9 @@ namespace CleanDDDArchitecture.Hosts.RestApi.Application;
using Swagger;
using Hangfire;
using Hangfire.PostgreSql;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption;
using Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel;
using Serilog;
using Serilog.Events;

Expand Down Expand Up @@ -67,6 +73,7 @@ public Startup(
private readonly string _dataProtectionKeysDirectory = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
"DataProtection-Keys");

/// <summary>
/// This method gets called by the runtime. Use this method to add services to the container.
/// </summary>
Expand Down Expand Up @@ -217,6 +224,10 @@ public void ConfigureServices(IServiceCollection services)

services.AddSingleton<ICurrentUserService, CurrentUser>();

services.ConfigureDynamicProxy(
config =>
{ });

services.AddHttpContextAccessor();

services
Expand Down

0 comments on commit a2595ce

Please sign in to comment.