PowerShell runtime exception - “could not load file or assembly”

后端 未结 5 1664
既然无缘
既然无缘 2021-01-11 11:27

This seems to be a common problem in PowerShell and Visual Studio, yet cases and solutions seem to vary a lot. Though seeing several similar questions, I didn\'t find a work

5条回答
  •  情书的邮戳
    2021-01-11 11:42

    Import-Module : Could not load file or assembly 'file:/// *dll path*' or one of 
    its dependencies. An attempt was made to load a program with an incorrect format.
    At *script path*.ps1:68 char:2
    +     Import-Module *module path*
    +     ~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Import-Module], BadImageFormatException
        + FullyQualifiedErrorId : System.BadImageFormatException,Microsoft.PowerShell.Commands.ImportModuleCommand
    

    If you see the above error, it might be the issue of running the Windows PowerShell ISE in 32 bit mode(Windows PowerShell ISE(x86)). You have to run the application Windows PowerShell ISE.

    This application(Windows PowerShell ISE) is in 64 bit mode. When I executed the power shell command, its working fine for me.

    I have been trying to fix this with different types solutions but it doesn't worked for me. If you running it 32 mode, switch it to 64 bit and try.

提交回复
热议问题