Skip to content

Commit 4fd5863

Browse files
committed
Review menu extension
1 parent 653fcb5 commit 4fd5863

1 file changed

Lines changed: 21 additions & 17 deletions

File tree

  • content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/csharp/extensibility-api-howtos

content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/csharp/extensibility-api-howtos/create-menu-extension.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,43 @@ weight: 4
77

88
## Introduction
99

10-
This how-to describes how you can create an extension that adds an item to Studio Pro menu from scratch.
10+
This how-to describes how to create an extension that adds an item to Studio Pro menu from scratch.
1111

1212
You can download the example in this how-to in [this GitHub repository](https://github.com/mendix/ExtensionAPI-Samples).
1313

1414
## Creating an Extension Project
1515

16-
1. Create a new project in Visual Studio based on `C# Class Library` template.
17-
2. Choose a name for the project. Use a format similar to `MyCompany.MyProject.MendixExtension`, but it is not a hard requirement.
18-
3. Choose `.NET 8.0` Framework.
16+
1. Open Visual Studio and create a new project using the `C# Class Library` template.
17+
2. Name your project. It recommended to use a format similar to `MyCompany.MyProject.MendixExtension`.
18+
3. Select the `.NET 8.0` Framework.
1919
4. Add `Mendix.StudioPro.ExtensionsAPI` NuGet package to the project references. Pick the version that does not exceed the Studio Pro version you installed. To do so, perform the following steps:
2020

2121
1. Include a reference to the Extensions API [NuGet package](https://www.nuget.org/packages/Mendix.StudioPro.ExtensionsAPI):
22-
2. Add new file named `manifest.json` to your project. Put the following content into it:
22+
2. Add new file named `manifest.json` to your project.
23+
3. Add the following code into the file:
2324

2425
```json
2526
{ "mx_extensions": [ "<name_of_your_project>.dll" ] }
2627
```
2728

28-
3. For the `manifest.json` file, right-click **Solution Explorer** > **Properties** and change the **Copy to Output Directory** property to **Copy always**.
29+
4. For the `manifest.json` file, right-click **Solution Explorer** > **Properties** and change the **Copy to Output Directory** property to **Copy always**.
2930

3031
## Creating a Test Mendix App
3132

32-
It is handy to have an app where the extension is used for the testing purposes. Perhaps you even want to share this app with your team by committing its code next to the extension project.
33-
34-
1. Create a new Mendix app to use for testing the extension, based on a starter app of your choice. You can also use an existing app.
35-
2. Go to **App** > **Show App Directory in Explorer** to open the app directory.
36-
3. Create a new folder `extensions` inside the app directory.
37-
4. Create a subfolder named after your extension, for example, `MyCompany`, inside the `extensions` folder.
38-
5. Copy the full path of the subfolder by pressing <kbd>Shift</kbd> and right-clicking at the same time, and then selecting **Copy as path**.
39-
6. Add the `Post-build event` script below to your extension project [Build > Events configuration](https://docs.microsoft.com/en-us/visualstudio/ide/how-to-specify-build-events-csharp?view=vs-2022):
40-
`xcopy /y /s /i "$(TargetDir)" "<path_to_folder>"`
41-
42-
Now if you build your extension project (usually you can do this by pressing <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>B</kbd>) and click [Synchronize App Directory](/refguide/app-menu/#synchronize) in Studio Pro (or press <kbd>F4</kbd>), the latest version of your extension will be loaded.
33+
Test your extension by creating or using a Mendix app.
34+
35+
1. Create a new Mendix app using a starter template, or use an existing app.
36+
2. In Studio Pro, go to **App** > **Show App Directory in Explorer** to open the app directory.
37+
3. Inside the app directory, create a new folder named `extensions`.
38+
4. Inside the `extensions` folder, create a sub-folder named after your extension (for example, `MyCompany`).
39+
5. Copy the full path of the sub-folder:
40+
1. Press <kbd>Shift</kbd> and right-click at the same time
41+
2. Select **Copy as path**.
42+
6. Add the `Post-build event` script below to your extension project:
43+
1. Go to [Build > Events configuration](https://docs.microsoft.com/en-us/visualstudio/ide/how-to-specify-build-events-csharp?view=vs-2022)
44+
2. Use this command: `xcopy /y /s /i "$(TargetDir)" "<path_to_folder>"`
45+
7. Build your extension project by pressing <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>B</kbd>
46+
8. In Studio Pro, click [Synchronize App Directory](/refguide/app-menu/#synchronize) (or press <kbd>F4</kbd>) to load the latest version of your extension.
4347

4448
## Creating Your First Extension
4549

0 commit comments

Comments
 (0)