Skip to content

Generating methods.txt appears to stop writing to disk and is truncated #9693

Closed

Description

@beeradmoore

Android framework version

net9.0-android, net10-android

Affected platform version

.NET 9.0.101, .NET 10.0.302

Description

While trying to setup monitoring of startup performance of our new MAUI app I wanted to monitor JIT time of our old XF app and our new MAUI app.

While trying to generate methods.txt I am getting odd output. The end of the file appears truncated. When it isn't truncated I am unsure if it is written to disk correctly or if it is truncated at the end of a line.

From the steps below the end of my log looks like

JIT method  begin: Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutTemplatedContentRenderer:OnFlyoutViewLayoutChanging () elapsed: 1s:270::559345
JIT method   done: Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutTemplatedContentRenderer:OnFlyoutViewLayoutChanging () elapsed: 1s:270::569033
JIT method  begin: Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutTemplatedContentRenderer:UpdateFooterLayout () elapsed: 1s:270::636793
JIT method   done: Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutTemplatedContentRenderer:UpdateFooterLayout () elapsed: 1s:270::647887
JIT method  begin: Android.Runtime.JNINativeWrapper:Wrap_JniMarshal_PPLLJ_Z (_JniMarshal_PPLLJ_Z,intptr,intptr,intptr,intptr,long) elapsed: 1s:273::935960
JIT method

Here is the full log,

methods.txt

Steps to Reproduce

EDIT: Issue still occurs. Made a repro from my above steps - https://github.com/beeradmoore/maui-issue-MethodsTruncateTest

There is a powershell script (compile_run_grab_methods.ps1) that will build + deploy the app, wait 10 seconds, and then pull methods.txt.

=======

  1. Create new .NET 9 MAUI application
  2. Add android:debuggable="true" to AndroidManifest.xml
  3. Update nugets to ensure latest version of MAUI
  4. Setup debug.mono.log to be timing as per jit-timers
  5. Build, deploy, and run app in release mode (dotnet publish -t:Run -f net9.0-android)
  6. Wait about 10 seconds
  7. Get methods.txt, adb shell run-as com.companyname.mauiapp10 cat files/.__override__/arm64-v8a/methods.txt > methods.txt
  8. Edit file and observe its end

Did you find any workaround?

Nope. Deleting the file adb shell run-as com.companyname.mauiapp10 rm files/.__override__/arm64-v8a/methods.txt and re-running it will sometimes give a different line end.

Relevant log output

Activity

  1. added
    needs-triage
    on Jan 20, 2025
  2. added
    Area: Mono Runtime
    and removed
    needs-triage
    on Jan 21, 2025
  3. removed their assignment
    on Mar 26, 2026
  4. added
    possibly-stale
    on Sep 11, 2026
  5. dotnet-policy-service commented on Sep 11, 2026

    @dotnet-policy-service

    We suspect this issue is stale and no longer relevant. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.

  6. beeradmoore commented on Sep 13, 2026

    @beeradmoore
    Author

    Issue still occurs. Made a repro from my above steps - https://github.com/beeradmoore/maui-issue-MethodsTruncateTest

    There is a powershell script (compile_run_grab_methods.ps1) that will build + deploy the app, wait 10 seconds, and then pull methods.txt.

    Here is the new methods.txt. An interesting thing to note is the old/new file is not the exact same amount of bytes or the exact number of lines. (EDIT: I also changed the script to wait 60 seconds instead of 10. This pulled the same sized 1,499,136 byte file. I checked md5sum of both methods.txt and they are different so I know I did not pull the old methods.txt).

    methods.txt

  7. added
    need-attention
    and removed
    possibly-stale
    on Sep 13, 2026
  8. jonathanpeppers commented on Sep 14, 2026

    @jonathanpeppers
    Member

    I would recommend using dotnet-trace instead going forward, see some examples here:

    This methods.txt is a feature of Mono that is removed in .NET 11.

    If there is something dotnet-trace doesn't solve, let us know, thanks!

  9. beeradmoore commented on Sep 14, 2026

    @beeradmoore
    Author

    WIll do. Thanks @jonathanpeppers

  10. locked and limited conversation to collaborators on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Area: Mono Runtimeneed-attention

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions