Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clipboard behaves different between net8 and net9 #12665

Open
InlineAsm opened this issue Dec 20, 2024 · 1 comment
Open

Clipboard behaves different between net8 and net9 #12665

InlineAsm opened this issue Dec 20, 2024 · 1 comment
Assignees
Labels
💥 regression-release Regression from a public release

Comments

@InlineAsm
Copy link

.NET version

net9.0-windows

Did it work in .NET Framework?

Yes

Did it work in any of the earlier releases of .NET Core or .NET 5+?

It does work on net8.0

Issue description

The Clipboard method ContainsText returns false when a string is placed on the clipboard using SetDataObject. In previous versions of the runtime this method would return true.

Steps to reproduce

The following code returns true on net8.0 and returns false on net9.0

Clipboard.SetDataObject("TEXT");
var containsText = Clipboard.ContainsText();
@InlineAsm InlineAsm added the untriaged The team needs to look at this issue in the next triage label Dec 20, 2024
@Tanya-Solyanik Tanya-Solyanik added 💥 regression-release Regression from a public release and removed untriaged The team needs to look at this issue in the next triage labels Dec 20, 2024
@lonitra lonitra self-assigned this Dec 20, 2024
@lonitra
Copy link
Member

lonitra commented Dec 20, 2024

@LeafShi1 could your team take an initial look? My initial thought is perhaps we had accidentally changed something in Clipboard.ContainsText between .NET 8/9 - perhaps some sort of typo.

The codepath for Clipboard.ContainsText should eventually call IDataObject.GetDataPresent, which should go to our DataStore.GetDataPresent. where it should check to see if the format is there - though it is possible on .NET 8 that this goes to a different implementation we have of IDataObject.GetDataPresent. We should compare what the difference is between the codepath for .NET 8/9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💥 regression-release Regression from a public release
Projects
None yet
Development

No branches or pull requests

4 participants