How to copy to the clipboard in F#, specifically dotnet core fsi?

286 Views Asked by At

I want to set text to the clipboard in my fsi script in dotnet core.

I have used the below code from the question in the link below, which has served me well for years. How would I do the equivalent in dotnet core / dotnet 5?

open System.Windows.Forms
Clipboard.SetText("Hello from FSI!")

https://stackoverflow.com/a/1791762/3172195

I can see there is some SDK Microsoft.NET.Sdk.WindowsDesktop but for a script, I would prefer to use just a nuget package.

0

There are 0 best solutions below

Related Questions in F#