diff --git a/src/Accounts/Accounts/Accounts.csproj b/src/Accounts/Accounts/Accounts.csproj index e514c5754b5f..231fb35d3593 100644 --- a/src/Accounts/Accounts/Accounts.csproj +++ b/src/Accounts/Accounts/Accounts.csproj @@ -21,6 +21,7 @@ + diff --git a/src/Accounts/Accounts/ChangeLog.md b/src/Accounts/Accounts/ChangeLog.md index e55384f8c14c..ffc42d25ef14 100644 --- a/src/Accounts/Accounts/ChangeLog.md +++ b/src/Accounts/Accounts/ChangeLog.md @@ -19,6 +19,7 @@ --> ## Upcoming Release +* Optimized the mechanism for assembly loading. * Enabled AzKeyStore with keyring in Linux. ## Version 2.10.4 diff --git a/src/Accounts/AssemblyLoading/AssemblyLoading.csproj b/src/Accounts/AssemblyLoading/AssemblyLoading.csproj index 29599b8a1209..b9c2e2d65331 100644 --- a/src/Accounts/AssemblyLoading/AssemblyLoading.csproj +++ b/src/Accounts/AssemblyLoading/AssemblyLoading.csproj @@ -1,14 +1,14 @@ - - Accounts - + + Accounts + - + - - Microsoft.Azure.PowerShell.AssemblyLoading - Microsoft.Azure.PowerShell.AssemblyLoading - + + Microsoft.Azure.PowerShell.AssemblyLoading + Microsoft.Azure.PowerShell.AssemblyLoading + - + diff --git a/src/Accounts/AssemblyLoading/ConditionalAssemblyProvider.cs b/src/Accounts/AssemblyLoading/ConditionalAssemblyProvider.cs index 1326790fee0f..23f580c58c3d 100644 --- a/src/Accounts/AssemblyLoading/ConditionalAssemblyProvider.cs +++ b/src/Accounts/AssemblyLoading/ConditionalAssemblyProvider.cs @@ -47,34 +47,30 @@ public static void Initialize(string rootPath, IConditionalAssemblyContext conte CreateAssembly("netcoreapp3.1", "Microsoft.Identity.Client.Extensions.Msal", "2.23.0.0").WithPowerShellCore(), CreateAssembly("netstandard2.0", "Azure.Identity", "1.6.1.0"), - CreateAssembly("netstandard2.0", "Microsoft.Bcl.AsyncInterfaces", "1.0.0.0").WithPowerShellCore(), - CreateAssembly("netstandard2.0", "Microsoft.IdentityModel.Abstractions", "6.22.1.0").WithPowerShellCore(), - CreateAssembly("netstandard2.0", "System.Memory.Data", "1.0.2.0").WithPowerShellCore(), - CreateAssembly("netstandard2.0", "System.Text.Json", "4.0.1.2").WithPowerShellCore(), - CreateAssembly("netstandard2.0", "System.Buffers", "4.0.3.0").WithWindowsPowerShell(), // standard - CreateAssembly("netstandard2.0", "System.Memory", "4.0.1.1").WithWindowsPowerShell(), // standard - CreateAssembly("netstandard2.0", "System.Net.Http.WinHttpHandler", "4.0.2.0").WithWindowsPowerShell(), // standard - CreateAssembly("netstandard2.0", "System.Private.ServiceModel", "4.7.0.0").WithWindowsPowerShell(), //standard - CreateAssembly("netstandard2.0", "System.Security.AccessControl", "4.1.1.0").WithWindowsPowerShell(), //standard - CreateAssembly("netstandard2.0", "System.Security.Permissions", "4.0.1.0").WithWindowsPowerShell(), //standard - CreateAssembly("netstandard2.0", "System.Security.Principal.Windows", "4.1.1.0").WithWindowsPowerShell(),//standard - CreateAssembly("netstandard2.0", "System.ServiceModel.Primitives", "4.7.0.0").WithWindowsPowerShell(), //standard - CreateAssembly("netstandard2.0", "System.Threading.Tasks.Extensions", "4.2.0.1").WithWindowsPowerShell(), //standard + CreateAssembly("netstandard2.0", "Microsoft.Bcl.AsyncInterfaces", "1.0.0.0"), + CreateAssembly("netstandard2.0", "Microsoft.IdentityModel.Abstractions", "6.22.1.0"), + CreateAssembly("netstandard2.0", "System.Memory.Data", "1.0.2.0"), + CreateAssembly("netstandard2.0", "System.Text.Json", "4.0.1.2"), + CreateAssembly("netstandard2.0", "System.Buffers", "4.0.3.0").WithWindowsPowerShell(), + CreateAssembly("netstandard2.0", "System.Memory", "4.0.1.1").WithWindowsPowerShell(), + CreateAssembly("netstandard2.0", "System.Net.Http.WinHttpHandler", "4.0.2.0").WithWindowsPowerShell(), + CreateAssembly("netstandard2.0", "System.Private.ServiceModel", "4.7.0.0").WithWindowsPowerShell(), + CreateAssembly("netstandard2.0", "System.Security.AccessControl", "4.1.1.0").WithWindowsPowerShell(), + CreateAssembly("netstandard2.0", "System.Security.Permissions", "4.0.1.0").WithWindowsPowerShell(), + CreateAssembly("netstandard2.0", "System.Security.Principal.Windows", "4.1.1.0").WithWindowsPowerShell(), + CreateAssembly("netstandard2.0", "System.ServiceModel.Primitives", "4.7.0.0").WithWindowsPowerShell(), + CreateAssembly("netstandard2.0", "System.Threading.Tasks.Extensions", "4.2.0.1").WithWindowsPowerShell(), CreateAssembly("netfx", "Azure.Core", "1.25.0.0").WithWindowsPowerShell(), - CreateAssembly("netfx", "Microsoft.Bcl.AsyncInterfaces", "1.1.1.0").WithWindowsPowerShell(), // can use standard? CreateAssembly("netfx", "Microsoft.Identity.Client", "4.46.2.0").WithWindowsPowerShell(), CreateAssembly("netfx", "Microsoft.Identity.Client.Extensions.Msal", "2.23.0.0").WithWindowsPowerShell(), - CreateAssembly("netfx", "Microsoft.IdentityModel.Abstractions", "6.22.1.0").WithWindowsPowerShell(), //can use standard? - CreateAssembly("netfx", "Newtonsoft.Json", "10.0.0.0").WithWindowsPowerShell(), //double check; 12.0.0 + CreateAssembly("netfx", "Newtonsoft.Json", "12.0.0.0").WithWindowsPowerShell(), CreateAssembly("netfx", "System.Diagnostics.DiagnosticSource", "4.0.4.0").WithWindowsPowerShell(), - CreateAssembly("netfx", "System.Memory.Data", "1.0.2.0").WithWindowsPowerShell(), //can use standard? CreateAssembly("netfx", "System.Numerics.Vectors", "4.1.4.0").WithWindowsPowerShell(), CreateAssembly("netfx", "System.Reflection.DispatchProxy", "4.0.4.0").WithWindowsPowerShell(), CreateAssembly("netfx", "System.Runtime.CompilerServices.Unsafe", "4.0.6.0").WithWindowsPowerShell(), CreateAssembly("netfx", "System.Security.Cryptography.Cng", "4.3.0.0").WithWindowsPowerShell(), CreateAssembly("netfx", "System.Text.Encodings.Web", "4.0.5.1").WithWindowsPowerShell(), - CreateAssembly("netfx", "System.Text.Json", "4.0.1.2").WithWindowsPowerShell(), //can use standard? CreateAssembly("netfx", "System.Xml.ReaderWriter", "4.1.0.0").WithWindowsPowerShell(), #endregion }; diff --git a/src/Accounts/AuthenticationAssemblyLoadContext/AzAssemblyLoadContext.cs b/src/Accounts/AuthenticationAssemblyLoadContext/AzAssemblyLoadContext.cs index 24eb2dca01af..8e3e2dab975e 100644 --- a/src/Accounts/AuthenticationAssemblyLoadContext/AzAssemblyLoadContext.cs +++ b/src/Accounts/AuthenticationAssemblyLoadContext/AzAssemblyLoadContext.cs @@ -29,6 +29,14 @@ internal class AzAssemblyLoadContext : AzAssemblyLoadContextBase private static readonly ConcurrentDictionary DependencyLoadContexts = new ConcurrentDictionary(); + /// + /// Get an ALC for a certain directory that contains assemblies. + /// + /// + /// There are two types of possible value for : + /// 1. which will create if not exist and return an ALC for shared libraries. + /// 2. A directory in a service module that contains the assemblies to be loaded into the ALC of the service module. + /// internal static AssemblyLoadContext GetForDirectory(string directoryPath) { return DependencyLoadContexts.GetOrAdd(directoryPath, path => path.Equals(AzSharedAssemblyLoadContext.Key) ? new AzSharedAssemblyLoadContext() : (AssemblyLoadContext)new AzAssemblyLoadContext(directoryPath)); diff --git a/src/lib/netfx/Newtonsoft.Json.12.0.3.dll b/src/lib/netfx/Newtonsoft.Json.12.0.3.dll deleted file mode 100644 index e4a63399d0d9..000000000000 Binary files a/src/lib/netfx/Newtonsoft.Json.12.0.3.dll and /dev/null differ diff --git a/src/lib/netfx/Newtonsoft.Json.dll b/src/lib/netfx/Newtonsoft.Json.dll index 77a5d89e605c..e4a63399d0d9 100644 Binary files a/src/lib/netfx/Newtonsoft.Json.dll and b/src/lib/netfx/Newtonsoft.Json.dll differ diff --git a/tools/Common.Netcore.Dependencies.Test.targets b/tools/Common.Netcore.Dependencies.Test.targets index df5cada97d66..3cbf834d54bb 100644 --- a/tools/Common.Netcore.Dependencies.Test.targets +++ b/tools/Common.Netcore.Dependencies.Test.targets @@ -16,7 +16,7 @@ - + diff --git a/tools/Common.Netcore.Dependencies.targets b/tools/Common.Netcore.Dependencies.targets index 0a6d42bd55ff..40056e2abf41 100644 --- a/tools/Common.Netcore.Dependencies.targets +++ b/tools/Common.Netcore.Dependencies.targets @@ -39,6 +39,6 @@ $(NugetPackageRoot)\microsoft.azure.powershell.storage\1.3.67-preview\tools\ - +