Willy-Kimura / SharpClipboard

A library for anonymously monitoring clipboard entries.
182 stars 34 forks source link

Can't compile project on Linux (non-Windows) with this library added. #32

Open RokeJulianLockhart opened 1 year ago

RokeJulianLockhart commented 1 year ago

From the terminal:

```log Executing task: dotnet build /home/rokejulianlockhart/git_repositories/RTBJK9/20230616T120719+0000 entities/20230616T115744+0000 Beedell.RokeJulianLockhart/20230616T115630+0000 technical/20230626T122241+0000 code/projects/clipboard_manager/clipboard_manager.csproj /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary MSBuild version 17.6.3+07e294721 for .NET Determining projects to restore... All projects are up-to-date for restore. /usr/share/dotnet/sdk/7.0.305/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.DefaultItems.Shared.targets(250,5): error NETSDK1136: The target platform must be set to Windows (usually by including '-windows' in the TargetFramework property) when using Windows Forms or WPF, or referencing projects or packages that do so. [/home/rokejulianlockhart/git_repositories/RTBJK9/20230616T120719+0000 entities/20230616T115744+0000 Beedell.RokeJulianLockhart/20230616T115630+0000 technical/20230626T122241+0000 code/projects/clipboard_manager/clipboard_manager.csproj] * The terminal process "dotnet 'build', '/home/rokejulianlockhart/git_repositories/RTBJK9/20230616T120719+0000 entities/20230616T115744+0000 Beedell.RokeJulianLockhart/20230616T115630+0000 technical/20230626T122241+0000 code/projects/clipboard_manager/clipboard_manager.csproj', '/property:GenerateFullPaths=true', '/consoleloggerparameters:NoSummary'" terminated with exit code: 1. * Terminal will be reused by tasks, press any key to close it. ```

This is the project (for reproduction).

Willy-Kimura commented 10 months ago

A large part of the library depends on the Windows SDK therefore porting it to Linux this would be natively impossible. You can however try out porting the project to Mono and switch across the different OSes (Mac, Win, Linux) implementing a wrapper class that replicates the standard clipboard watch behavior as observed on Windows. Could be a possible future add.

RokeJulianLockhart commented 10 months ago

https://github.com/Willy-Kimura/SharpClipboard/issues/32#issuecomment-1710841454

@Willy-Kimura, I didn't realize Mono still had any use – I thought that when .NET Core was released, it was entirely cross-platform. Am I totally wrong?

Willy-Kimura commented 10 months ago

Apparently not. Microsoft appears to have had an entirely different strategy from what we had in mind. WinForms support in other OS platforms won't be happening anytime now or in future. Migration for WinForms to dotnetcore and now .Net 6/7/8 was predicated along the lines of providing long term support for WinForms apps, performance improvements, better tooling support and other niceties. Our best bet would be finding other alternatives outside of WinForms/WPF if we need to tailor the library to work on Linux and Mac.

Salmakis commented 4 weeks ago

just as info: eto got a working cross plattform clipboard