Update custom database bug

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

View File

@@ -526,9 +526,21 @@ namespace SqlSugar
var key = "Assembly_"+ CustomDllName+assembly.GetHashCode();
var newAssembly = new ReflectionInoCacheService().GetOrCreate<Assembly>(key, () => {
try
{
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
{
var message = "Not Found " + CustomDllName + ".dll";