0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

.net 6 のコンソールアプリでクリップボードが操作できなくなった件と対処法

Posted at

忘れないように自分用メモ

起きた事象

久々に.net 6 でクリップボード操作するコンソールアプリを作ろうとしたら、
そんなクラスなんてねーよって言われた
image.png
image.png

解決策

ここに解決策があった
https://techcommunity.microsoft.com/t5/app-development/clipboard-class-in-net-6/m-p/3034107

①プロジェクト右クリックして、プロジェクトファイルの編集 を選択
image.png
②'TargetFramework' を net6.0 から net6.0-windows に変更
<UseWindowsForms>true</UseWindowsForms> を追加
image.png

なぜ使えなくなった?

ちょろっと調べただけだとよくわからなかった。
.net core で OS依存性を排除しようとした流れでは無いかと推測してる。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?