Marfusios/websocket-client

How to add-type to powershell

eeldivad opened this issue · 1 comments

I'm trying to run websocket.client in powershell but unable to load assembly. When I run this line in powershell 5.1 on Windows Server 2019, I get:
Add-Type -Path .\Websocket.Client.dll
Add-Type : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

$Error[0].Exception.LoaderExceptions
Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.

I'm running powershell 5.1 on Windows server 2019. I was able to get websocket-sharp.dll to load and working but it doesn't have reconnect options and hasn't been maintained in 5 years so I would like to use websocket.client.dll but unable to load assembly. Any help would be greatly appreciated. Thanks

Hi @eeldivad,

a difficult question for me, because I never worked too much with powershell.
But I can imagine it doesn't resolve all dependency graph by itself and you need to help them.

I have already run into that issue in Unity and WinForms (old .NET framework).

Take look here and try to import those libraries manually.