mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 18:47:57 -05:00
Change ExtensionServiceProvider to use a single AssemblyLoadContext (#696)
* Switch to the unified SMO NuGet so all binaries are strong named and signed. * use one AssemblyLoader instance for all loads * Revert "use one AssemblyLoader instance for all loads" This reverts commit 48c59ffd5c57152de281c87acdbcad7ddf7ab760. * Stop creating multiple AssemblyLoadContext objects during composition, per https://github.com/dotnet/coreclr/issues/19632 * restore high entropyva property * Improve the comment
This commit is contained in:
@@ -230,8 +230,11 @@ namespace Microsoft.SqlTools.Extensibility
|
|||||||
var apiApplicationFileInfo = new FileInfo($"{folderPath}{Path.DirectorySeparatorChar}{assemblyName.Name}.dll");
|
var apiApplicationFileInfo = new FileInfo($"{folderPath}{Path.DirectorySeparatorChar}{assemblyName.Name}.dll");
|
||||||
if (File.Exists(apiApplicationFileInfo.FullName))
|
if (File.Exists(apiApplicationFileInfo.FullName))
|
||||||
{
|
{
|
||||||
var asl = new AssemblyLoader(apiApplicationFileInfo.DirectoryName);
|
// Creating a new AssemblyContext instance for the same folder puts us at risk
|
||||||
return asl.LoadFromAssemblyPath(apiApplicationFileInfo.FullName);
|
// of loading the same DLL in multiple contexts, which leads to some unpredictable
|
||||||
|
// behavior in the loader. See https://github.com/dotnet/coreclr/issues/19632
|
||||||
|
|
||||||
|
return LoadFromAssemblyPath(apiApplicationFileInfo.FullName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Assembly.Load(assemblyName);
|
return Assembly.Load(assemblyName);
|
||||||
|
|||||||
Reference in New Issue
Block a user