Basic example of consuming a code flow#8398
Conversation
Create a basic, real-world example of how to hook up to a data flow for launch settings and use it to respond to changes.
| // OnLaunchSettingsChangesAsync method, specifying the UnconfiguredProject as the "context" for the purposes of | ||
| // error reporting. | ||
| _launchSettingsLink = _launchSettingsProvider.SourceBlock | ||
| .LinkToAsyncAction(OnLaunchSettingsChangedAsync, _project); |
There was a problem hiding this comment.
LinkToAsyncAction is defined in https://github.com/dotnet/project-system/blob/main/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/DataflowUtilities.cs.
This in turn depends on DataflowBlockFactory.CreateActionBlock.
| ILaunchSettingsProvider launchSettingsProvider, | ||
| // There are multiple implementations of IProjectPropertiesProvider. The Import attribute here tells MEF to give | ||
| // us the specific one named "ProjectFile". | ||
| [Import(ContractNames.ProjectPropertyProviders.ProjectFile)] IProjectPropertiesProvider projectProperties) |
There was a problem hiding this comment.
ContractNames.ProjectPropertyProviders.ProjectFile is defined in https://github.com/dotnet/project-system/blob/main/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/ContractNames.cs.
|
Tests are failing because of this unit-test |
|
I would nice to see this sample code in the wiki page https://dev.azure.com/devdiv/DevDiv/_wiki/wikis/DevDiv.wiki/28503/Dataflows |
|
@tmeschter Howdy. What is the status on this? I'm also a bit confused why this is checked in as source code when I believe it is supposed to be an example. Thanks! |
Create a basic, real-world example of how to hook up to a data flow for launch settings and use it to respond to changes.
Microsoft Reviewers: Open in CodeFlow