
To copy text to the clipboard with .NET Framework, usually you have used .NET wrapper of Windows Forms:
1System.Windows.Forms.Clipboard.SetText
However, in the new .NET world, where we want to support many operating systems, this wrapper is rather a hindrance. Thank goodness someone took the trouble and created a very nice, stable library: .NET CopyText on GitHub
1ClipboardService.SetText("Text to place in clipboard");
2string text = ClipboardService.GetText();
and even async is finally supported
1await ClipboardService.SetTextAsync("Text to place in clipboard");
2string text = await ClipboardService.GetTextAsync();
Related articles

Oct 02, 2021 - 2 min read
Bad Gateway error on App Service deployment
Our deployment ran smooth for weeks. But suddenly and without warning and only for one app, the “Bad Gateway” error appeared …

Sep 20, 2021 - 2 min read
Class vs. Struct performance in .NET
In addition to classes that represent reference types, there are also structs that represent value types. But how do the two different …

Sep 14, 2021 - 1 min read
.NET Updates September 2021
Heute hat Microsoft die .NET Updates von September 2021 auf ihrem Blogpost veröffentlicht. OS Lifecycle update: Aktualisierung der Docker …
Let's Work Together
Looking for an experienced Platform Architect or Engineer for your next project? Whether it's cloud migration, platform modernization or building new solutions from scratch - I'm here to help you succeed.
