File: MauiProgram.cs

package info (click to toggle)
onnxruntime 1.21.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 333,732 kB
  • sloc: cpp: 3,153,079; python: 179,219; ansic: 109,131; asm: 37,791; cs: 34,424; perl: 13,070; java: 11,047; javascript: 6,330; pascal: 4,126; sh: 3,277; xml: 598; objc: 281; makefile: 59
file content (29 lines) | stat: -rw-r--r-- 1,249 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using Microsoft.Extensions.Logging;

namespace MauiModelTester;

public static class MauiProgram
{
    public static MauiApp CreateMauiApp()
    {
        var builder = MauiApp.CreateBuilder();
        builder.UseMauiApp<App>().ConfigureFonts(fonts =>
                                                 {
                                                     fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
                                                     fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
                                                 });

#if DEBUG
        // NOTE: Enabling this does allow Debug.WriteLine to work for debugging C# code.
        //       However it seems to kill native logging on Android using __android_log_print that ORT and
        //       onnxruntime-extensions use, at least in the emulator. Due to that, enabled if you want to debug C#
        //       code and disable to debug native code.
        //
        // Add the extension debug logger so Debug.WriteLine output shows up in the Output window when running in VS
        // builder.Logging.AddDebug();
        // System.Diagnostics.Debug.WriteLine("Debug output enabled.");
#endif

        return builder.Build();
    }
}