-
Notifications
You must be signed in to change notification settings - Fork 215
Safe Dependency Resolution For Side-By-Side Loading With Other Modules #585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Can this PR lead us to a path of building and testing on linux? |
| // Catalog our dependencies here to ensure we don't load anything else. | ||
| private static IReadOnlyDictionary<string, Version> Dependencies = new Dictionary<string, Version> | ||
| { | ||
| { "Microsoft.Identity.Client", new Version("4.23.0.0") }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the resolution logic use a file instead of being explicitly set here?
For example read the csproj to determine this list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't access csproj here since this is done at runtime and not build time. We need to know which assembly and version to load on our own when PowerShell imports a module thus the need for an in-memory dictionary.
Also, read and write speed is something to consider when resolving dependencies.
@finsharp, the scope of this PR is only limited to addressing dependency resolution at runtime. To build on Linux, we will need to overhaul our generation scripts. |
* Bump .NET Core version * Add client capability to MSAL. * Bump MS Graph core version. * Weekly OpenApiDocs Download * Safe Dependency Resolution For Side-By-Side Loading With Other Modules (#585) * Divide project into 2 assemblies. * Update build scripts to build, sign and pack auth module with core dll. * Updates ADO pipeline to also sign and strong name MSG.Authentication.Core.dll. * Add Pester tests for loading module side by side. * Add internals visible to test proj. * Load multiframework dependencies. * Weekly OpenApiDocs Download * Update agreementFile remove directive (#605) * Fix aggrement file directive. * Bump SDK version to 1.4.3. * Adds missing site permissions to sites module (#607) * Add sistes.permissions tag to module mappings. * Generate profile for sites. * Sort crawl logs. * Weekly OpenApiDocs Download (#616) Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com> * identity governance: reduce unneeded EM cmdlets (#577) * add suppression for autogenerated get cmdlets * remove New cmdlets * add remove set and update variants of those get cmdlets * remove search and ro cmdlets * remove cmdlets for read only links and objects * Update src/Identity.Governance/Identity.Governance/readme.md Co-authored-by: Peter Ombwa <peter.ombwa@microsoft.com> * Weekly OpenApiDocs Download (#619) Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com> * 1.5.0 Pre-Release (#617) * Bump SDK version to 1.5.0 * Handle duplicate cmdlet names across modules. * Update readme.md * Use version in manifest if module is not in repo. Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Mark Wahl <mwahl@microsoft.com>
This PR closes #534 by implementing an assembly resolve handler that handles loading our dependencies for side-by-side loading with other modules. This change involves:
Microsoft.Graph.Authentication.CoreandMicrosoft.Graph.Authentication.Microsoft.Graph.Authentication.CoreandMicrosoft.Graph.Authenticationwill be loaded by PowerShell, and all our dependencies will be loaded byMicrosoft.Graph.Authentication.Coreinto the execution context.Microsoft.Graph.Authentication.Corespecifies and makes calls to our dependencies e.g. MSAL.Microsoft.Graph.Authenticationcontains implementations of our cmdlets and calls methods inMicrosoft.Graph.Authentication.Core..\azure-pipelines.This PR should unblock #555, #415, #334, and #517