You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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();
The text was updated successfully, but these errors were encountered:
@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
.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
The text was updated successfully, but these errors were encountered: