From c0a130a9d3ffcf1359bb02f17c1ad8016d6a97a8 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sun, 14 Aug 2022 04:11:42 +0800 Subject: [PATCH] Update .net core --- .../SqlSugar/Infrastructure/InstanceFactory.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Src/Asp.NetCore2/SqlSugar/Infrastructure/InstanceFactory.cs b/Src/Asp.NetCore2/SqlSugar/Infrastructure/InstanceFactory.cs index 3a0255b7b..1bc4f75a8 100644 --- a/Src/Asp.NetCore2/SqlSugar/Infrastructure/InstanceFactory.cs +++ b/Src/Asp.NetCore2/SqlSugar/Infrastructure/InstanceFactory.cs @@ -15,7 +15,7 @@ namespace SqlSugar public static string CustomDbName = ""; public static string CustomNamespace = ""; public static bool NoCache = false; - + public static bool IsWebFrom = false; public static void RemoveCache() { typeCache = new Dictionary(); @@ -550,6 +550,11 @@ namespace SqlSugar } else { + if (IsWebFrom) + { + string newpath = (System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + "\\"+CustomDllName + ".dll").Replace("file:\\", ""); + return Assembly.LoadFrom(newpath); + } return Assembly.LoadFrom(CustomDllName + ".dll"); } }