简体   繁体   中英

How to Debug a VisualStudio Mac 2022 Extension?

I've build a very simple .net6 library with a visual-studio-mac extension that adds a hello world kind of Pad.

How can I run/debug this project in a new instance of VSMac?

You have to add this ProjectTypeGuid to the project file so that the AddInMaker extension can add "Execute" to supported project features and create the execute command to run your extension.

<ProjectTypeGuids>{86F6BF2A-E449-4B3E-813B-9ACC37E5545F}</ProjectTypeGuids>

Although this allows to run your extension, it's not the correct solution for vsmac 2022. For your extension to be fully compatible with the new version of visual studio, you need to reference the new libraries (17.x). To do this include the following in your .csproj:

 <ItemGroup>
    <PackageReference Include="Microsoft.VisualStudioMac.Sdk" Version="17.0.0-preview.7955" />

    <Reference Include="Xamarin.Mac">
        <HintPath>\Applications\Visual Studio %28Preview%29.app\Contents\MonoBundle\Xamarin.Mac.dll</HintPath>
        <Private>False</Private>
    </Reference>
 </ItemGroup>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM