无法在 MAUI 项目中调试 maccatalyst 目标 - 应用程序甚至无法启动

问题描述 投票:0回答:1

使用 .net 8.0.100-preview.7.23376.3 和 JetBrains Rider 2023.2.2:

JetBrains Rider 2023.2.2
Build #RD-232.9921.83, built on September 24, 2023
Licensed to Laerdal Medical AS / Kyriakos Sidiropoulos
You have a perpetual fallback license for this version.
Subscription is active until August 10, 2024.
Runtime version: 17.0.8+7-b1000.22 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.6.6
.NET Core v7.0.7 ARM64 (Server GC)
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 10
Metal Rendering is ON
Registry:
    ide.lookup.shrink=true
    ide.balloon.shadow.size=0
    vcs.empty.toolwindow.show=false
    ide.new.project.model.index.case.sensitivity=true
    database.show.search.tab=false

Non-Bundled Plugins:
    com.github.copilot (1.3.2.3479)
    com.jetbrains.rider.android (232.9921.83)
    com.intellij.ideolog (222.1.0.0)
    com.intellij.resharper.StructuredLogging (2023.2.0.305)
    git-extended-update-index (0.1.3)
    com.mallowigi (93.1.0)
    aws.toolkit (1.84-232)
    com.intellij.resharper.azure (3.50.0.1679-2023.2)

我从模板创建了一个默认的 MAUI 应用程序,我正在尝试调试它而不对其进行任何修改。该应用程序在调试模式下甚至不会启动,即使它在发布模式下启动得很好。还有其他人面临这个问题吗?任何解决方案/解决方法表示赞赏。

c# ide maui rider jetbrains-rider
1个回答
0
投票

偶然发现面临类似问题的人:

https://youtrack.jetbrains.com/issue/RIDER-79838/Cannot-debug-macccatalyst-target-in-MAUI-project

让应用程序启动+调试的解决方案本质上就是这个(如果 5 秒不够长,您可能需要增加超时):

public class Program
{
    // This is the main entry point of the application.
    static void Main(string[] args)
    {
#if DEBUG
        // silly workaround to allow debugging of macCatalyst apps
        //
        // https://youtrack.jetbrains.com/issue/RIDER-79838/Cannot-debug-maccatalyst-target-in-MAUI-project#focus=Comments-27-7970946.0-0
        Thread.Sleep(5_000);
#endif

        // if you want to use a different Application Delegate class from "AppDelegate"
        // you can specify it here.
        UIApplication.Main(args, null, typeof(AppDelegate));
    }
}

希望这可以帮助一些人节省一些时间。

© www.soinside.com 2019 - 2024. All rights reserved.