This repository was archived by the owner on Dec 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Modifying documentation to work for VS 2017 #6
Open
katelmaroney
wants to merge
2
commits into
microsoft:v15.0
Choose a base branch
from
katelmaroney:v15.0
base: v15.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,11 +26,11 @@ Visual Studio uses the [Microsoft Extensibility Framework](http://msdn.microsoft | |
|
|
||
| The Connected Services feature in Visual Studio does just that. It defines an extension point and a contract: the abstract [ConnectedServiceProvider](https://msdn.microsoft.com/en-us/library/microsoft.visualstudio.connectedservices.connectedserviceprovider(v=vs.140).aspx) class. To create your own extension to Connected Services, you implement a class that inherits from the [ConnectedServiceProvider](https://msdn.microsoft.com/en-us/library/microsoft.visualstudio.connectedservices.connectedserviceprovider(v=vs.140).aspx) class and Export it. | ||
|
|
||
| To do this, you first need VS 2015 and the VS 2015 SDK installed. | ||
| To do this, you first need VS 2015 and the VS 2015 SDK or VS 2017 and the Extensibility workload installed. | ||
|
|
||
| ## Creating the Connected Service Project | ||
|
|
||
| The VS 2015 SDK installs an 'Extensibility' of project and item templates: | ||
| Look for the 'Extensibility' group of project and item templates: | ||
|
|
||
|  | ||
|
|
||
|
|
@@ -62,7 +62,7 @@ For more info on how version ranges work see [VSIX Extension Schema 2.0 Referenc | |
|
|
||
| ## Including the Connected Service in the VSIX | ||
|
|
||
| By default, a VSIX project doesn't include the project output into the VSIX, which means you're VSIX won't actually install your Connected Service | ||
| By default in VS 2015, a VSIX project doesn't include the project output into the VSIX, which means you're VSIX won't actually install your Connected Service. If you have VS 2017, this should be enabled by default. | ||
|
|
||
| - Select the project Properties and set Include Assembly in VSIX Container to **true.** | ||
|
|
||
|
|
@@ -132,11 +132,6 @@ In the Experimental Instance of Visual Studio, create a new Console Application | |
|
|
||
|  | ||
|
|
||
|
|
||
| Notice that the "Configure" button is disabled in the Connected Service dialog. A Connected Service provider needs to find a class that handles the configuration for the project. Because there is no available handler with the same ProviderId that supports the current project type, Visual Studio disables the Configure button. | ||
|
|
||
| To enable the button, we will need to create a handler for this provider and project type. | ||
|
|
||
| # Creating a Handler | ||
|
|
||
| Stop debugging, and add a new class named **Handler** to the root of your project with the following code: | ||
|
|
@@ -148,7 +143,7 @@ Stop debugging, and add a new class named **Handler** to the root of your projec | |
| namespace ConnectedServiceSample | ||
| { | ||
| [ConnectedServiceHandlerExport("Contoso.SampleService", | ||
| AppliesTo = "CSharp+Web")] | ||
| AppliesTo = "CSharp | Web")] | ||
| internal class Handler : ConnectedServiceHandler | ||
| { | ||
| public override Task<AddServiceInstanceResult> AddServiceInstanceAsync(ConnectedServiceHandlerContext context, CancellationToken ct) | ||
|
|
@@ -167,9 +162,9 @@ The value of the attribute's AppliesTo parameter specifies what types of Visual | |
|
|
||
| You will implement the changes to the app developer's project in the AddServiceInstanceAsync method. We'll show you to do in a later section. For now, we simply return a simple instance of the AddServiceInstanceResult. | ||
|
|
||
| F5 again, create a C# Web project, open the Connected Service dialog, and you will see the sample provider can now be configured. | ||
| F5 again, create a C# Console App project, open the Connected Service dialog, and you will see the sample provider listed in the Connected Services tab | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This may need revisiting based on the outcome of the AppliesTo expression comment I left earlier. |
||
|
|
||
| Now that the Configure button is enabled, you are probably going to want to click it. However, if you do, you get the exception message: | ||
| Now that the your Connected Service is listed on the Connected Services tab, you are probably going to want to click it. However, if you do, you get the exception message: | ||
|
|
||
| _The Connected Services component ' Sample Provider' failed: (HRESULT:0x80131509) The Connected Service Provider 'Contoso.SampleService' returned an invalid ConnectedServiceConfigurator from the CreateConfiguratorAsync method. A valid object should inherit from ConnectedServiceGrid, ConnectedServiceSinglePage, or ConnectedServiceWizard._ | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like an odd AppliesTo expression, to work with any Web project and also work with any C# project. So you work with console apps, class libraries, etc. and also VB web projects.
I think the and operator used before made more sense. Why the change?