OpenMacroBoard / StreamDeckSharp

A simple .NET wrapper for Stream Deck
MIT License
356 stars 47 forks source link

Loads into PowerShell, but fails to find OpenMacroBoard.SDK assembly #24

Closed pcgeek86 closed 4 years ago

pcgeek86 commented 4 years ago

For some reason, I can load this library, but I can't successfully call OpenDevice() method from PowerShell.

I'm trying to load this library into PowerShell 7.0.1, but I'm getting an error. I downloaded both NuGet packages and unzipped them, to get the .NET Standard 2.0 DLLs. I loaded them both, but then the OpenDevice() method won't work correctly.

The OpenMacroBoard SDK I downloaded from NuGet is v1.0.0, not v1.1.0.0, like StreamDeckSharp is looking for.

PS > [System.Reflection.Assembly]::LoadFile("OpenMacroBoard.SDK.dll")
PS > [System.Reflection.Assembly]::LoadFile("StreamDeckSharp.dll")
PS > [StreamDeckSharp.StreamDeck]::OpenDevice()
ExtendedTypeSystemException: The following exception occurred while retrieving member "OpenDevice": "Could not load file or assembly 'OpenMacroBoard.SDK, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot 
find the file specified."

Any ideas where to get the v1.1.0 of the OpenMacroBoard DLL?

wischi-chr commented 4 years ago

There is no OpenMacroBoard v1.1, the latest version is 1.0 and streamdecksharp 1.1 is compatible with OMB 1.0

I've never tried it on Powershell (will test it later, am on mobile right now)

flat-eric147 commented 4 years ago

For some reason, I can load this library, but I can't successfully call OpenDevice() method from PowerShell.

I'm trying to load this library into PowerShell 7.0.1, but I'm getting an error. I downloaded both NuGet packages and unzipped them, to get the .NET Standard 2.0 DLLs. I loaded them both, but then the OpenDevice() method won't work correctly.

The OpenMacroBoard SDK I downloaded from NuGet is v1.0.0, not v1.1.0.0, like StreamDeckSharp is looking for.

PS > [System.Reflection.Assembly]::LoadFile("OpenMacroBoard.SDK.dll")
PS > [System.Reflection.Assembly]::LoadFile("StreamDeckSharp.dll")
PS > [StreamDeckSharp.StreamDeck]::OpenDevice()
ExtendedTypeSystemException: The following exception occurred while retrieving member "OpenDevice": "Could not load file or assembly 'OpenMacroBoard.SDK, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot 
find the file specified."

Any ideas where to get the v1.1.0 of the OpenMacroBoard DLL?

I have the very same issue. I ported my app from .net framework 4.8 to net core 3.1 and I get the same dll load error. The references System.Drawing.Common, HidSharp and OpenMacroBoard.SDK are all there and look fine.

wischi-chr commented 4 years ago

Sadly it took me a while, was pretty busy. It was a bug in the build pipeline that caused that issue. It's fixed with v2.0 (already available on nuget)

Pls let me know if it works for you as well. Thx.

flat-eric147 commented 4 years ago

Sadly it took me a while, was pretty busy. It was a bug in the build pipeline that caused that issue. It's fixed with v2.0 (already available on nuget)

Pls let me know if it works for you as well. Thx.

Yes! Just tried a quick test and it seems to work as expected! From my perspective this fix came lightning fast :) Thanks & much appreciated.

pcgeek86 commented 4 years ago

I appreciate you fixing this, but I ended up implementing WebSockets in PowerShell natively instead. I published a working example of a purely PowerShell-based Stream Deck plug-in over here: https://github.com/pcgeek86/elgato-streamdeck-powershell