Skip to content

Commit

Permalink
newtonsoft.json
Browse files Browse the repository at this point in the history
  • Loading branch information
isra-fel committed Dec 8, 2022
1 parent bdd5297 commit 79352ab
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 29 deletions.
1 change: 1 addition & 0 deletions src/Accounts/Accounts/Accounts.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

<ItemGroup>
<PackageReference Include="System.Security.Permissions" Version="4.5.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.4.1" /> <!--needed for newtonsoft.json at compile time-->
</ItemGroup>

<Target Name="CopyFiles" AfterTargets="Build">
Expand Down
1 change: 1 addition & 0 deletions src/Accounts/Accounts/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
-->

## Upcoming Release
* Optimized the mechanism for assembly loading.
* Enabled AzKeyStore with keyring in Linux.

## Version 2.10.4
Expand Down
18 changes: 9 additions & 9 deletions src/Accounts/AssemblyLoading/AssemblyLoading.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PsModuleName>Accounts</PsModuleName>
</PropertyGroup>
<PropertyGroup>
<PsModuleName>Accounts</PsModuleName>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)..\..\Az.props" />
<Import Project="$(MSBuildThisFileDirectory)..\..\Az.props" />

<PropertyGroup>
<AssemblyName>Microsoft.Azure.PowerShell.AssemblyLoading</AssemblyName>
<RootNamespace>Microsoft.Azure.PowerShell.AssemblyLoading</RootNamespace>
</PropertyGroup>
<PropertyGroup>
<AssemblyName>Microsoft.Azure.PowerShell.AssemblyLoading</AssemblyName>
<RootNamespace>Microsoft.Azure.PowerShell.AssemblyLoading</RootNamespace>
</PropertyGroup>

<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., build.proj))\src\Az.Post.props" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., build.proj))\src\Az.Post.props" />
</Project>
32 changes: 14 additions & 18 deletions src/Accounts/AssemblyLoading/ConditionalAssemblyProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ internal class AzAssemblyLoadContext : AzAssemblyLoadContextBase

private static readonly ConcurrentDictionary<string, AssemblyLoadContext> DependencyLoadContexts = new ConcurrentDictionary<string, AssemblyLoadContext>();

/// <summary>
/// Get an ALC for a certain directory that contains assemblies.
/// </summary>
/// <remarks>
/// There are two types of possible value for <paramref name="directoryPath"/>:
/// 1. <see cref="AzSharedAssemblyLoadContext.Key"/> 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.
/// </remarks>
internal static AssemblyLoadContext GetForDirectory(string directoryPath)
{
return DependencyLoadContexts.GetOrAdd(directoryPath, path => path.Equals(AzSharedAssemblyLoadContext.Key) ? new AzSharedAssemblyLoadContext() : (AssemblyLoadContext)new AzAssemblyLoadContext(directoryPath));
Expand Down
Binary file removed src/lib/netfx/Newtonsoft.Json.12.0.3.dll
Binary file not shown.
Binary file modified src/lib/netfx/Newtonsoft.Json.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion tools/Common.Netcore.Dependencies.Test.targets
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<PackageReference Include="xunit.runner.console" Version="2.4.0" />
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.5.0" />
<Reference Include="System.Net.Http" />
<PackageReference Include="Newtonsoft.Json" version="10.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Microsoft.Extensions.Primitives" Version="2.2.0" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion tools/Common.Netcore.Dependencies.targets
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@
<StorageToolsPath>$(NugetPackageRoot)\microsoft.azure.powershell.storage\1.3.67-preview\tools\</StorageToolsPath>
</PropertyGroup>
<ItemGroup Condition="'$(OmitJsonPackage)' != 'true'">
<PackageReference Include="Newtonsoft.Json" Version="10.0.3"/>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3"/>
</ItemGroup>
</Project>

0 comments on commit 79352ab

Please sign in to comment.