You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/csharp/extensibility-api-howtos/create-menu-extension.md
+21-17Lines changed: 21 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,39 +7,43 @@ weight: 4
7
7
8
8
## Introduction
9
9
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.
11
11
12
12
You can download the example in this how-to in [this GitHub repository](https://github.com/mendix/ExtensionAPI-Samples).
13
13
14
14
## Creating an Extension Project
15
15
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.
19
19
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:
20
20
21
21
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.
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**.
29
30
30
31
## Creating a Test Mendix App
31
32
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):
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.
0 commit comments