JaneySprings / DotNet.Meteor

A VSCode extension that can run and debug .NET apps (Xamarin, MAUI, Avalonia)
https://marketplace.visualstudio.com/items?itemName=nromanov.dotnet-meteor
MIT License
269 stars 10 forks source link

TargetFramework net7.0-maccatalyst on macOS 13.1 (M1 pro) not working #35

Closed kzhui125 closed 1 year ago

kzhui125 commented 1 year ago

if I add maccatalyst-arm64 RuntimeIdentifier, the app can't start(seems maui problem).

  <PropertyGroup Condition="'$(TargetFramework)' == 'net7.0-maccatalyst'">
      <RuntimeIdentifier>maccatalyst-arm64</RuntimeIdentifier>
  </PropertyGroup>

So how can I debug net7.0-maccatalyst(intel) app?

thanks.

JaneySprings commented 1 year ago

Hello! Thank you for your question. If you have Mac with Apple chip you don't need to specify the RuntimeIdentifier property in the csproj file. .NET Meteor automatically adds the desired RuntimeIdentifier depending on the architecture of your Mac. You can see this in the vscode terminal

image

If you want to build the application for Intel architecture on Mac with Apple chip, you can customize the build task. See predefined task customization.

You can create the tasks.json file with the following content:

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "dotnet-meteor.task",
            "target": "Build",
            "args": [
                "-p:RuntimeIdentifier=maccatalyst-x64"
            ],
            "problemMatcher": [],
            "label": "Build MAUI for Mac (Intel)",
        }
    ]
}

and run it

image

But in this case, you will not be able to launch the application, since .NET Meteor will search for it in the maccatalyst-arm64 folder. Maybe I should add the ability to run Intel applications for Mac with Apple chip.

kzhui125 commented 1 year ago

thanks @JaneySprings for your help I can debug now.

But it seems I can only debug cs file, I can't debug razor file. and why is there two startDate in watch...

image

2023-02-11.gif.zip

Thanks for your help.

JaneySprings commented 1 year ago

I think the Mono Debugger can't resolve breakpoints inside .razor files. I will try to research this issue.

JaneySprings commented 1 year ago

Wow. I added '.razor' files to the Mono 'whitelist' and the breakpoints was resolved

image

I will release an update soon and add support for Blazor

kzhui125 commented 1 year ago

Great! Thanks a lot.

JaneySprings commented 1 year ago

Fixed in https://github.com/JaneySprings/DotNet.Meteor/commit/aad53c5369bc2b34e0939148ebdee7f5f8af62d2