Open nsood9 opened 1 month ago
@nsood9 Does this happen with a specific platform (i.e., iOS) and with physical devices or simulators?
Could you attach a sample project where we can reproduce this?
Also experiencing this. Happens when I try to debug a physical device. First run works, although no breakpoints are hit! :/
Second run onwards crashes with the same messages as @nsood9 mentioned
I did not test with a blank MAUI project, because for the deployment to a physical device I'd need new certificates, provisioning profiles ApplicationId, etc... tons of stuff that would block me for another day...
Environment:
macOS: Sonoma 14.5
dotnet --version: 9.0.100-rc.2.24474.11
maui-ios workload : 9.0.0-rc.2.24503/9.0.100-rc2
C# Dev Kit extension: v1.12.16
C# Extension: v2.50.27
.Net Maui Extension: v1.4.36
The actual Maui version we use in our app is: 8.0.90
The target iPad has iOS 17.7
Installed Xcode on mac is 16.0
Please help me. Coming back to iOS-development after a week only to find debugging broken is a pretty catastrophic experience.
I did not test with a blank MAUI project, because for the deployment to a physical device I'd need new certificates, provisioning profiles ApplicationId, etc... tons of stuff that would block me for another day...
You could re-use the same bundle identifier as in your main app, that way you can also use the same certificates, etc (remember to uninstall the app first manually from the device though).
I did not test with a blank MAUI project, because for the deployment to a physical device I'd need new certificates, provisioning profiles ApplicationId, etc... tons of stuff that would block me for another day...
You could re-use the same bundle identifier as in your main app, that way you can also use the same certificates, etc (remember to uninstall the app first manually from the device though).
That is a great suggestion! And so simple that I honestly feel embarassed to not have thought of that myself π
I did that and... it works with a blank MAUI project. No crash on subsequent startups, all breakpoints are hit... it works as expected.
But where does that leave me? My main app still crashes on subsequent startup and the output gives me no hint of what the cause might be. I'm using around 20 NuGet packages, some handler modifications in MauiProgram.cs and lots of other stuff that a vanilla project doesn't have of course... Do I have to play whack-a-mole with all of these again or is there a simpler/faster approach to find the root cause?
@DDHSchmidt there are a few ways to gather some information (some may not be present, depending on exactly what's happening):
Also a few questions:
I was about to retest today when the .Net Maui extension auto-upated to version v1.5.12
and magically it works again.
Sorry, but unfortunately debugging now works again.
But the whole toolchain is so fragile. I'll probably open a new issue soon... this one however: Not relevant for me anymore.
@nsood9 could you try the latest version of the .NET MAUI extension (v1.5.12)? If you still face this issue, could you share the information mentioned in https://github.com/microsoft/vscode-dotnettools/issues/1521#issuecomment-2422729885?
I'm using VSC Version: 1.94.2 (Universal) and now it's not even debugging the app after it has been installed on the device once. It works just for the first time and then it never launches again for consecutive runs. I have to first uninstall it every time to reinstall and relaunch it.
@emaf, the 'needs-more-info' label has been removed upon receiving further response from the original bug filer.
Also having this issue on windows
.NET MAUI vscode extension version: v1.5.19 (pre-release)
C# Dev Kit vscode extension version: v1.12.37 (pre-release)
C# vscode extension version: v2.50.27
dotnet --version 8.0.204
dotnet workload list output
Installed Workload Id Manifest Version Installation Source
--------------------------------------------------------------------
android 34.0.143/8.0.100 SDK 8.0.200
maui 8.0.82/8.0.100 SDK 8.0.200
maui-android 8.0.82/8.0.100 SDK 8.0.200
.Net Maui vscode Output
ANDROID ENVIRONMENT STATUS: 11/2/2024, 11:36:29 AM
Here is the status of your Android development environment:
Required components:
β Java SDK - INSTALLED (version '17.0.6')
- Path: 'C:\Program Files\Java\jdk-17' (Workload)
- Recommended detected locations:
- 'c:\program files\common files\oracle\java' (PATH)
β Android SDK - INSTALLED
- Path: 'C:\Users\<user>\AppData\Local\Android\sdk' (VSCode settings)
β platforms/android-34 - INSTALLED (version '3')
β build-tools/34.0.0 - INSTALLED (version '34.0.0')
β platform-tools - INSTALLED (version '35.0.2')
β cmdline-tools/11.0 - INSTALLED (version '11.0')
Optional components:
β Android Virtual Device (AVD) - COMPLETE
- AVD Path: 'C:\Users\<user>\.android\avd'
- AVD devices - DETECTED ('Pixel8API35')
β emulator - INSTALLED (version '35.2.10')
β system-images/android-34/google_apis/x86_64 - INSTALLED (version '14')
β system-images/android-35/google_apis_playstore/x86_64 - INSTALLED (version '8')
IMPORTANT:
@nsood9 the version you should ensure to update is the .NET MAUI version, not the VS Code version. As mentioned above, please install .NET MAUI 1.5.12 or 1.5.19. Then, please make sure to also have C# DevKit 1.12.37 and C# 2.54.20. These versions are for the extensions that allows you to build and debug .NET and MAUI applications in VS Code, so please try with it. Also, the platform you are using is iOS or Android? I don't see that specified in the bug description. Also, if you can share the information that was requested before, it would be helful. Thanks for your help.
@baebranch can you give us more information about your issue? I assume it's when trying to debug an Android application in Windows. Are you trying with a new .MAUI app or another app? Is there any difference between both cases? Are you trying with emulator or physical device? Any other information or log/output you might provide would be helpful. Thanks.
@baebranch can you give us more information about your issue? I assume it's when trying to debug an Android application in Windows. Are you trying with a new .MAUI app or another app? Is there any difference between both cases? Are you trying with emulator or physical device? Any other information or log/output you might provide would be helpful. Thanks.
I'm targeting the android platform on windows with a new .NET MAUI app. There is no difference between the case, both emulator and physical device have the same issue. I also updated the to the latest pre-release versions of the extensions and the problem persists.
@baebranch let's keep following up in the linked bug you started. Looks like this issue is a bit different and potentially with a different platform, so let's @nsood9 get back with the requested information while we follow up specifically on your linked issue
Describe the Issue
I'm able to run my MAUI app only once using Visual Studio Code, but it just keep crashing after getting stuck for sometime on the splash screen. This is what I get in the debug window:
The program 'TestApp.dll' has exited with code 0 (0x0).
It was working absolutely fine with VS mac. If I uninstall the app and do a fresh run it will start the app but if I'm re-running the app without uninstalling it manually, it just stuck on splash for few seconds and then crashes with the above mentioned error. I'm not even getting what exactly is the issue because there's no exception details or stack trace given apart from this:
The program 'TestApp.dll' has exited with code 0 (0x0).
Steps To Reproduce
If the app is not already installed on the device then only it runs as expected otherwise just keep crashing. So, every time I want to debug the app I have to uninstall it manually from the device before installing it.
Expected Behavior
It should run/debug smoothly every time without any issue or crash.
Environment Information
VS Code : Version: 1.94.1 (Universal)