-
Notifications
You must be signed in to change notification settings - Fork 743
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
"Ensure Event Failed" when generating event handler with "New Event Handler" option #1348
Comments
Howdy @riandika-lumaris, this sounds like a bug in visual studio for windows. Can you please reproduce the problem and use the menus within Visual Studio to report it to Microsoft? ps. Out of interest are you using a shared project? |
I don't think it is a bug from VS because the option works perfectly with pure UWP Solution. And yes, there is a shared project because I use the uno extension to create the solution. |
The "New Event Handler" functionality comes from VSWIN, I've got a hunch that you'd be able to reproduce this with a pure UWP solution that uses shared projects. So many things are changing under the hood of VSWIN at the moment. Typically, I'm raising 1 to 3 new feedback items every week. Uno has a meta ticket open at #982, when you raise your feedback item can you please comment on it? Cheers. |
Howdy @riandika-lumaris. I experienced this today and can confirm that it isn't a problem with Uno, it's a defect in vswin and shared projects. "Ensure Event Failed" appears when generating a new event handler on UWP when using Shared Projects. It does not happen when using a UWP class library. Have opened https://developercommunity.visualstudio.com/content/problem/690015/uwp-ensure-event-failed-when-creating-new-event-ha.html. Could you drop on by and give it a 👍? Cheers.
|
is there any way to add event to controls from xaml? |
@realivanjx it depends on the version of visual studio, but recent ones, (e.g. VS 16.5 preview) seems to improve the situation. |
It still exist in vs2019 16.5 |
@jeromelaban This issue still exists in VS 2019 16.6. This is an incredibly annoying bug, and the issue over on Developer Community was closed just over a year ago with no solution or workaround. |
I started working with UNO today and ran into the same problem. Is there a workaround or do I need to write the handlers manually? |
@ElyasMTarek for now, no. There isn't a fix for this, though you can use the |
@jeromelaban Thanks for the advice. Hope this will get fixed in near future tho. |
I have the same problem, any updates to this? |
Please fix this. It is really annoying. |
This problem is unfortunately caused by Visual Studio, please help us by sending feedback there and upvoting the linked issue in WinUI. |
This is fixed in our latest 4.7 templates, using .NET 7 and WinAppSDK, |
Current behavior
When editing XAML file in VS 2019, generating event handler with "New Event Handler" options works for the first time, then it shows "Ensure Event Failed" after that. I need to close and reopen the xaml as the workaround.
Expected behavior
The options should work without "Ensure Event Failed" error.
How to reproduce it (as minimally and precisely as possible)
Environment
Nuget Package:
Package Version(s): 1.45.0
Affected platform(s):
Visual Studio
Relevant plugins
Anything else we need to know?
The text was updated successfully, but these errors were encountered: