-
Notifications
You must be signed in to change notification settings - Fork 13
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
Randomly unable to debug MAUI project #1449
Comments
@emaf I wonder if this might happen when the editor doesn't have focus when I hit F5, or whatever does have focus isn't the right thing. |
@davidortinau are you using a launch json file? But I think you raised a good point, when you face this again, could you try hitting F5 from a |
No, no launch.json file is there. I'll keep an eye on what has focus when this happens next time. |
Hi, this is happening to me consistently for 2 last ours (all day today). Totally no idea how to run the MAUI project. Hitting F5 repeatedly solves nothing. I used to use launch.json, removed it completely, tried to add some tasks.json; yet result is always the same. No error visible anywhere, except this dialog. |
By the way when I hit 'Debug Anyway' it says "Error processing launch options at field: program". At this point I don't have launch.json file at all so it has to be something internal/default. |
One more thing I just found which may or may not relate to this issues - in the Extensions Host windows, there is an exception in the dotnet-maui: 2024-09-17 11:44:18.782 [error] Error: Error writing JSON RPC Message: MessagePackSerializationException: Failed to serialize System.Exception value. |
I am also seeing this issue.
|
If you restat VS Code, do you see the same error? |
@emaf Yes. Would be great to see what is the serialized exception...
|
Any news on this error? Its really frustrating :( |
We haven't been able to reproduce this yet, so we need you to answer a few questions:
|
Happens to me as well after upgrading to macOS Sequoia 15.0. I get the same error posted by @davidortinau every time I try to run our MAUI project. We have no custom launch or task profiles set up and everything was running fine before upgrading macOS. I use There is no attempt to start anything in the .NET MAUI terminal output. I immedietaly receive 'Could not find the task 'maui: Build'.' after pressing F5. Building the solution without running it still works. |
@StefanW2015 could you confirm if there is any output in the .NET MAUI output panel (not the Terminal)? |
I meant the Output panel, sorry. It's just the information that the SDKs were found after opening the project. Nothing new after trying to run / debug the app.
|
I have exactly the same status as @StefanW2015 wrote above - nothing in .NET MAUI Output panel except loaded versions. By the way all the extensions are latest (as can be downloaded): VSCode Extensions:
OS: macOS Version 15.0 (24A335) Android components:
|
All is the same for me |
This might be related to Xcode 16: xamarin/xamarin-macios#20802 (comment) |
NVM, I can repro with Xcode 15.4 as well (but I'm on Sequoia) |
I can't repro on Sonoma, but that's also a different machine, so there may be any number of other differences as well. |
Thanks @rolfbjarne for reference this issue. I'm also facing the same issue, I'm sharing my post with details here: xamarin/xamarin-macios#20802 (comment) I'm on macOS Sequoia with XCode 15.4 If there is any fix or workaround, please let us know. In addition, I'm using the .NET MAUI latest stable version at this moment 1.3.29. |
For folks that see this, can you also look in the |
This workaround seems to work for me, at least for a brand new MAUI project. Enable Hot Reload again returns the "could not find the task maui : BUILD" error. |
I can confirm that this workaround also helps for more complex projects 👍 |
Cobbling together some pieces from both this thread and xamarin/xamarin-macios#20802, these are the steps that got me working again on Mac OS Sequoia 15.0:
After following these steps, you will be able to build and debug MAUI applications, with or without a launch.json file, through VS Code on Mac OS Sequoia 15.0. |
Thanks @BretJohnson, and all who helped me to solve my issue. I can confirm the workaround you shared worked very good and I can continue debugging/developing mobile apps in .NET MAUI using:
I also went ahead and created a blog post article where I share my experience, I hope it helps others as well. Please share with us when a new update of the extension is released, so we can update it and give it a try. |
@vhugogarcia You don't need XCode 16 + XCode 15.4 (installed both side by side). Having Xcode 15.4 is enough to make it work. Installing Xcode 16 is more confusing because you will have to pay attention to the location of Command Line Tools |
Thanks @danardelean for the feedback. |
Here's a mini RCA for why the task fails in Sequoia: dotnet/announcements#324 The MAUI XAML Hot Reload extension uses a TCP Pipeline with a self-signed certificate for handling actions to and from your application and VSCode. There was an issue with Sequoia and the runtime that caused certificates in general to throw exceptions, which is what's happening here. The exception here should have been handled and logged, but the exception itself ( So the key fixes are that XAML Hot Reload should never break the build if anything within the language server process or its part of the extension fails. The actual exception being thrown is a Runtime bug and so, in this state, XAML Hot Reload could not work unless SSL was disabled (which for security reasons is undesirable to allow here) until that was fixed. There is a PR in flight for the extension for wrapping the offending code here, letting it fail, and telling you that XAML Hot Reload failed to load in the log output. Once the underlying .NET Runtime code is released, and the C# Extension is updated to use it, the underlying certificate issue should be resolved. If you want to work around this without turning off XAML Hot Reload on Sequoia, you can:
Which you can do by going into your VSCode extension settings, and searching for Save, restart VSCode, and you should now be able to deploy your MAUI app with XAML Hot Reload enabled (Or at least, it shouldn't fail to deploy now with that setting enabled.) |
I have been using this |
Any news regarding the issue of hot reload not working? BR, |
Nightly .NET builds are not signed. So you probably need to clear the Apple Quarantine on the .NET folder for it to make a clean build.
Otherwise, there's not much else you can do without both the underlying runtime fix being released, and the extension picking it up and using it. The exception not being caught issue I mentioned above is fixed in the extensions Main branch, and that should at least let the build through and deploy. I don't know when that will be published yet though, I assume whenever the next MAUI VSCode Extension preview is out. But hot reload won't work without the underlying runtime fix being published; the only other way to work around it would be to disable SSL and that would introduce security risks that I want to avoid. |
Thanks @drasticactions , working like a charm 👍 |
.NET 8.0.10 is now released, which fixes this issue. Here's the latest status:
|
@dibarbet - I added you as an assignee, as you are making the final fix for this with dotnet/vscode-csharp#7651. Thx. |
Version |
So what's the status of this? In order to use VSCode on Mac Sequoia, we need to wait for the release before upgrading XCode and/or Sequoia? |
Type: Bug
After several successfully debugging sessions I will occasionally be unable to debug after hitting F5 or the debug button. I'm presented with a modal stating "could not find the task
maui : BUILD
".If I reload the window, I can once again debug. Sometimes I can F5 repeatedly (closing the modal) and the issue also seems to resolve itself.
Extension version: 1.3.29
VS Code version: Code - Insiders 1.93.0-insider (4849ca9bdf9666755eb463db297b69e5385090e3, 2024-09-04T13:13:15.344Z)
OS version: Darwin arm64 23.6.0
Modes:
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
A/B Experiments
| VS Bug 2245110
The text was updated successfully, but these errors were encountered: