1
votes

I have a solution of 7 projects. I have also an external DLL that I can add through Visual Studio :

enter image description here

It works fine with Visual Studio. I tried to simulate the same action using command line and namely Powershell:

Add-Type -Path "D:\ExternalDlls\Scorm.dll"

I got this error :

Add-Type : Could not load file or assembly 'file:///D:\ExternalDlls\Scorm.dll' or one of its de This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. At line:1 char:9 + Add-Type <<<< -Path "D:\ExternalDlls\Scorm.dll" + CategoryInfo : NotSpecified: (:) [Add-Type], BadImageFormatException + FullyQualifiedErrorId : System.BadImageFormatException,Microsoft.PowerShell.Commands.AddTypeCommand�

My environment is :

  • Visual Studio 2015 (it makes things done but I need the CLI )
  • Windows 7 - Service Pack1
  • Powershell
1

1 Answers

1
votes

Can you please specify which .NET framework version you are using? This error "This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded" could also be possible if there is a mismatch in .NET version.

Please refer the following reference: "This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded"

One more possibility is that there might be other dependent dlls will be there which we need to load also.

Thanks,