Creating Visual Studio for Mac Extensions: A Complete Guide
Tags: webdev, productivity, mac, visualstudio
Published: 2020-12-13 03:58:52

---
title: Creating Visual Studio for Mac Extensions: A Complete Guide
published: true
date: 2020-12-10 09:57:06 UTC
tags: webdev, productivity, mac, visualstudio
canonical_url: https://www.syncfusion.com/blogs/post/creating-visual-studio-for-mac-extensions-a-complete-guide.aspx
cover_image: https://www.syncfusion.com/blogs/wp-content/uploads/2020/12/Creating-Visual-Studio-for-Mac-Extensions-A-Complete-Guide-672x372.png
---

Extensions are an indispensable part of project development. They play a vital role in improving developer productivity by providing customization, easing development, and much more.

[Visual Studio for Mac extensions](https://docs.microsoft.com/en-us/visualstudio/mac/extending-visual-studio-mac?view=vsmac-2019) are add-ons that enhance productivity and allow you to customize your project by adding new features or integrating existing tools into it. These extensions can customize both existing and new projects by adding files, new dialogs, menus, commands, and so on.

This blog post explains the procedure to create extensions for Visual Studio for Mac that can be configured to create a Visual Studio for Mac project template and extensions menu.

## Prerequisites

- [Visual Studio for Mac](https://visualstudio.microsoft.com/vs/mac/)
- [AddinMaker extension package](https://github.com/mhutch/MonoDevelop.AddinMaker)

## Create IDE Extension project using AddinMaker

1. Open Visual Studio for Mac.
2. To install the AddinMaker extension package, from the Visual Studio menu, Choose **Extensions…****.  
 ![Choose Extensions….](https://www.syncfusion.com/blogs/wp-content/uploads/2020/12/Choose-Extensions%E2%80%A6..png)**  
3. In the Extension Manger window, navigate to the **Gallery** tab and type **Addin Maker** into the top-right search bar. Select **Addin Maker** from the Addin Development category and click **Install****.  
 ![Navigate to the Gallery tab and type Addin Maker into the top-right search bar. Then, select Addin Maker.](https://www.syncfusion.com/blogs/wp-content/uploads/2020/12/Navigate-to-the-Gallery-tab-and-type-Addin-Maker-into-the-top-right-search-bar.-Then-select-Addin-Maker..png)**  
4. Now, AddinMaker is installed, and you can start building your own extension project. Let’s start by creating a new solution.
5. From the **n**** ew **** p ****roject**  **c**** reation **** dialog **, choose** Other > IDE Extensions > General > IDE Extension > C# **and click** Next**.  
 ![choose Other > IDE Extensions > General > IDE Extension > C# and click Next.](https://www.syncfusion.com/blogs/wp-content/uploads/2020/12/choose-Other-IDE-Extension-General-IDE-Extension-C.-Click-Next..png)
6. Name the project, choose the destination path of the project, and click **Create**. Visual Studio for Mac will populate the created project. Here we are going to create a Xamarin IDE extension project.  
 ![Solution explorer window showing the created project](https://www.syncfusion.com/blogs/wp-content/uploads/2020/12/Solution-explorer-window-showing-the-created-project.png)

## Update the extension details

1. Create the extension project template configuration file by right-clicking on the project and choosing **Add > New File > File Template** and name the file. Then, click the **New** button **.** The file will be added in your project.  
 ![Right-click on the project and choose Add > New File > File Template and name the file](https://www.syncfusion.com/blogs/wp-content/uploads/2020/12/Right-clicking-on-the-project-and-choosing-Add-New-File-and-File-Template-and-then-name-the-file..png)
2. The created template configuration file will be added as {GivenFileName.xft.xml}. Now, change the file extension type as xpt.xml from xft.xml {GivenFileName.xpt.xml}.
3. In the template configuration file, update the name, category, language name, default file name, icon, description, and parameter details within the tag in the template configuration section.Refer to the following code.
```html
<TemplateConfiguration>
        <_Name>Name of the Template</_Name>
        <Category>Category</Category>
        <LanguageName>Language Name</LanguageName>
        <DefaultFileName>Default File Name</DefaultFileName>
        <Icon>Icon of the template </Icon>
        <Image file="image file location" />
        <_Description>Description of template</_Description>
        <DefaultParameters>Parameter Details</DefaultParameters>
</TemplateConfiguration>
```

## Configure the template configuration file

Now, configure the template configuration file in the **Manifest.addin.xml** file as seen in the following screenshot.  
 ![Configure the template configuration file in the Manifest.addin.xml file](https://www.syncfusion.com/blogs/wp-content/uploads/2020/12/Configure-the-template-configuration-file-in-the-Manifest.addin_.xml-file.png)

## Configure the project and add files in the template configuration file

Configure the project section in the template configuration file as shown in the following screenshot.  
 ![Configure the project section in the template configuration file](https://www.syncfusion.com/blogs/wp-content/uploads/2020/12/Configure-the-project-section-in-the-template-configuration-file.png)

1. Here, ${ProjectName} was replaced by the name mentioned in the project creation dialog.
2. Add the reference by using the Reference tag. If you want to refer to an assembly, then provide the type as GAC. If you are referring to another project, then give the type as **project** and mention the project name in the **refto** attribute.
3. To add the file in the **directory** , add the file tag between the **directory tags**. If you want to add the file in the **project directory** , add the file tag between the **File tags**.

## Include the template files in the extension addin

Now, include the file path in the **I**** mport **tag between the** Runtime** tags in the ManiFestaddin.xml file, as seen in the following screenshot.  
 ![Include the file path in the Import tag between the Runtime tags in the ManiFestaddin.xml file](https://www.syncfusion.com/blogs/wp-content/uploads/2020/12/Include-the-file-path-in-the-Import-tag-between-the-Runtime-tags-in-the-ManiFestaddin.xml-file.png)

## Customize the project template from the extension menu

You can customize the project template from the extension menu. To do so, follow these steps:

1. Add a new class file and make the following content in the file content.
2. In the **Run** method, provide the Name that you mentioned in the template configuration XML file in the bracket.Refer to the following screenshot.  
 ![In the Run method, provide the Name that you mentioned in the template configuration XML file in the bracket](https://www.syncfusion.com/blogs/wp-content/uploads/2020/12/In-the-Run-method-provide-the-Name-that-you-mentioned-in-the-template-configuration-XML-file-in-the-bracket.png)
3. Call the above command from Manifestaddin.xml. You should mention the command id({Namespace}.{CommandID}.{Command}) in the command item id. Here, we have named it as MyXamarinProjectTemplate.MyXamarinCommands.CreateNewProject.  
 ![Mention the command id({Namespace}.{CommandID}.{Command}) in the command item id](https://www.syncfusion.com/blogs/wp-content/uploads/2020/12/Mention-the-command-idNamespace.CommandID.Command-in-the-command-item-id.png)

## Change MacExtensions’ name and version

Change the MacExtensions name and version details after creating the entire project in the AddinInfo.cs file. Please refer to the following screenshot.  
 ![Change the MacExtensions name and version details after creating the entire project in the AddinInfo.cs file](https://www.syncfusion.com/blogs/wp-content/uploads/2020/12/Change-the-MacExtensions-name-and-version-details-after-creating-the-entire-project-in-the-AddinInfo.cs-file.png)

## Install the extension

1. You can find the extension in the output location with the extension name \*.mpack, like the following screenshot.  
 ![You can find the extension in the output location with the extension name *.mpack](https://www.syncfusion.com/blogs/wp-content/uploads/2020/12/output-location-with-the-extension-name-mpack-1.png)
2. Click on the Visual Studio menu and select **Extensions…**.  
 ![Click on the Visual Studio menu and select Extensions….](https://www.syncfusion.com/blogs/wp-content/uploads/2020/12/Click-on-the-Visual-Studio-menu-and-select-Extensions%E2%80%A6..png)
3. The Extension Manager window will open. Click the **Install from file** … button.  
 ![Extension Manager window](https://www.syncfusion.com/blogs/wp-content/uploads/2020/12/Extension-Manager-window.png)
4. The **Install Extension Package** dialog will open. Navigate to your Mac extensions file (.mpack) location and click **open** to install. The extensions will be installed into your project.Refer to the following screenshot.  
 ![Install Extension Package dialog](https://www.syncfusion.com/blogs/wp-content/uploads/2020/12/Install-Extension-Package-dialog.png)

## Run the extensions

Run the sample extension in the Visual Studio Mac instance. This will open another Visual Studio for Mac instance that will show the template in the project template wizard and Visual Studio menu.

### Project template wizard

In the new instance of Visual Studio 2019 for Mac, click on the **New** button.  
 ![click on the New button](https://www.syncfusion.com/blogs/wp-content/uploads/2020/12/click-on-the-New-button.png)

Then, in the project template wizard, you can find the template **My Xamarin Project Template** under **Multiplatform > App**.  
 ![In the project template wizard, you can find the template My Xamarin Project Template under Multiplatform > App](https://www.syncfusion.com/blogs/wp-content/uploads/2020/12/In-the-project-template-wizard-you-can-find-the-template-My-Xamarin-Project-Template-under-Multiplatform-App.png)

### Visual Studio for Mac menu

You can also find the given menu name (which is mentioned in the ItemSet ID tag in Manifestaddin.xml file) in the Visual Studio menu.  
 ![Visual Studio for Mac menu](https://www.syncfusion.com/blogs/wp-content/uploads/2020/12/Visual-Studio-for-Mac-menu.png)

## Source of this sample extension

You can download the complete source code for this sample extension from [https://www.syncfusion.com/downloads/support/directtrac/general/ze/MacExtensions266839071](https://www.syncfusion.com/downloads/support/directtrac/general/ze/MacExtensions266839071).

## Conclusion

I hope this article was useful in showing every step in creating extensions for a project template in the Visual Studio for Mac project template wizard and extension menu.

Syncfusion has about 1,600 components and frameworks for [WinForms](https://www.syncfusion.com/winforms-ui-controls), [WPF](https://www.syncfusion.com/wpf-ui-controls), [WinUI(Preview)](https://www.syncfusion.com/winui-controls), ASP.NET ([Web Forms](https://www.syncfusion.com/jquery/aspnet-web-forms-ui-controls), [MVC](https://www.syncfusion.com/aspnet-mvc-ui-controls/), [Core](https://www.syncfusion.com/aspnet-core-ui-controls)), [UWP](https://www.syncfusion.com/uwp-ui-controls), [Xamarin](https://www.syncfusion.com/xamarin-ui-controls/), [Flutter](https://www.syncfusion.com/flutter-widgets), [JavaScript](https://www.syncfusion.com/javascript-ui-controls), [Angular](https://www.syncfusion.com/angular-ui-components), [Blazor](https://www.syncfusion.com/blazor-components), [Vue](https://www.syncfusion.com/vue-ui-components), and [React](https://www.syncfusion.com/react-ui-components). Use them to boost your application development speed.

If you have any questions, please let us know in the comments section. You can also contact us through our [support forum](https://www.syncfusion.com/forums), [Direct-Trac](https://www.syncfusion.com/support/directtrac/), or [feedback portal](https://www.syncfusion.com/feedback/). As always, we are happy to assist you!

If you like this post, we think you would also like the following articles too:

- “[Creating Extensions for Visual Studio Code: A Complete Guide](https://dev.to/syncfusion/creating-extensions-for-visual-studio-code-a-complete-guide-3588)” [Blog]
- “[Creating Visual Studio Extensions Using Visual Studio 2019—A Complete Guide](https://dev.to/syncfusion/creating-visual-studio-extensions-using-visual-studio-2019-a-complete-guide-50g)” [Blog]
- “[Syncfusion Visual Studio Extensions Support .NET 5.0 Preview 6](https://dev.to/sureshmohan/syncfusion-visual-studio-extensions-support-net-5-0-preview-6-4ka1-temp-slug-4566894)” [Blog]
- [_Visual Studio for Mac Succinctly_](https://www.syncfusion.com/ebooks/visual-studio-for-mac-succinctly) [E-Book]