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
Clipboard.SetDataObject method doesn't place a custom DataObject into the clipboard.
Reproduction Steps
Create a .NET Framework WinForms (or WPF) project.
Create a custom DataObject class descendant:
public class SomeDataObject : DataObject {
public static string Format = "SomeDataObjectId";
public override string[] GetFormats() {
return new string[] { Format };
}
}
Call the Clipboard.SetDataObject(new SomeDataObject()); method to add the SomeDataObject's class instance into the clipboard.
Expected behavior
SomeDataObject is added into the clipboard
And Clipboard.GetDataObject().GetDataPresent(SomeDataObject.Format) is true
Actual behavior
The clipboard doesn't contain the SomeDataObject instance
And Clipboard.GetDataObject().GetDataPresent(SomeDataObject.Format) is false
Regression?
Yes, in .NET 8 everything works.
Known Workarounds
No response
Impact
No response
Configuration
$ dotnet --info
.NET SDK:
Version: 9.0.100-rc.2.24474.11
Commit: 315e1305db
Workload version: 9.0.100-manifests.4872d5d5
MSBuild version: 17.12.0-preview-24473-03+fea15fbd1
Runtime Environment:
OS Name: Windows
OS Version: 10.0.22631
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.100-rc.2.24474.11\
Host:
Version: 9.0.0-rc.2.24473.5
Architecture: x64
Commit: 990ebf52fc
.NET SDKs installed:
9.0.100-rc.2.24474.11 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 9.0.0-rc.2.24474.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 9.0.0-rc.2.24473.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 9.0.0-rc.2.24474.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other information
No response
The text was updated successfully, but these errors were encountered:
Description
Clipboard.SetDataObject
method doesn't place a custom DataObject into the clipboard.Reproduction Steps
Clipboard.SetDataObject(new SomeDataObject());
method to add the SomeDataObject's class instance into the clipboard.Expected behavior
SomeDataObject is added into the clipboard
And
Clipboard.GetDataObject().GetDataPresent(SomeDataObject.Format)
is trueActual behavior
The clipboard doesn't contain the SomeDataObject instance
And
Clipboard.GetDataObject().GetDataPresent(SomeDataObject.Format)
is falseRegression?
Yes, in .NET 8 everything works.
Known Workarounds
No response
Impact
No response
Configuration
Other information
No response
The text was updated successfully, but these errors were encountered: