public Dictionary <string, string> GetTelemetryCommonProperties() { return(new Dictionary <string, string> { { OSVersion, RuntimeEnvironment.OperatingSystemVersion }, { OSPlatform, RuntimeEnvironment.OperatingSystemPlatform.ToString() }, { OutputRedirected, Console.IsOutputRedirected.ToString() }, { RuntimeId, RuntimeEnvironment.GetRuntimeIdentifier() }, { ProductVersion, Product.Version }, { TelemetryProfile, Environment.GetEnvironmentVariable(TelemetryProfileEnvironmentVariable) }, { DockerContainer, _userLevelCacheWriter.RunWithCache(IsDockerContainerCacheKey, () => _dockerContainerDetector.IsDockerContainer().ToString("G")) }, { CurrentPathHash, _hasher(_getCurrentDirectory()) }, // we don't want to recalcuate a new id for every new SDK version. Reuse the same path accross versions. // If we change the format of the cache later. // We need to rename the cache from v1 to v2 { MachineId, _userLevelCacheWriter.RunWithCacheInFilePath( Path.Combine( CliFolderPathCalculator.DotnetUserProfileFolderPath, $"{MachineIdCacheKey}.v1.dotnetUserLevelCache"), GetMachineId) }, { KernelVersion, GetKernelVersion() }, { InstallationType, ExternalTelemetryProperties.GetInstallationType() }, { ProductType, ExternalTelemetryProperties.GetProductType() }, { LibcRelease, ExternalTelemetryProperties.GetLibcRelease() }, { LibcVersion, ExternalTelemetryProperties.GetLibcVersion() } }); }
private static string GetDisplayRid(DotnetVersionFile versionFile) { FrameworkDependencyFile fxDepsFile = new FrameworkDependencyFile(); string currentRid = RuntimeEnvironment.GetRuntimeIdentifier(); // if the current RID isn't supported by the shared framework, display the RID the CLI was // built with instead, so the user knows which RID they should put in their "runtimes" section. return(fxDepsFile.IsRuntimeSupported(currentRid) ? currentRid : versionFile.BuildRid); }
public Dictionary <string, string> GetTelemetryCommonProperties() => new Dictionary <string, string> { { OSVersion, RuntimeEnvironment.OperatingSystemVersion }, { OSPlatform, RuntimeEnvironment.OperatingSystemPlatform.ToString() }, { OutputRedirected, Console.IsOutputRedirected.ToString() }, { RuntimeId, RuntimeEnvironment.GetRuntimeIdentifier() }, { ProductVersion, GetProductVersion() }, { TelemetryProfile, Environment.GetEnvironmentVariable(TelemetryProfileEnvironmentVariable) }, { MachineId, GetMachineId() }, { CurrentPathHash, HashBuilder.Build(_getCurrentDirectory(), SHA256.Create()) }, { KernelVersion, GetKernelVersion() }, };
public Dictionary <string, string> GetTelemetryCommonProperties() { return(new Dictionary <string, string> { { OSVersion, RuntimeEnvironment.OperatingSystemVersion }, { OSPlatform, RuntimeEnvironment.OperatingSystemPlatform.ToString() }, { RuntimeId, RuntimeEnvironment.GetRuntimeIdentifier() }, { ProductVersion, Product.Version }, { TelemetryProfile, Environment.GetEnvironmentVariable(TelemetryProfileEnvironmentVariable) }, { DockerContainer, _userLevelCacheWriter.RunWithCache(IsDockerContainerCacheKey, () => _dockerContainerDetector.IsDockerContainer().ToString("G")) }, { CurrentPathHash, _hasher(_getCurrentDirectory()) }, { MachineId, _userLevelCacheWriter.RunWithCache(MachineIdCacheKey, GetMachineId) }, { KernelVersion, GetKernelVersion() } }); }
private static string GetNativeLibraryDirectory() { var dir = Path.GetDirectoryName(typeof(Repository).Assembly.Location); return(Path.Combine(dir, RuntimePath, RuntimeIdMap.GetNativeLibraryDirectoryName(RuntimeEnvironment.GetRuntimeIdentifier()), "native")); }