maui
maui copied to clipboard
Windows Machine MAUI Drop Event from an external source causes Exception
This issue has been moved from a ticket on Developer Community.
There are actually 2 problems.
- When Dragging a from an external source (such as File Explorer) DragOver arguments (DragEventArgs) contain no data.
- When Dropping from an external source (such as File Explorer) causes "Unhandled Exception" in App.g.i.cs
public void InitializeComponent()
{
if (_contentLoaded)
return;
_contentLoaded = true;
global::System.Uri resourceLocator = new global::System.Uri("ms-appx:///Platforms/Windows/App.xaml");
global::Microsoft.UI.Xaml.Application.LoadComponent(this, resourceLocator);
#if DEBUG && !DISABLE_XAML_GENERATED_BINDING_DEBUG_OUTPUT
DebugSettings.BindingFailed += (sender, args) =>
{
global::System.Diagnostics.Debug.WriteLine(args.Message);
};
#endif
**Here:
#if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
UnhandledException += (sender, e) =>
{
if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break();
};
#endif
}**
Original Comments
Feedback Bot on 12/27/2022, 06:15 PM:
(private comment, text removed)
YanFang Wang (CSI Interfusion Inc) [MSFT] on 12/29/2022, 03:16 AM:
(private comment, text removed)
Feedback Bot on 1/10/2023, 08:38 PM:
(private comment, text removed)
Original Solutions
(no solutions)
As user didn’t provide details repro information, and I reply to user confirm the repro steps, but we haven't received a reply from the user. I just guess the scenario that as user’s described. User’s feedback repro on 17.4.3
Repro Steps:
-
Create new MAUI project base on .NET 7.0.
-
Add the code into MainPage.xaml
<Editor>
<Editor.GestureRecognizers>
<DropGestureRecognizer AllowDrop=“True” Drop=“DropGestureRecognizer_Drop_1”></DropGestureRecognizer>
</Editor.GestureRecognizers>
</Editor>
- Meanwhile the following code is added into MainPage.xaml.cs file.
private void DropGestureRecognizer_Drop_1(object sender, DropEventArgs e)
{
}
-
Target use the default option “Windows Machine” Build and debug the app.
-
After the app is deployed to Windows Machine, drag some text to the editor part of the window, exception occurred. Please refers to the screenshot:
@v-yanfw thanks for the additional information. Would you be able to share the repro?
Hi @vsfeedback. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
@v-yanfw thanks for the additional information. Would you be able to share the repro?
This is feedback from VS user. There is no need to provide a repo. Follow the repro steps I wrote just to reproduce the user's feedback.
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
Could this be the same as https://github.com/dotnet/maui/issues/6080?
I have the same problem as everyone else on this thread. The possibility to drag and drop a file needs to be fixed and not put in the backlog if you want the community to use MAUI for desktop development..
@drasticactions - looks closely related. Fundamental issue with drag & drop from other app.
I agree with other posters, the desktop app support is shocking, basic functionality is being put onto the backlog. I have an app live on windows that I can’t release on Mac because MAUI just doesn’t work.
Hi @vsfeedback. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.
You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
Verified this issue with Visual Studio Enterprise 17.7.0 Preview 3.0(net8). Not repro on Windows platform with mentioned repro steps.