-
Notifications
You must be signed in to change notification settings - Fork 1k
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
.NET 7.0 preview DragEnter bug after update to latest versions. #7518
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
WinForms related issue belongs to https://github.com/dotnet/winforms repo. Can you provide detailed exception stack trace of the exception, for where it's thrown, WinForm-specific code or the runtime COM interop? |
@huoyaoyuan problem is that it's not possible to debug in ComInterfaceDispatch... The debugger hangs. |
Here is some more, activated unmanaged debug, exception thrown at last line but can't see GUIDS flags.
|
It's in WinFormsComWrappers.cs, for the case: drag a single file from Desktop to WinForm or in my case a UserControl class. |
@kant2002, can you take a quick look to see if your latest changes in anyway causing this? |
I think issue was introduced in #6976 |
@kant2002 Yes, this seems to be the same problem. But there is something more. Since an earlier NET7 version (3 or so) something is wrong with COM refcounts. So it's easy to reproduce with the app: |
@kant2002 Not really important because the exception is handled but maybe as hint: |
@kant2002 and one more hint to reproduce:
|
@merriemcgaw hi, the fastest way is really with Test.exe from the Project
|
@Olina-Zhang Yes, but that's exactly the problem - the bug in the latest .NET 7.0 preview. |
@Olina-Zhang |
@c-ohle we also created a simple repro project about drag-dropping image on pictureBox in Winforms from file explorer, the DragEnter event cannot be triggered in the latest .Net 7.0, can't repro in .Net 6.0. So it is the same issue in here. |
@Olina-Zhang good work, now it should be easy for them to reproduce and to add the missing COM interface request.
The other issue is some versions older and deeper in the system and can not reproduce with a "drop target only app". |
@Olina-Zhang when I switch back to .Net 6.0. it works. Maybe you forgot a rebuild or something? |
yes, this issue cannot repro in Net 6.0, you can see my previous comment. When switch app to .Net 6.0, that DragEnter event can be triggered, I set a breakpoint in that app. |
@Olina-Zhang with my app too? This could also be a SDK version(s) conflict - it would not be the first time. |
@Olina-Zhang sorry, yes you said, I misunderstood earlier and focussed on this. |
Fixes dotnet#7518 Eventually I should improve dotnet#7519 but until then, this is safer approach IMO. cc @Olina-Zhang @dreddy-work @RussKie
Verified on .NET 8.0 latest build from main branch: NET 8.0.100-alpha.1.22451.15, issue was fixed, test result is same as above screenshot. |
Description
When trying to drag and drop files from folders or other sources into a Windows.Forms.Controls:
NotImplementedException in IDropTargetVtbl.cs
VS2022 preview, .NET 7.0 preview, SDK, all latest versions.
It works compiled for .NET 6.0, it worked for all .NET 7.0 previews before.
Example project is available at GitHub
Reproduction Steps
Should be easy to reproduce:
VS2022 - New Project - Windows Forms App - .NET 7.0 preview
Form1 - AllowDrop = true; - override OnDragEnter
on file drop -> exception
Expected behavior
Should work or message/exception if there is a security problem or what ever.
Actual behavior
NotImplementedException
Regression?
No response
Known Workarounds
no
Configuration
Processor: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz (2112 MHz) × 8
System: Microsoft Windows 10.0.22622 X64 Runtime: .NET 7.0.0-preview.6.22324.4 X64
BigRational: 1.0.0.5 Runtime: v4.0.30319 .NETCoreApp,Version=v7.0
For Test project on: GitHub sample
Other information
No response
The text was updated successfully, but these errors were encountered: