OpenMacroBoard / OpenMacroBoard.SDK

MIT License
20 stars 10 forks source link

Different System.Drawing.Common wersions in StreamDeckSharp and OpenMacroBoard.SDK #15

Closed patrick-dmxc closed 2 years ago

patrick-dmxc commented 2 years ago

StreamDeckSharp using 4.6.1 OpenMacroBoard.SDK 4.5.1

Please update OpenMacroBoard.SDK to 4.6.1

wischi-chr commented 2 years ago

I just checked in a new Solution and it looks like both packages resolve to 4.5.1

image

what versions of StreamDeckSharp and OpenMacroBoard.SDK are you using?

Update: Also both nuspec files currently reference 4.5.1

patrick-dmxc commented 2 years ago

But in the Project its Referenced to 4.6.1 https://github.com/OpenMacroBoard/OpenMacroBoard.SDK/blob/master/src/OpenMacroBoard.SDK/OpenMacroBoard.SDK.csproj https://github.com/OpenMacroBoard/StreamDeckSharp/blob/master/src/StreamDeckSharp/StreamDeckSharp.csproj

patrick-dmxc commented 2 years ago

We have switcht our Projects to .NET Framework 4.8 and checkt out the latest nuget-Packages, and got strange behaviour

patrick-dmxc commented 2 years ago

System.TypeInitializationException: Der Typeninitialisierer für "StreamDeckSharp.Hardware" hat eine Ausnahme verursacht. ---> System.IO.FileLoadException: Die Datei oder Assembly "System.Drawing.Common, Version=4.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" oder eine Abhängigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinition der Assembly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040) ---> System.IO.FileLoadException: Die Datei oder Assembly "System.Drawing.Common, Version=4.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" oder eine Abhängigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinition der Assembly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040) --- Ende der internen Ausnahmestapelüberwachung --- bei StreamDeckSharp.Internals.StreamDeckJpgHardwareBase..ctor(GridKeyPositionCollection keyPositions) bei StreamDeckSharp.Internals.StreamDeckRev2HardwareInfo..ctor() in D:\Code\bitOxide\OpenMacroBoard.MetaProject\src\StreamDeckSharp\src\StreamDeckSharp\Internals\StreamDeckRev2HardwareInfo.cs:Zeile 10. bei StreamDeckSharp.Hardware..cctor() in D:\Code\bitOxide\OpenMacroBoard.MetaProject\src\StreamDeckSharp\src\StreamDeckSharp\Hardware.cs:Zeile 44. --- Ende der internen Ausnahmestapelüberwachung --- bei StreamDeckSharp.Hardware.get_Internal_StreamDeck() in D:\Code\bitOxide\OpenMacroBoard.MetaProject\src\StreamDeckSharp\src\StreamDeckSharp\Hardware.cs:Zeile 40. bei StreamDeckSharp.Internals.HidDeviceExtensions.GetDeviceDetails(Int32 vendorId, Int32 productId) in D:\Code\bitOxide\OpenMacroBoard.MetaProject\src\StreamDeckSharp\src\StreamDeckSharp\Internals\HidDeviceExtensions.cs:Zeile 15. bei StreamDeckSharp.Internals.HidDeviceExtensions.GetHardwareInformation(HidDevice hid) in D:\Code\bitOxide\OpenMacroBoard.MetaProject\src\StreamDeckSharp\src\StreamDeckSharp\Internals\HidDeviceExtensions.cs:Zeile 9. bei StreamDeckSharp.Internals.DeviceListExtensions.<>cDisplayClass0_0.gMatchingHardware|0(HidDevice d) in D:\Code\bitOxide\OpenMacroBoard.MetaProject\src\StreamDeckSharp\src\StreamDeckSharp\Internals\DeviceListExtensions.cs:Zeile 21. bei StreamDeckSharp.Internals.DeviceListExtensions.<>cDisplayClass0_0.b1(HidDevice device) in D:\Code\bitOxide\OpenMacroBoard.MetaProject\src\StreamDeckSharp\src\StreamDeckSharp\Internals\DeviceListExtensions.cs:Zeile 47. bei System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() bei System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() bei System.Linq.Buffer1..ctor(IEnumerable1 source) bei System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) bei org.dmxc.lumos.StreamDeck.Program.Main(String[] args) in E:\Git-Repos\Lumos\Lumos\Plugins\StreamDeck\Program.cs:Zeile 15.

