Skip to content

Commit

Permalink
Merge pull request #13 from onovotny/add-process-arch
Browse files Browse the repository at this point in the history
Add process arch
  • Loading branch information
Oren Novotny authored Aug 10, 2019
2 parents f87cf2b + 86d54a7 commit 7287ce1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
12 changes: 4 additions & 8 deletions AppInsights.WindowsDesktop/AppInsights.WindowsDesktop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,15 @@
<UseWpf>true</UseWpf>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0.16299'">
<TargetPlatformVersion>10.0.17763.0</TargetPlatformVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.10.0" />
<PackageReference Include="Nerdbank.GitVersioning" Version="2.3.183" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05" PrivateAssets="All" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.0.25" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-19367-01" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<PackageReference Include="System.Management" Version="4.6.0-preview5.19224.8" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.6.0-preview5.19224.8" />
<PackageReference Include="System.Management" Version="4.6.0-preview7.19362.9" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.6.0-preview7.19362.9" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ public class DeviceTelemetryInitializer : ITelemetryInitializer

#if !NET461
private readonly string _operatingSystem = RuntimeInformation.OSDescription?.Replace("Microsoft ", ""); // Shorter description
private readonly string _processArchitecture = RuntimeInformation.ProcessArchitecture.ToString();
private readonly string _osArchitecture = RuntimeInformation.OSArchitecture.ToString();
#else
private readonly string _operatingSystem =$"Windows {Environment.OSVersion.Version.ToString(3)}"; // Shorter description, to match the other platforms
private readonly string _processArchitecture = Environment.Is64BitProcess ? "X64" : "X86";
private readonly string _osArchitecture = Environment.Is64BitOperatingSystem ? "X64" : "X86";
#endif

/// <summary>
Expand Down Expand Up @@ -47,7 +51,10 @@ public void Initialize(ITelemetry telemetry)
telemetry.Context.GlobalProperties["Network type"] = reader.GetNetworkType();
telemetry.Context.GlobalProperties["Thread culture"] = reader.GetHostSystemLocale();
telemetry.Context.GlobalProperties["UI culture"] = reader.GetDisplayLanguage();
telemetry.Context.GlobalProperties["Time zone"] = TimeZoneInfo.Local.Id;
telemetry.Context.GlobalProperties["Time zone"] = TimeZoneInfo.Local.Id;

telemetry.Context.GlobalProperties["Process architecture"] = _processArchitecture;
telemetry.Context.GlobalProperties["OS architecture"] = _osArchitecture;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ variables:
steps:
- task: DotNetCoreInstaller@0
inputs:
version: '3.0.100-preview5-011568'
version: '3.0.100-preview7-012821'

- task: DotNetCoreCLI@2
inputs:
Expand Down

0 comments on commit 7287ce1

Please sign in to comment.