sskodje / ScreenRecorderLib

A .NET library for screen recording in Windows, using native Microsoft Media Foundation for realtime encoding to h264 video or PNG images.
MIT License
414 stars 94 forks source link

Can not install this nuget package for WinForm project target .net 8.0 X64 CPU #294

Closed zydjohnHotmail closed 6 months ago

zydjohnHotmail commented 6 months ago

Hi, I want to test this repo, I created one WinForms project, and install the nuget package, I set target to .net 8.0 on Windows for x64 CPU, but I got this compiler error: Error: ScreenRecorderLib does not work correctly on 'AnyCPU' platform. You need to specify platform (x86, Win32 or x64).
ScreenRecorderLibForm C:\Users.nuget\packages\screenrecorderlib\6.0.0\build\ScreenRecorderLib.targets Since .net 8.0 is out for nearly half year, and it is in long term support, please can you change something, so this library will work for .net 8.0? My OS: Windows 10 (22H2) IDE: Visual Studio 2022 (Version 17.9.6) (64-bit) C# version: 12.0 Thanks,

sskodje commented 6 months ago

I've tested it to run on .net 8. The error probably means the project is configured to run as "any cpu", which does not easily work due to limitations with C++ and .net. Check your solutions configuration manager.