Pulse-Eight / libcec

USB CEC Adapter communication Library http://libcec.pulse-eight.com/
Other
707 stars 284 forks source link

System.BadImageFormatException when running a dotnet core program #532

Open rhyek opened 3 years ago

rhyek commented 3 years ago

Using libCEC 6.0.2, with dotnet core using LibCecSharpCore.dll I get the following when starting a debug session:

PS C:\Users\Carlos\Dev\test\test-cec> dotnet run
Unhandled exception. System.BadImageFormatException: Could not load file or assembly 'LibCecSharpCore, Version=6.0.2.20516, Culture=neutral, PublicKeyToken=null'. An attempt was made to load a program with an incorrect format.
File name: 'LibCecSharpCore, Version=6.0.2.20516, Culture=neutral, PublicKeyToken=null'
   at test_cec.Program.Main(String[] args)

I have tried several configurations taking care to target either x86 and x64 while using the appropriate dll.

I have a sample project here. Just clone and run dotnet restore, then dotnet run.

I am using dotnet core version 3.1.402.

rhyek commented 3 years ago

I just noticed this text in the release notes for 6.0.0: unified LibCecSharp and LibCecSharpCore. So I used LibCecSharp.dll and everything works as expected.

Documentation should be updated.