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: docs/extensibility/extensibility-hello-world.md
+46-18Lines changed: 46 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: "Hello World extension tutorial | Microsoft Docs"
3
-
ms.date: "07/10/2017"
3
+
ms.date: "03/14/2019"
4
4
ms.topic: "conceptual"
5
5
ms.assetid: f74e1ad1-1ee5-4360-9bd5-d82467b884ca
6
6
author: "gregvanl"
@@ -29,53 +29,75 @@ For this example, you'll use Visual C# to add a custom menu button named "Say He
29
29
30
30
## Prerequisites
31
31
32
-
Before you start, make sure you have installed the **Visual Studio extension development** workload which includes the VSIX template you'll need and sample code.
32
+
Before you start, make sure you have installed the **Visual Studio extension development** workload, which includes the VSIX template you'll need and sample code.
33
33
34
34
> [!NOTE]
35
35
> You can use any edition of Visual Studio (Community, Professional, or Enterprise) to create a Visual Studio extensibility project.
36
36
37
37
## Create an extensibility project
38
38
39
-
Step 1. From the **File** menu, click **New Project**. At the bottom of the screen, enter the name of your project.
39
+
::: moniker range="vs-2017"
40
+
41
+
Step 1. From the **File** menu, select **New Project**.
40
42
41
-
Step 2. From the **Templates** menu, click **Visual C#**, click **Extensibility**, and then click **VSIX Project**.
43
+
Step 2. In the search box in the upper right, type "vsix" and select the Visual C#**VSIX Project**. Enter "HelloWorld" for the **Name** at the bottom of the dialog and select **OK**.
42
44
43
45

44
46
45
47
You should now see the Getting Started page and some sample resources.
46
48
47
-
::: moniker range="vs-2017"
48
-
49
49
If you need to leave this tutorial and come back to it, you can find your new HelloWorld project on the **Start Page** in the **Recent** section.
50
50
51
51
::: moniker-end
52
52
53
+
::: moniker range=">=vs-2019"
54
+
55
+
Step 1. From the **File** menu, select **New Project**. Search for "vsix" and select the Visual C# **VSIX Project** and then **Next**.
56
+
57
+
Step 2. Enter "HelloWorld" for the **Project name** and select **Create**.
Your new command is listed in **Solution Explorer** under the **Resources**branch. This is also where you'll find other files related to your command, such as the PNG and ICO files if you wish to modify the image.
77
+
Your new command file is visible in **Solution Explorer**. Under the **Resources**node, you'll find other files related to your command. For example, if you wish to modify the image, the PNG file is here.
66
78
67
79
## Modify the source code
68
80
69
-
At this point, the Button you're adding is pretty generic. You'll have to modify the VSCT file and CS file if you want to make changes.
81
+
At this point, the command and Button text is auto-generated and not very interesting. You can modify the VSCT file and CS file if you want to make changes.
70
82
71
-
* The VSCT file is where you can rename your commands, as well as define where they go in the Visual Studio command system. As you explore the VSCT file, you will notice a lot of commented code that explains what each section of code controls.
83
+
* The VSCT file is where you can rename your commands, as well as define where they go in the Visual Studio command system. As you explore the VSCT file, you will notice comments that explain what each section of the VSCT code controls.
72
84
73
85
* The CS file is where you can define actions, such as the click handler.
74
86
87
+
::: moniker range="vs-2017"
88
+
75
89
Step 1. In **Solution Explorer**, find the VSCT file for your new command. In this case, it will be called *CommandPackage.vsct*.
Step 1. In **Solution Explorer**, find the VSCT file for your extension VS package. In this case, it will be called *HelloWorldPackage.vsct*.
98
+
99
+
::: moniker-end
100
+
79
101
Step 2. Change the `ButtonText` parameter to `Say Hello World!`.
80
102
81
103
```xml
@@ -90,14 +112,15 @@ Step 2. Change the `ButtonText` parameter to `Say Hello World!`.
90
112
...
91
113
```
92
114
93
-
Step 3. Go back to **Solution Explorer** and find the *Command.cs* file. Change the string `message` for the command`string.Format(..)` to `Hello World!`.
115
+
Step 3. Go back to **Solution Explorer** and find the *Command.cs* file. In the `Execute` method, change the string `message` from`string.Format(..)` to `Hello World!`.
@@ -117,12 +140,16 @@ Make sure to save your changes to each file.
117
140
118
141
You can now run the source code in the Visual Studio Experimental Instance.
119
142
120
-
Step 1. Click **Start** in the Toolbar. This builds your project and starts the debugger, launching a new instance of Visual Studio called the **Experimental Instance**.
143
+
Step 1. Press **F5** to run the **Start Debugging** command. This command builds your project and starts the debugger, launching a new instance of Visual Studio called the **Experimental Instance**.
144
+
145
+
::: moniker range="vs-2017"
121
146
122
147
You will see the words **Experimental Instance** in the Visual Studio title bar.
123
148
124
149

125
150
151
+
::: moniker-end
152
+
126
153
Step 2. On the **Tools** menu of the **Experimental Instance**, click **Say Hello World!**.
0 commit comments