Powershell load dlls without reflection

2

Is it possible to load an dlls in "Powershell" with out the use of reflection.

I have loaded a .Net dll using

Add-Type -AssemblyName System.Web | Out-Null

I have my "Powershell" script in the same folder as the dlls. So I presumed the following would work .

Add-Type -AssemblyName Common.dll | Out-Null
Add-Type -AssemblyName 'Common.dll' | Out-Null

But I get the error "Cannot add type. The assembly 'Common.dll' could not be found."

or

Add-Type -AssemblyName .\Common.dll | Out-Null

Could not load file or assembly '.\Common.dll' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)

Can anyone please help?

powershell
asked on Stack Overflow Nov 12, 2015 by Alan Mulligan

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0