Skip to content

Commit a99e09c

Browse files
authored
TNT-40905 Retrieve SDK version directly from assembly (#16)
1 parent 213753f commit a99e09c

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

Source/Adobe.Target.Client/Util/TargetConstants.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,13 @@
1010
*/
1111
namespace Adobe.Target.Client.Util
1212
{
13+
using System.Reflection;
14+
1315
/// <summary>
1416
/// Target Constants
1517
/// </summary>
1618
public static class TargetConstants
1719
{
18-
/// <summary>
19-
/// SDK Version
20-
/// </summary>
21-
public const string SdkVersion = "1.0.2";
22-
2320
/// <summary>
2421
/// Mbox cookie name
2522
/// </summary>
@@ -60,9 +57,19 @@ public static class TargetConstants
6057
/// </summary>
6158
public const string DefaultSdidConsumerId = "target-global-mbox";
6259

60+
/// <summary>
61+
/// SDK Version
62+
/// </summary>
63+
public static readonly string SdkVersion = Assembly.GetEntryAssembly()
64+
!.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
65+
!.InformationalVersion;
66+
6367
internal const string SdkNameHeader = "X-EXC-SDK";
68+
6469
internal const string SdkNameValue = "AdobeTargetNet";
70+
6571
internal const string SdkVersionHeader = "X-EXC-SDK-Version";
72+
6673
internal static readonly string SdkUserAgent = $"{SdkNameValue}/{SdkVersion}";
6774
}
6875
}

0 commit comments

Comments
 (0)