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

DataObject contains wrong data for file drop under .Net 9 RC1 #12190

Open
IrinaPykhova opened this issue Sep 20, 2024 · 0 comments
Open

DataObject contains wrong data for file drop under .Net 9 RC1 #12190

IrinaPykhova opened this issue Sep 20, 2024 · 0 comments
Assignees
Labels
💥 regression-preview Regression from a preview release untriaged The team needs to look at this issue in the next triage
Milestone

Comments

@IrinaPykhova
Copy link

IrinaPykhova commented Sep 20, 2024

.NET version

.Net 9 RC1

Did it work in .NET Framework?

Yes

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

it worked correctly in .Net 8, here is what I expect to see:
image

Issue description

at file drop action DataObject.GetDataPresent method returns wrong value, so, we can't rely on it any more. Here is what I see in debugger:
image
You see, it shows single data format Shell IdList Array, but at the same time GetDataPresent return true for any existent or not existent formats I ask

Steps to reproduce

Create Windows Forms application, set Form AllowDrop property to true and add handler for Form.DragOver event, something like this:

private void Form1_DragOver(object sender, DragEventArgs e)
{
    if (e.Data.GetDataPresent(typeof(C1.Schedule.Appointment)))
    {
        C1.Schedule.Appointment app;
        app = (C1.Schedule.Appointment)e.Data.GetData(typeof(C1.Schedule.Appointment));
        app.Subject = "my test dragged appointment";
    }
}

You can check for any types which are present in your application instead of Appointment type in this snippet.
Run application, select any file in FileExplorer and drag it over the form. You can set breakpoint in debugger and play with VS Watch window to explore DataObject content. Under .Net 9 you can't see any more that it was a file and you get all wrong information about presented Data.

@IrinaPykhova IrinaPykhova added the untriaged The team needs to look at this issue in the next triage label Sep 20, 2024
@IrinaPykhova IrinaPykhova changed the title DataObject.GetDataPresent always returns true regardless of actual data under .Net 9 RC1 DataObject contains wrong data for file drop under .Net 9 RC1 Sep 20, 2024
@JeremyKuhne JeremyKuhne added the 💥 regression-preview Regression from a preview release label Sep 20, 2024
@JeremyKuhne JeremyKuhne added this to the 9.0 RTM milestone Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💥 regression-preview Regression from a preview release untriaged The team needs to look at this issue in the next triage
Projects
None yet
Development

No branches or pull requests

3 participants