Skip to content

Latest commit

 

History

History
35 lines (28 loc) · 907 Bytes

IPublishProvider.md

File metadata and controls

35 lines (28 loc) · 907 Bytes

IPublishProvider

The IPublishProvider interface can be exported to provide functionality for the IVsPublishableProjectCfg interface in Visual Studio.

Make sure you have [AppliesTo("xxx")] attribute on your exported type where xxx is your project type.

Sample code below:

    [Export(typeof(IPublishProvider))]
    [AppliesTo("MyProjectType")]
    internal class MyPublishProvider : IPublishProvider
    {
        [Import]
        private ProjectProperties Properties { get; set; }

        public Task<bool> IsPublishSupportedAsync()
        {
            return Task.FromResult(true);
        }

        public async Task PublishAsync(CancellationToken cancellationToken, TextWriter outputPaneWriter)
		{
			await Task.Yield();
        }

        public Task<bool> ShowPublishPromptAsync()
        {
            return Task.FromResult(false);
        }
    }