1

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 Answer 1

1

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,

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.