Skip to content

Commit c497db1

Browse files
authored
Update dependencies of Azure.Core 1.22.0 (#17622)
* Update assembly version * update code
1 parent cd12623 commit c497db1

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

documentation/development-docs/common-assemblies.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Since .NET Core and above cannot load 2 different versions of one assembly into
1111
Service module of Azure PowerShell also can create its assembly load context when it must depend on a assembly with different version from other modules. The page [How to define AssemblyLoadContext for module](/src/Accounts/AuthenticationAssemblyLoadContext) provides a comprehensive sample used by `Az.Compute`.
1212

1313
## Windows PowerShell with .NET Framework
14-
Azure PowerShell uses a different approach for Windows PowerShell with .NET Framework because, instead of assembly conflict, the major problem is required assembly may not be offered by Windows PowerShell or .NET Framework. `Az.Accounts` registers a handler in `CustomAssemblyResolver` to handle event that required assembly could not be resolved. It means target assembly cannot be found from the probing path of .NET Framework or Windows PowerShell. Then, resolver compares expected version and loads target from directory `/PreloadAssemblies` (`src/lib/NetCorePreloadAssemblies`) in `Az.Accounts` if major version is the same. Here, we assume there is no breaking change across minor or patch versions, but it cannot be guaranteed.
14+
The major problem on Windows PowerShell is required assembly may not be offered by Windows PowerShell or .NET Framework. `Az.Accounts` registers a handler in `CustomAssemblyResolver` to handle event that required assembly could not be resolved. It means target assembly cannot be found from the probing path of .NET Framework or Windows PowerShell. Then, resolver compares expected version and loads target from directory `/PreloadAssemblies` (`src/lib/NetCorePreloadAssemblies`) in `Az.Accounts` if major version is the same. Here, we assume there is no breaking change across minor or patch versions, but it cannot be guaranteed.
1515

1616
For further reading, please visit https://docs.microsoft.com/en-us/dotnet/standard/assembly/resolve-loads#how-the-assemblyresolve-event-works
1717

@@ -20,9 +20,9 @@ For further reading, please visit https://docs.microsoft.com/en-us/dotnet/standa
2020
`Azure.Core` is common library used by management plane and data plane SDKs. Below are steps to upgrade its version.
2121
1. Navigate to [Common.Netcore.Dependencies.targets](/tools/Common.Netcore.Dependencies.targets) to check current version of `Azure.Core` used by latest code and bump version to expected.
2222
2. Compare dependencies of `Azure.Core` on [nuget.org](https://www.nuget.org/packages/Azure.Core/) between current version and expected version.
23-
3. Extract DLL file in nuget package folder `lib/netcoreapp2.1` of `Azure.Core` and changed dependencies and copy them to `src/lib/NetCorePreloadAssemblies`.
23+
3. Extract DLL file in nuget package folder `lib/netcoreapp2.1` of `Azure.Core` and changed dependencies and copy them to `src/lib/NetCorePreloadAssemblies`. You need to ensure the version CANNOT be higher than existing assembly if PowerShell already includes it.
2424
4. Update assembly version of `Azure.Core` and changed dependencies to .NET Stardard 2.0 in `/src/Accounts/AuthenticationAssemblyLoadContext/AzAssemblyLoadContextInitializer.cs`.
25-
5. Extract DLL file in nuget package folder `lib/net461` of `Azure.Core` and changed dependencies and copy them to `src/lib/NetFxPreloadAssemblies`.
25+
5. Extract DLL file in nuget package folder `lib/net461` (alternatively, `netstandard2.0`) of `Azure.Core` and changed dependencies and copy them to `src/lib/NetFxPreloadAssemblies`.
2626
6. Update assembly version of `Azure.Core` and changed dependencies to .NET Framework in `/src/Accounts/Authentication/Utilities/CustomAssemblyResolver.cs`.
2727
7. Verify built `Az.Accounts` can work with existing Azure PowerShell modules on PowerShell 7 and Windows PowerShell.
2828
- Import module into PowerShell 7 or Windows PowerShell.

src/Accounts/Authentication/Utilities/CustomAssemblyResolver.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ public static class CustomAssemblyResolver
3636
{"System.Memory", new Version("4.0.1.1")},
3737
{"System.Memory.Data", new Version("1.0.2.0")},
3838
{"System.Net.Http.WinHttpHandler", new Version("4.0.2.0")},
39-
{"System.Numerics.Vectors", new Version("4.1.3.0")},
39+
{"System.Numerics.Vectors", new Version("4.1.4.0")},
4040
{"System.Private.ServiceModel", new Version("4.7.0.0")}, //used by Compute
4141
{"System.Reflection.DispatchProxy", new Version("4.0.3.0")},
42-
{"System.Runtime.CompilerServices.Unsafe", new Version("4.0.5.0")},
42+
{"System.Runtime.CompilerServices.Unsafe", new Version("4.0.6.0")},
4343
{"System.Security.AccessControl", new Version("4.1.1.0")},
4444
{"System.Security.Cryptography.Cng", new Version("4.3.0.0")},
4545
{"System.Security.Permissions", new Version("4.0.1.0")},
Binary file not shown.

0 commit comments

Comments
 (0)