Skip to content

Document change in assembly loading behaviour #4249

Closed

Description

See PowerShell/PowerShell#9488 (comment)

Assembly loading behaviour was changed in PowerShell 6.2. Any assemblies listed in FileList of a module manifest will be loaded, although this will fail for native assemblies and prevent them being loaded properly later.

As such, native assemblies should always be excluded from the FileList entries in a module manifest.

Issue Details

Version(s) of document impacted

  • Impacts 6.next document
  • Impacts 6 document (6.2)
  • Impacts 5.1 document
  • Impacts 5.0 document
  • Impacts 4.0 document
  • Impacts 3.0 document

Reason(s) for not selecting all version of documents

  • The documented feature was introduced in selected version of PowerShell
  • This issue only shows up in selected version of the document

Activity

  1. added this to the 6.2.0 milestone on May 8, 2019
  2. added
    area-language
    and removed
    area-sdk-docs
    on Jun 26, 2019
  3. sdwheeler commented on Jun 26, 2019

    @sdwheeler
    Contributor

    Update about_Modules and release notes.

  4. added
    review-shiproom
    and removed on Nov 18, 2019
  5. sdwheeler commented on Nov 18, 2019

    @sdwheeler
    Contributor

    Steve Lee (@SteveL-MSFT) We need a more complete description that we can add to the appropriate docs. Also, is there plans to address any of this in PSv7?

  6. sdwheeler commented on Nov 22, 2019

    @sdwheeler
    Contributor

    Rain Sallow (/u/ta11ow) (@vexx32) Is this something you could help us document?

  7. vexx32 commented on Nov 22, 2019

    @vexx32
    ContributorAuthor

    😁 I can do my best, but I'm fairly sure there'll be parts I don't know well enough. I'm not really sure why the behaviour was changed to begin with, among other things.

    Perhaps Dongbo Wang (@daxian-dbw) or Paul Higinbotham (@PaulHigin) might be more familiar with the rationale and the changes themselves.

    If they aren't able to help out here for whatever reason I'm sure I can chat to a few other folx who know the background info better and help y'all put something together as best I can! 😊

  8. sdwheeler commented on Dec 12, 2019

    @sdwheeler
    Contributor

    Dongbo Wang (@daxian-dbw) Can you help with core information?

  9. joeyaiello commented on Dec 12, 2019

    @joeyaiello
    Contributor

    Subsequently, we need to also document PowerShell/PowerShell#11032 as native DLL resolution has also changed.

  10. added
    doc-a-thon
    on Jan 8, 2020
  11. 6 remaining items

  12. removed
    review-shiproom
    on Jan 15, 2020
  13. joeyaiello commented on Jan 22, 2020

    @joeyaiello
    Contributor

    The question we haven't answered is whether this has been fixed in 7.0.

    Is this still the behavior?

  14. adityapatwardhan commented on May 27, 2020

    @adityapatwardhan
    Contributor

    I can confirm that the behavior for 7.0.1 is to load the managed assemblies in the file list.

  15. sdwheeler commented on May 27, 2020

    @sdwheeler
    Contributor

    Aditya Patwardhan (@adityapatwardhan) What I need is a full description of the load behavior so that I can update the docs to reflect the new behavior.

  16. adityapatwardhan commented on May 28, 2020

    @adityapatwardhan
    Contributor

    I have opened a new issue: PowerShell/PowerShell#12821

    That issue needs committee review. If the issue is going to be fixed, then we do not need to change the docs, if issue is not fixed we need to update the docs.

    Update would be something like, probably a note.

    [!NOTE] All the DLL files listed in FileList property of the module manifest will be attempted to load. If a native DLL is in the file list, it will fail to load in the process and the error is ignored. All managed DLLs will be loaded in the process.

  17. sdwheeler commented on Jun 10, 2020

    @sdwheeler
    Contributor

    PowerShell/PowerShell#12821 (comment)

    @PowerShell/powershell-committee reviewed this, we agreed that the desire is to have:

    • load assemblies from module base first, then GAC
    • not load anything from FileList restoring previous behavior
    • fix should be backported to 7.0.x
  18. added
    review-shiproom
    and removed
    Pri0
    doc-a-thon
    on Jun 10, 2020
  19. adityapatwardhan commented on Jun 16, 2020

    @adityapatwardhan
    Contributor

    PR opened to change the behavior back to not loaded assemblies listed in FileList PowerShell/PowerShell#12968

  20. adityapatwardhan commented on Aug 25, 2020

    @adityapatwardhan
    Contributor

    Here is the assembly load behavior by version:

    6.2.x -- Soon to be EOL

    We introduced a regression from 6.1.0 where we started loading everything listed in FileList property of the module manifest.

    7.0.x -- LTS

    The regression was not fixed here.

    The suggested text for 6.2.x and 7.0.x is:

    [!NOTE] All the DLL files listed in FileList property of the module manifest will be attempted to load. If a native DLL is in the file list, it will fail to load in the process and the error is ignored. All managed DLLs will be loaded in the process.

    7.1.0.preview.5 +

    The regression was fixed and we do not load assemblies listed in the FileList property. PowerShell/PowerShell#12968

    Dongbo Wang (@daxian-dbw) Steve Lee (@SteveL-MSFT) - So the current state is we have no regression between 6.1.0 -> 7.1.0. But there is a change in behavior betweem 7.0.0 -> 7.1.0.

    Should we consider PowerShell/PowerShell#12968 for back porting to 7.0.x?

  21. adityapatwardhan commented on Aug 25, 2020

    @adityapatwardhan
    Contributor

    Sean Wheeler (@sdwheeler) Chase Wilson (@chasewilson) Do you have sufficient information for the doc update?

  22. removed
    review-shiproom
    on Nov 2, 2020
  23. added a commit that references this issue on Nov 2, 2020
    3bafd6e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-language

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions