diff --git a/src/vpk/Velopack.Build/MSBuildLogger.cs b/src/vpk/Velopack.Build/MSBuildLogger.cs index 865ae9de..8bc63207 100644 --- a/src/vpk/Velopack.Build/MSBuildLogger.cs +++ b/src/vpk/Velopack.Build/MSBuildLogger.cs @@ -29,7 +29,7 @@ public class MSBuildLogger(TaskLoggingHelper loggingHelper) : ILogger, IFancyCon try { await fn(x => { }).ConfigureAwait(false); } catch (Exception ex) { - this.LogError(ex, "Error running task {0}", name); + this.LogError(ex, "Error running task {taskName}", name); throw; } } @@ -39,7 +39,7 @@ public class MSBuildLogger(TaskLoggingHelper loggingHelper) : ILogger, IFancyCon try { return await fn(x => { }).ConfigureAwait(false); } catch (Exception ex) { - this.LogError(ex, "Error running task {0}", name); + this.LogError(ex, "Error running task {taskName}", name); throw; } } diff --git a/src/vpk/Velopack.Build/PublishTask.cs b/src/vpk/Velopack.Build/PublishTask.cs index 293f5105..7c78419f 100644 --- a/src/vpk/Velopack.Build/PublishTask.cs +++ b/src/vpk/Velopack.Build/PublishTask.cs @@ -1,4 +1,5 @@ -using System.Threading; +using System; +using System.Threading; using System.Threading.Tasks; using Microsoft.Build.Framework; using Microsoft.Extensions.Logging; @@ -17,17 +18,19 @@ public class PublishTask : MSBuildAsyncTask public string? ApiKey { get; set; } - public double Timeout { get; set; } = 30d; + public string? Timeout { get; set; } public bool WaitForLive { get; set; } protected override async Task ExecuteAsync(CancellationToken cancellationToken) { + TimeSpan timeout = Timeout == null ? TimeSpan.FromMinutes(30) : TimeSpan.Parse(Timeout); + //System.Diagnostics.Debugger.Launch(); var options = new VelopackFlowServiceOptions { VelopackBaseUrl = ServiceUrl, ApiKey = ApiKey, - Timeout = Timeout, + Timeout = timeout, }; var loginOptions = new VelopackFlowLoginOptions() { @@ -37,8 +40,7 @@ public class PublishTask : MSBuildAsyncTask }; var client = new VelopackFlowServiceClient(options, Logger, Logger); - CancellationToken token = CancellationToken.None; - if (!await client.LoginAsync(loginOptions, false, token)) { + if (!await client.LoginAsync(loginOptions, false, cancellationToken).ConfigureAwait(false)) { Logger.LogWarning("Not logged into Velopack Flow service, skipping publish. Please run vpk login."); return true; } diff --git a/src/vpk/Velopack.Build/Velopack.Build.targets b/src/vpk/Velopack.Build/Velopack.Build.targets index add61e71..329f91b5 100644 --- a/src/vpk/Velopack.Build/Velopack.Build.targets +++ b/src/vpk/Velopack.Build/Velopack.Build.targets @@ -23,6 +23,8 @@ $(Authors) $(RuntimeIdentifier) Desktop,StartMenuRoot + 00:30:00 + false