Skip to content

Commit 7717090

Browse files
committed
fix comments
1 parent 6d695a2 commit 7717090

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed
Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4-
using System.Reflection;
4+
using System.Diagnostics;
55

66
namespace Microsoft.DurableTask;
77

@@ -13,15 +13,19 @@ public static class DurableTaskUserAgentUtil
1313
/// <summary>
1414
/// The name of the SDK used in the user agent string.
1515
/// </summary>
16-
static string SdkName => "durabletask-dotnet";
16+
const string SdkName = "durabletask-dotnet";
17+
18+
/// <summary>
19+
/// The version of the SDK used in the user agent string.
20+
/// </summary>
21+
static readonly string PackageVersion = FileVersionInfo.GetVersionInfo(typeof(DurableTaskUserAgentUtil).Assembly.Location).FileVersion;
1722

1823
/// <summary>
1924
/// Generates the user agent string for the Durable Task SDK based on a fixed name and the package version.
2025
/// </summary>
21-
/// <returns></returns>
26+
/// <returns>The user agent string.</returns>
2227
public static string GetUserAgent()
2328
{
24-
var version = typeof(DurableTaskUserAgentUtil).Assembly.GetName().Version;
25-
return $"{SdkName}/{version?.ToString() ?? "unknown"}";
29+
return $"{SdkName}/{PackageVersion?.ToString() ?? "unknown"}";
2630
}
2731
}

0 commit comments

Comments
 (0)