简体   繁体   English

如何调试 VisualStudio Mac 2022 扩展?

[英]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.我已经构建了一个非常简单的 .net6 库,它带有一个 visual-studio-mac 扩展,它添加了一个 hello world 类型的 Pad。

How can I run/debug this project in a new instance of VSMac?如何在新的 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.您必须将此 ProjectTypeGuid 添加到项目文件中,以便 AddInMaker 扩展可以将“执行”添加到支持的项目功能并创建执行命令来运行您的扩展。

<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).尽管这允许运行您的扩展程序,但它不是 vsmac 2022 的正确解决方案。要使您的扩展程序与新版本的 Visual Studio 完全兼容,您需要引用新库 (17.x)。 To do this include the following in your .csproj:为此,请在 .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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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