Update custom database bug

This commit is contained in:
sunkaixuan
2022-03-09 23:17:15 +08:00
parent 49389ed91c
commit 7b9fefe45f

View File

@@ -527,7 +527,19 @@ namespace SqlSugar
var newAssembly = new ReflectionInoCacheService().GetOrCreate<Assembly>(key, () => { var newAssembly = new ReflectionInoCacheService().GetOrCreate<Assembly>(key, () => {
try try
{ {
return Assembly.LoadFrom(CustomDllName + ".dll"); var path = Assembly.GetExecutingAssembly().Location;
if (path.HasValue())
{
path =System.IO.Path.Combine( System.IO.Path.GetDirectoryName(path), CustomDllName + ".dll");
}
if (path.HasValue() && FileHelper.IsExistFile(path))
{
return Assembly.LoadFrom(path);
}
else
{
return Assembly.LoadFrom(CustomDllName + ".dll");
}
} }
catch catch
{ {