Skip to content

ConfigurationUpdate v1.0.0

Compare
Choose a tag to compare
@TsuyoshiUshio TsuyoshiUshio released this 13 Aug 08:07
· 25 commits to master since this release

You may change something. If you want to get a proper result, you need to add the additional code in while loop.

       protected override async Task RunAsync(CancellationToken cancellationToken)
        {
            int incrementStep = 1;
            long iterations = 0;
            while (true)
            {
                cancellationToken.ThrowIfCancellationRequested();
                var configSection = this.Context.CodePackageActivationContext.GetConfigurationPackageObject("Config");
                var text = configSection.Settings.Sections["MyConfigSection"]
                    .Parameters["IncrementStep"].Value;
                incrementStep = int.Parse(text);

                ServiceEventSource.Current.ServiceMessage(this, "Working-{0}", iterations += incrementStep);

                await Task.Delay(TimeSpan.FromSeconds(1), cancellationToken);
            }
        }