From 3f203119af78f0e9ee6a15fb119e75e05a2e5976 Mon Sep 17 00:00:00 2001 From: lanut <997622499@qq.com> Date: Tue, 4 Feb 2025 23:54:10 +0800 Subject: [PATCH] feat: update DLL path resolution in Autofac module registration --- .../ServiceExtensions/AutofacModuleRegister.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BCVP.Net8.Extensions/ServiceExtensions/AutofacModuleRegister.cs b/BCVP.Net8.Extensions/ServiceExtensions/AutofacModuleRegister.cs index 7d18998..d9328ca 100644 --- a/BCVP.Net8.Extensions/ServiceExtensions/AutofacModuleRegister.cs +++ b/BCVP.Net8.Extensions/ServiceExtensions/AutofacModuleRegister.cs @@ -20,9 +20,9 @@ public class AutofacModuleRegister : Autofac.Module protected override void Load(ContainerBuilder builder) { var basePath = AppContext.BaseDirectory; - - var servicesDllFile = Path.Combine(basePath, "BCVP.Net8.Service.dll"); - var repositoryDllFile = Path.Combine(basePath, "BCVP.Net8.Repository.dll"); + var dllProjectName = Assembly.GetEntryAssembly()?.GetName().Name; + var servicesDllFile = Path.Combine(basePath, dllProjectName + ".Service.dll"); + var repositoryDllFile = Path.Combine(basePath, dllProjectName + ".Repository.dll"); var aopTypes = new List() { typeof(ServiceAOP), typeof(TranAOP) }; builder.RegisterType();