patrick-dmxc commented 2 years ago

hey^^, how is it?

wischi-chr commented 2 years ago

We have switcht our Projects to .NET Framework 4.8 and checkt out the latest nuget-Packages, and got strange behaviour

This is probably the root of the problem. I dropped the support for .net framework (mainly for versions below or equal to 4.5 - I know the readme says 4.0 but that's no longer accurate) because it was a huge hassle to maintain that and I couldn't use a lot of modern .net/C# stuff.

Maybe I find a solution to support the last .net framework version (4.8) but to be honest .net framework is slowly dying and if it's possible you should definitely switch to .net core (since version 5 now only called .NET)

I'll try to find time to look into this, but I can't promise to restore .net framework compatibility

ocdtrekkie commented 2 years ago

Anecdata but my .NET Framework app worked fine with the latest version updates. Please don't drop .NET Framework support though, there's a lot of painful crud in moving to .NET Core, with almost no real gain if you code outside of Microsoft's preferred patterns.

wischi-chr commented 2 years ago

I won't drop .net framework support as long as it's reasonably simple to keep it alive. At the moment I'm targeting netstandard2.0 if I recall correctly and don't intend to change that.

Until a few months ago I also targeted .net 4.0 (for Windows XP support) but I dropped that because I often found myself in a situation where I copied Linq extension methods from the reference source because 4.0 was missing a lot of useful stuff.

So as long as it's not too much of a hassle I will try to support 4.8 (maybe 4.7 - haven't looked into it yet)

patrick-dmxc commented 2 years ago

But in the Project its Referenced to 4.6.1 https://github.com/OpenMacroBoard/OpenMacroBoard.SDK/blob/master/src/OpenMacroBoard.SDK/OpenMacroBoard.SDK.csproj https://github.com/OpenMacroBoard/StreamDeckSharp/blob/master/src/StreamDeckSharp/StreamDeckSharp.csproj

Did you see this message? This is currently the only blocker, why its not working properly. The versions in nuspec and in the project file are different. I now have 4 pull requests open. We'll consistently go to 4.5.1 or 4.6.1

We have switcht our Projects to .NET Framework 4.8 and checkt out the latest nuget-Packages, and got strange behaviour

This is probably the root of the problem. I dropped the support for .net framework (mainly for versions below or equal to 4.5 - I know the readme says 4.0 but that's no longer accurate) because it was a huge hassle to maintain that and I couldn't use a lot of modern .net/C# stuff.

Maybe I find a solution to support the last .net framework version (4.8) but to be honest .net framework is slowly dying and if it's possible you should definitely switch to .net core (since version 5 now only called .NET)

I'll try to find time to look into this, but I can't promise to restore .net framework compatibility

We can't switch at the moment, we have started refactoring our code, but this needs time(1-3 yaers).

wischi-chr commented 2 years ago

I'm currently rewriting quite a few internals and intend to drop System.Drawing all together and switch to a cross platform image library to improve the Linux and Mac compatability. This will also fix all current issues with cross targeting .net framework / netcore / netstandard

patrick-dmxc commented 2 years ago

OK, nice to hear that. Can you say when this is roughly finished and when it arrives at NuGet, because we are still eagerly waiting for an update at NuGet

wischi-chr commented 2 years ago

v4-preview is now out and is based on ImageSharp 2 this should probably fix a hand full of cross platform issues and the version issues described here

Please let me know if it works for you.

patrick-dmxc commented 2 years ago

v4-preview works for me

patrick-dmxc commented 2 years ago

Thanks for your work