MSEndpointMgr / ConfigMgr

Microsoft Endpoint Configuration Manager scripts and tools
629 stars 282 forks source link

Import-Module : Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information. #260

Open tjmklaver opened 3 years ago

tjmklaver commented 3 years ago

When starting the Driver Automation Tool.exe it shows the following error message when importing PS module BitsTransfer. Running the tool on Primary Site Server using Windows Server 2012 R2 with ConfigMgr 2002. PS version: 5.1.14409.1005

Loading module from path 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\BitsTransfer\BitsTransfer.psd1'. Loading 'Assembly' from path 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\BitsTransfer\Microsoft.BackgroundIntelligentTransfer.Management.Interop.dll'. Loading 'Assembly' from path 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\BitsTransfer\Microsoft.BackgroundIntelligentTransfer.Management.Interop.dll'. Loading 'FormatsToProcess' from path 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\BitsTransfer\BitsTransfer.Format.ps1xml'. Import-Module : Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information. At line:162 char:1

jimmyeao commented 3 years ago

Also having the same issue with 6.4.9 hotfix 3 on a fresh install, W2012R2 Powershell 5.1.14409.1005 (Freshly updated today)

Loading module from path 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\BitsTransfer\BitsTransfer.psd1'.
Loading 'Assembly' from path 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\BitsTransfer\Microsoft.BackgroundIntelligentTransfer.Management.Interop.dll'.
Loading 'Assembly' from path 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\BitsTransfer\Microsoft.BackgroundIntelligentTransfer.Management.Interop.dll'.
Loading 'FormatsToProcess' from path 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\BitsTransfer\BitsTransfer.Format.ps1xml'.
Import-Module : Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
At line:162 char:1
+ Import-Module -Name BitsTransfer -Verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Import-Module], FileLoadException
    + FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand
tjmklaver commented 3 years ago

I was able to fix it, by copy driverautomationtool.config to the folder where driverautomationtool.exe is located.

jimmyeao commented 3 years ago

where is driverautomationtool.config? I cant find any such file

tjmklaver commented 3 years ago

Can be found in the download of the Driver Automation Tool. (DriverAutomationTool-master\DriverAutomationTool-master\Content)

jimmyeao commented 3 years ago

DriverAutomationTool-master\DriverAutomationTool-master\Conten

Awesome, fixed it here too, thanks 👍

bythesword69 commented 3 years ago

I was able to fix it, by copy driverautomationtool.config to the folder where driverautomationtool.exe is located.

Perfect Thanks