microsoft / SQLServerPSModule

This repo is the home of SQL Server PowerShell Module development.
MIT License
45 stars 1 forks source link

v23: Implement Assembly Load and Module Isolation properly #31

Open Matteo-T opened 1 year ago

Matteo-T commented 1 year ago

Current version of the module has a rather fragile logic around "isolation" and "binding redirection".

A cmmon problem I faced in v22 is the interaction of the SqlServer module with some of the Az.* modules, where the order of the Import-Module makes a great difference and may cause unpredictable results are runtime (note: results and failures are also PS5 and PS7 specific, typically... meaning that some things may work in PS5 and fail in PS7, and vice versa)

There is ample literature on the subject, for example:

The cost and the intricacies to get is properly implemented look like a monumental effort that would require a pretty serious redesign/refactoring of the whole module (and, quite honestly, all the other existing modules that SQLServer module would happen to interoperate with).

Furthermore, I suspect that for PS5 things may be a lot harder to get implemente cleanly and properly, due to the fact that all the new stuff in .Net are only available in .Net Core. So, perhaps, this tasks would have to be deferred to the day when the SQLServer module will be PS7-only.