From 46e98339480d853fc78a014c34d7ff9fcaf13890 Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期四, 05 十二月 2024 14:09:02 +0800 Subject: [PATCH] 产线协议 --- 项目代码/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/AutofacModuleRegister.cs | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/AutofacModuleRegister.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/AutofacModuleRegister.cs" index 8da6ce0..efdb638 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/AutofacModuleRegister.cs" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_Core/Extensions/AutofacModuleRegister.cs" @@ -1,7 +1,7 @@ 锘縰sing Autofac; using Autofac.Extras.DynamicProxy; -using log4net; using Microsoft.Extensions.DependencyModel; +using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; using System; using System.Collections.Generic; using System.Linq; @@ -21,6 +21,7 @@ //private static readonly ILog log = LogManager.GetLogger(typeof(AutofacModuleRegister)); protected override void Load(ContainerBuilder builder) { + var basePath = AppContext.BaseDirectory; var cacheType = new List<Type>(); builder.RegisterType<LogAOP>(); @@ -41,7 +42,14 @@ { try { - assemblyList.Add(AssemblyLoadContext.Default.LoadFromAssemblyName(new AssemblyName(library.Name))); + string path = Path.Combine(basePath, $"{library.Name}.dll"); + if (!File.Exists(path)) + { + var msg = $"{library.Name}.dll涓㈠け锛屽洜涓洪」鐩В鑰︿簡锛屾墍浠ラ渶瑕佸厛F6缂栬瘧锛屽啀F5杩愯锛岃妫�鏌� bin 鏂囦欢澶癸紝骞舵嫹璐濄��"; + //log.Error(msg); + throw new Exception(msg); + } + assemblyList.Add(Assembly.LoadFrom(path)); } catch (Exception ex) { -- Gitblit v1.9.3