3680 references to Environment
aspire (108)
Backchannel\AuxiliaryBackchannelMonitor.cs (2)
502var homeDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
Backchannel\ExtensionRpcTarget.cs (1)
48Environment.Exit(ExitCodeConstants.Success);
Bundles\BundleService.cs (1)
57var processPath = Environment.ProcessPath;
Certificates\CertificateGeneration\CertificateManager.cs (1)
1039return string.Join(Environment.NewLine, description);
Certificates\CertificateGeneration\MacOSCertificateManager.cs (4)
25private static readonly string s_macOSUserKeychain = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + "/Library/Keychains/login.keychain-db"; 33private static readonly string s_macOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https");
Certificates\CertificateGeneration\UnixCertificateManager.cs (14)
61if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable(OpenSslCertDirectoryOverrideVariableName))) 101var sslCertDirString = Environment.GetEnvironmentVariable(OpenSslCertificateDirectoryVariableName); 136var nssDbs = GetNssDbs(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)); 232var homeDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); 366var existingSslCertDir = Environment.GetEnvironmentVariable(OpenSslCertificateDirectoryVariableName); 463var homeDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)!; 592var searchPath = Environment.GetEnvironmentVariable("PATH"); 652if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("WSL_INTEROP"))) 809var @override = Environment.GetEnvironmentVariable(OpenSslCertDirectoryOverrideVariableName); 835var nssDbOverride = Environment.GetEnvironmentVariable(NssDbOverrideVariableName); 882Log.UnixHomeDirectoryDoesNotExist(homeDirectory, Environment.UserName);
Certificates\CertificateHelpers.cs (3)
22Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), 32var overridePath = Environment.GetEnvironmentVariable(DevCertsOpenSslCertDirEnvVar);
Certificates\CertificateService.cs (1)
108var currentSslCertDir = Environment.GetEnvironmentVariable(SslCertDirEnvVar);
CliExecutionContext.cs (3)
26public DirectoryInfo HomeDirectory { get; } = homeDirectory ?? new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)); 51return Environment.GetEnvironmentVariable(variable);
Commands\AppHostLauncher.cs (2)
194var dotnetPath = Environment.ProcessPath ?? "dotnet"; 198var entryAssemblyPath = Environment.GetCommandLineArgs().FirstOrDefault();
Commands\RootCommand.cs (1)
161string.Format(CultureInfo.CurrentCulture, RootCommandStrings.WaitingForDebugger, Environment.ProcessId),
Commands\Sdk\SdkDumpCommand.cs (1)
168var currentPid = Environment.ProcessId;
Commands\Sdk\SdkGenerateCommand.cs (1)
162var currentPid = Environment.ProcessId;
Commands\SetupCommand.cs (1)
52var processPath = Environment.ProcessPath;
Commands\UpdateCommand.cs (4)
100var processPath = Environment.ProcessPath; 291var currentExePath = Environment.ProcessPath; 340var currentExePath = Environment.ProcessPath; 455var pathEnv = Environment.GetEnvironmentVariable("PATH");
Diagnostics\FileLoggerProvider.cs (1)
180? $"[{ts}] [{lvl}] [{category}] {message}{Environment.NewLine}{exception}"
DotNet\DotNetCliExecutionFactory.cs (2)
18internal static int GetCurrentProcessId() => Environment.ProcessId; 124var currentPath = startInfo.EnvironmentVariables["PATH"] ?? Environment.GetEnvironmentVariable("PATH") ?? string.Empty;
DotNet\DotNetCliRunner.cs (4)
86var homeDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); 587var lines = stdout.Split(Environment.NewLine); 628workingDirectory: new DirectoryInfo(Environment.CurrentDirectory),
Layout\LayoutDiscovery.cs (7)
48var envLayoutPath = Environment.GetEnvironmentVariable(BundleDiscovery.LayoutPathEnvVar); 76LayoutComponent.Dcp => Environment.GetEnvironmentVariable(BundleDiscovery.DcpPathEnvVar), 77LayoutComponent.Managed => Environment.GetEnvironmentVariable(BundleDiscovery.ManagedPathEnvVar), 94var useSdk = Environment.GetEnvironmentVariable(BundleDiscovery.UseGlobalDotNetEnvVar); 142var cliPath = Environment.ProcessPath; 225if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable(BundleDiscovery.DcpPathEnvVar))) 229if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable(BundleDiscovery.ManagedPathEnvVar)))
NuGet\BundleNuGetService.cs (2)
207var home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
Packaging\TemporaryNuGetConfig.cs (1)
53NewLineChars = Environment.NewLine,
Program.cs (6)
56var homeDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); 197var extensionEndpoint = Environment.GetEnvironmentVariable(KnownConfigNames.ExtensionEndpoint); 269var workingDirectory = new DirectoryInfo(Environment.CurrentDirectory); 516var workingDirectory = new DirectoryInfo(Environment.CurrentDirectory); 670logger.LogInformation("Working directory: {WorkingDirectory}", Environment.CurrentDirectory);
Projects\AppHostServerSession.cs (1)
123var currentPid = Environment.ProcessId;
Projects\DotNetBasedAppHostServerProject.cs (2)
575var userProfile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
Projects\GuestAppHostProject.cs (5)
261var currentPid = Environment.ProcessId; 426var currentPid = Environment.ProcessId; 791var currentPid = Environment.ProcessId; 927var homeDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
Projects\PrebuiltAppHostServer.cs (1)
255var outputLines = string.Join(Environment.NewLine, buildOutput.GetLines().Select(l => l.Line));
Projects\ProjectLocator.cs (1)
70MaxDegreeOfParallelism = Environment.ProcessorCount
Projects\ProjectUpdater.cs (5)
144if (Environment.OSVersion.Platform == PlatformID.Win32NT) 146return path.StartsWith(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)); 150var globalNuGetFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget");
Scaffolding\ScaffoldingService.cs (1)
82var currentPid = Environment.ProcessId;
src\Shared\BundleDiscovery.cs (1)
339var processPath = Environment.ProcessPath;
src\Shared\ConsoleLogs\PromptContext.cs (1)
51var value = string.Join(Environment.NewLine, uniqueLines);
src\Shared\PathLookupHelper.cs (2)
20? Environment.GetEnvironmentVariable("PATHEXT")?.Split(';', StringSplitOptions.RemoveEmptyEntries) ?? [] 23return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, File.Exists, pathExtensions);
src\Shared\UserSecrets\UserSecretsPathHelper.cs (7)
34string? appData = Environment.GetEnvironmentVariable("APPDATA"); 36?? Environment.GetEnvironmentVariable("HOME") // On Mac/Linux it goes to ~/.microsoft/usersecrets/ 37?? Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) 38?? Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) 39?? Environment.GetEnvironmentVariable(userSecretsFallbackDir); // this fallback is an escape hatch if everything else fails
Telemetry\AspireCliTelemetry.cs (1)
209_tagsList.Add(new(TelemetryConstants.Tags.OsVersion, Environment.OSVersion.Version.ToString()));
Telemetry\LinuxMachineInformationProvider.cs (3)
24var userDir = Environment.GetEnvironmentVariable(PrimaryPathEnvVar); 29var rootPath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
Telemetry\MacOSXMachineInformationProvider.cs (4)
20/// user's profile directory using <see cref="Environment.SpecialFolder.UserProfile"/>. If that is unavailable, it 30var userDir = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); 35userDir = Environment.GetEnvironmentVariable("HOME");
Telemetry\TelemetryManager.cs (2)
141var homeDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
Templating\DotNetTemplateFactory.cs (1)
117var pathVariable = Environment.GetEnvironmentVariable("PATH") ?? string.Empty;
Utils\AspireRepositoryDetector.cs (2)
56var envRoot = Environment.GetEnvironmentVariable(BundleDiscovery.RepoRootEnvVar); 62var processPath = Environment.ProcessPath;
Utils\CliUpdateNotifier.cs (2)
91/// The detection works by examining <see cref="Environment.ProcessPath"/>, which returns the full path to the current executable. 99var processPath = Environment.ProcessPath;
Utils\EnvironmentChecker\ContainerRuntimeCheck.cs (1)
321var tunnelEnabled = Environment.GetEnvironmentVariable("ASPIRE_ENABLE_CONTAINER_TUNNEL");
Utils\EnvironmentChecker\DevCertsCheck.cs (1)
241var currentSslCertDir = Environment.GetEnvironmentVariable("SSL_CERT_DIR");
Utils\EnvironmentChecker\WslEnvironmentCheck.cs (1)
74return Environment.GetEnvironmentVariable("WSL_DISTRO_NAME") != null;
Aspire.Azure.AI.Inference (3)
src\Components\Common\AITelemetryHelpers.cs (1)
16Environment.GetEnvironmentVariable(KnownOtelConfigNames.InstrumentationGenAiCaptureMessageContent) is string envVar &&
src\Shared\AzureCredentialHelper.cs (2)
16if (Environment.GetEnvironmentVariable(DefaultAzureCredential.DefaultEnvironmentVariableName) is not null) 21if (Environment.GetEnvironmentVariable("AZURE_CLIENT_ID") is not null)
Aspire.Azure.AI.OpenAI (3)
src\Components\Common\AITelemetryHelpers.cs (1)
16Environment.GetEnvironmentVariable(KnownOtelConfigNames.InstrumentationGenAiCaptureMessageContent) is string envVar &&
src\Shared\AzureCredentialHelper.cs (2)
16if (Environment.GetEnvironmentVariable(DefaultAzureCredential.DefaultEnvironmentVariableName) is not null) 21if (Environment.GetEnvironmentVariable("AZURE_CLIENT_ID") is not null)
Aspire.Azure.Messaging.EventHubs (4)
AzureMessagingEventHubsSettings.cs (1)
83var envVar = Environment.GetEnvironmentVariable("AZURE_EXPERIMENTAL_ENABLE_ACTIVITY_SOURCE");
EventHubsComponent.cs (1)
80var identifier = $"{Environment.MachineName}-{eventHubName}-" +
src\Shared\AzureCredentialHelper.cs (2)
16if (Environment.GetEnvironmentVariable(DefaultAzureCredential.DefaultEnvironmentVariableName) is not null) 21if (Environment.GetEnvironmentVariable("AZURE_CLIENT_ID") is not null)
Aspire.Azure.Messaging.ServiceBus (1)
AzureMessagingServiceBusSettings.cs (1)
83var envVar = Environment.GetEnvironmentVariable("AZURE_EXPERIMENTAL_ENABLE_ACTIVITY_SOURCE");
Aspire.Azure.Npgsql (2)
src\Shared\AzureCredentialHelper.cs (2)
16if (Environment.GetEnvironmentVariable(DefaultAzureCredential.DefaultEnvironmentVariableName) is not null) 21if (Environment.GetEnvironmentVariable("AZURE_CLIENT_ID") is not null)
Aspire.Azure.Npgsql.EntityFrameworkCore.PostgreSQL (2)
src\Shared\AzureCredentialHelper.cs (2)
16if (Environment.GetEnvironmentVariable(DefaultAzureCredential.DefaultEnvironmentVariableName) is not null) 21if (Environment.GetEnvironmentVariable("AZURE_CLIENT_ID") is not null)
Aspire.Azure.Search.Documents (2)
src\Shared\AzureCredentialHelper.cs (2)
16if (Environment.GetEnvironmentVariable(DefaultAzureCredential.DefaultEnvironmentVariableName) is not null) 21if (Environment.GetEnvironmentVariable("AZURE_CLIENT_ID") is not null)
Aspire.Azure.Security.KeyVault (2)
src\Shared\AzureCredentialHelper.cs (2)
16if (Environment.GetEnvironmentVariable(DefaultAzureCredential.DefaultEnvironmentVariableName) is not null) 21if (Environment.GetEnvironmentVariable("AZURE_CLIENT_ID") is not null)
Aspire.Cli.EndToEnd.Tests (14)
Helpers\CliE2ETestHelpers.cs (7)
21!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("GITHUB_PR_NUMBER")) && 22!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("GITHUB_PR_HEAD_SHA")); 31var prNumberStr = Environment.GetEnvironmentVariable("GITHUB_PR_NUMBER"); 51var commitSha = Environment.GetEnvironmentVariable("GITHUB_PR_HEAD_SHA"); 258var ghToken = Environment.GetEnvironmentVariable("GH_TOKEN"); 264var prNumber = Environment.GetEnvironmentVariable("GITHUB_PR_NUMBER") ?? ""; 265var prSha = Environment.GetEnvironmentVariable("GITHUB_PR_HEAD_SHA") ?? "";
KubernetesPublishTests.cs (4)
23private static string KindVersion => Environment.GetEnvironmentVariable("KIND_VERSION") ?? "v0.31.0"; 24private static string HelmVersion => Environment.GetEnvironmentVariable("HELM_VERSION") ?? "v3.17.3"; 315cleanupProcess.StartInfo.FileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".local", "bin", "kind");
ProjectReferenceTests.cs (2)
76Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspire");
tests\Shared\Hex1bTestHelpers.cs (1)
108var githubWorkspace = Environment.GetEnvironmentVariable("GITHUB_WORKSPACE");
Aspire.Cli.Tests (31)
CliSmokeTests.cs (6)
42Environment.SetEnvironmentVariable(envVar, loc); 44Environment.SetEnvironmentVariable(CliConfigNames.NoLogo, "true"); 46Environment.SetEnvironmentVariable(envVar, null); 47Environment.SetEnvironmentVariable(CliConfigNames.NoLogo, null); 51var lines = errorOutput.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries); 88var lines = errorOutput.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries);
Commands\RunCommandTests.cs (1)
162Assert.DoesNotContain($"_{Environment.ProcessId}", fileName, StringComparison.Ordinal);
Commands\SdkDumpCommandTests.cs (7)
208Environment.CurrentDirectory = repoRoot; 209Environment.SetEnvironmentVariable("ASPIRE_REPO_ROOT", repoRoot); 210Environment.SetEnvironmentVariable(CliConfigNames.NoLogo, "true"); 211Environment.SetEnvironmentVariable("DOTNET_CLI_TELEMETRY_OPTOUT", "true"); 212Environment.SetEnvironmentVariable("DOTNET_SKIP_FIRST_TIME_EXPERIENCE", "true"); 213Environment.SetEnvironmentVariable("DOTNET_GENERATE_ASPNET_CERTIFICATE", "false"); 222.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries)
NuGet\NuGetPackagePrefetcherTests.cs (2)
15var workingDir = new DirectoryInfo(Environment.CurrentDirectory); 16var hivesDir = new DirectoryInfo(Path.Combine(Environment.CurrentDirectory, "hives"));
Telemetry\AspireCliTelemetryTests.cs (1)
211Assert.Contains(tags, t => t.Key == TelemetryConstants.Tags.OsVersion && t.Value is string s && s == Environment.OSVersion.Version.ToString());
tests\Shared\Logging\XunitLoggerProvider.cs (3)
45private static readonly string[] s_newLineChars = new[] { Environment.NewLine }; 96if (message.EndsWith(Environment.NewLine, StringComparison.Ordinal)) 98message = message.Substring(0, message.Length - Environment.NewLine.Length);
TestServices\TestDotNetCliRunner.cs (5)
74return Environment.OSVersion.Platform switch 76PlatformID.Win32NT => [Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "NuGet", "NuGet.Config")], 77_ => [Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget", "NuGet.Config")],
Utils\AppHostHelperTests.cs (2)
176var currentPid = Environment.ProcessId; 329var currentPid = Environment.ProcessId;
Utils\AspireRepositoryDetectorTests.cs (4)
14private readonly string? _originalRepoRoot = Environment.GetEnvironmentVariable(RepoRootEnvironmentVariableName); 23Environment.SetEnvironmentVariable(RepoRootEnvironmentVariableName, _originalRepoRoot); 54Environment.SetEnvironmentVariable(RepoRootEnvironmentVariableName, repoRoot); 68Environment.SetEnvironmentVariable(RepoRootEnvironmentVariableName, envRoot);
Aspire.Dashboard (20)
Components\Pages\Traces.razor.cs (3)
118tooltip += Environment.NewLine + string.Format(CultureInfo.InvariantCulture, Loc[nameof(Dashboard.Resources.Traces.TracesTraceId)], trace.TraceId); 129tooltip += Environment.NewLine + string.Format(CultureInfo.InvariantCulture, Loc[nameof(Dashboard.Resources.Traces.TracesTotalTraces)], count); 132tooltip += Environment.NewLine + string.Format(CultureInfo.InvariantCulture, Loc[nameof(Dashboard.Resources.Traces.TracesTotalErroredTraces)], errorCount);
DashboardWebApplication.cs (4)
950Debug.Assert(_validationFailures.Count == 0, "Validation failures: " + Environment.NewLine + string.Join(Environment.NewLine, _validationFailures)); 956Debug.Assert(_validationFailures.Count == 0, "Validation failures: " + Environment.NewLine + string.Join(Environment.NewLine, _validationFailures));
Model\Assistant\AssistantChatViewModel.cs (4)
250var resolvedMessage = message + Environment.NewLine + Environment.NewLine; 255resolvedMessage = Environment.NewLine + Environment.NewLine + resolvedMessage;
Model\GenAI\GenAIVisualizerDialogViewModel.cs (2)
169Environment.NewLine + Environment.NewLine,
Model\Markdown\MarkdownProcessor.cs (1)
27pipelineBuilder.ConfigureNewLine(Environment.NewLine);
Model\Otlp\ResourcesSelectHelpers.cs (3)
59""", name, fallback, string.Join(Environment.NewLine, resources), match); 74""", name, string.Join(Environment.NewLine, resources), string.Join(Environment.NewLine, matches));
Model\Otlp\SpanWaterfallViewModel.cs (2)
41tooltip += Environment.NewLine + "Status = Error"; 45tooltip += Environment.NewLine + $"Outgoing call to {UninstrumentedPeer}";
src\Shared\ConsoleLogs\PromptContext.cs (1)
51var value = string.Join(Environment.NewLine, uniqueLines);
Aspire.Dashboard.Components.Tests (3)
tests\Shared\Logging\XunitLoggerProvider.cs (3)
45private static readonly string[] s_newLineChars = new[] { Environment.NewLine }; 96if (message.EndsWith(Environment.NewLine, StringComparison.Ordinal)) 98message = message.Substring(0, message.Length - Environment.NewLine.Length);
Aspire.Dashboard.Tests (6)
tests\Shared\Logging\XunitLoggerProvider.cs (3)
45private static readonly string[] s_newLineChars = new[] { Environment.NewLine }; 96if (message.EndsWith(Environment.NewLine, StringComparison.Ordinal)) 98message = message.Substring(0, message.Length - Environment.NewLine.Length);
tests\Shared\Playwright\PlaywrightProvider.cs (3)
19string? browserPath = Environment.GetEnvironmentVariable(BrowserPathEnvironmentVariableName); 42if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable(PlaywrightBrowsersPathEnvironmentVariableName))) 58Environment.SetEnvironmentVariable(PlaywrightBrowsersPathEnvironmentVariableName, probePath);
Aspire.Deployment.EndToEnd.Tests (13)
Helpers\AzureAuthenticationHelpers.cs (6)
61var subscriptionId = Environment.GetEnvironmentVariable(SubscriptionEnvVar); 66subscriptionId = Environment.GetEnvironmentVariable("AZURE_SUBSCRIPTION_ID"); 98var prefix = Environment.GetEnvironmentVariable(ResourceGroupPrefixEnvVar); 114var runId = Environment.GetEnvironmentVariable("GITHUB_RUN_ID"); 176return Environment.GetEnvironmentVariable("AZURE_TENANT_ID"); 184return Environment.GetEnvironmentVariable("AZURE_CLIENT_ID");
Helpers\DeploymentE2ETestHelpers.cs (6)
21!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("GITHUB_ACTIONS")); 29var prNumberStr = Environment.GetEnvironmentVariable("GITHUB_PR_NUMBER"); 43var commitSha = Environment.GetEnvironmentVariable("GITHUB_PR_HEAD_SHA"); 53var runId = Environment.GetEnvironmentVariable("GITHUB_RUN_ID"); 63var runAttempt = Environment.GetEnvironmentVariable("GITHUB_RUN_ATTEMPT"); 107return Environment.GetEnvironmentVariable("GITHUB_STEP_SUMMARY");
tests\Shared\Hex1bTestHelpers.cs (1)
108var githubWorkspace = Environment.GetEnvironmentVariable("GITHUB_WORKSPACE");
Aspire.EndToEnd.Tests (28)
tests\Shared\Playwright\PlaywrightProvider.cs (3)
19string? browserPath = Environment.GetEnvironmentVariable(BrowserPathEnvironmentVariableName); 42if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable(PlaywrightBrowsersPathEnvironmentVariableName))) 58Environment.SetEnvironmentVariable(PlaywrightBrowsersPathEnvironmentVariableName, probePath);
tests\Shared\TemplatesTesting\AspireProject.cs (3)
312var exceptionMessage = $"{reason}: {Environment.NewLine}{outputMessage}"; 354if (Environment.GetEnvironmentVariable("DASHBOARD_URL_FOR_TEST") is string dashboardUrlForTest) 535msg += $" Content:{Environment.NewLine}{contentStr}";
tests\Shared\TemplatesTesting\BuildEnvironment.cs (9)
26: Environment.GetEnvironmentVariable("DEV_TEMP") is { } devTemp && Path.Exists(devTemp) 34public static bool IsRunningOnHelix => Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT") is not null; 35public static bool IsRunningOnCIBuildMachine => Environment.GetEnvironmentVariable("BUILD_BUILDID") is not null; 36public static bool IsRunningOnGithubActions => Environment.GetEnvironmentVariable("GITHUB_JOB") is not null; 98string? dotnetPath = Environment.GetEnvironmentVariable("PATH")! 104throw new ArgumentException($"Could not find dotnet.exe in PATH={Environment.GetEnvironmentVariable("PATH")}"); 121string? dotnetPath = Environment.GetEnvironmentVariable("PATH")! 127throw new ArgumentException($"Could not find dotnet.exe in PATH={Environment.GetEnvironmentVariable("PATH")}"); 170EnvVars["PATH"] = $"{sdkForTemplatePath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}";
tests\Shared\TemplatesTesting\CommandResult.cs (2)
39_ = message.AppendLine(CultureInfo.InvariantCulture, $"{Environment.NewLine}Standard Output:{Environment.NewLine}{Output}");
tests\Shared\TemplatesTesting\EnvironmentVariables.cs (10)
10public static readonly string? SdkForTemplateTestingPath = Environment.GetEnvironmentVariable("SDK_FOR_TEMPLATES_TESTING_PATH"); 11public static readonly string? TestLogPath = Environment.GetEnvironmentVariable("TEST_LOG_PATH"); 12public static readonly string? SkipProjectCleanup = Environment.GetEnvironmentVariable("SKIP_PROJECT_CLEANUP"); 13public static readonly string? BuiltNuGetsPath = Environment.GetEnvironmentVariable("BUILT_NUGETS_PATH"); 14public static readonly bool ShowBuildOutput = Environment.GetEnvironmentVariable("SHOW_BUILD_OUTPUT") is "true"; 16public static readonly bool TestsRunningOutsideOfRepo = Environment.GetEnvironmentVariable("TestsRunningOutsideOfRepo") is "true"; 17public static readonly string? TestScenario = Environment.GetEnvironmentVariable("TEST_SCENARIO"); 18public static readonly string? DefaultTFMForTesting = Environment.GetEnvironmentVariable("DEFAULT_TFM_FOR_TESTING"); 19public static readonly string? TestRootPath = Environment.GetEnvironmentVariable("DEV_TEMP"); 20public static readonly bool RunOnlyBasicBuildTemplatesTests = Environment.GetEnvironmentVariable("RunOnlyBasicBuildTemplateTests") is "true";
tests\Shared\TemplatesTesting\ToolCommand.cs (1)
203return string.Join(System.Environment.NewLine, outputLines);
Aspire.Hosting (44)
ApplicationModel\ResourceCommandService.cs (2)
120errorMessage += Environment.NewLine + string.Join(Environment.NewLine, failures.Select(f => $"Resource '{f.resourceId}' failed with error message: {f.result.ErrorMessage}"));
Backchannel\AuxiliaryBackchannelRpcTarget.cs (1)
360ProcessId = Environment.ProcessId,
Backchannel\AuxiliaryBackchannelService.cs (6)
62var orphansDeleted = BackchannelConstants.CleanupOrphanedSockets(directory!, hash, Environment.ProcessId); 194var homeDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); 203return BackchannelConstants.ComputeSocketPath(appHostPath, homeDirectory, Environment.ProcessId); 208var fallbackHash = BackchannelConstants.ComputeHash(Environment.ProcessId.ToString(System.Globalization.CultureInfo.InvariantCulture)); 209return Path.Combine(backchannelsDir, $"{BackchannelConstants.SocketPrefix}.{fallbackHash}.{Environment.ProcessId}");
Dashboard\DashboardEventHandlers.cs (1)
904(s, _) => (logMessage.Exception is { } e) ? s + Environment.NewLine + e : s);
Dcp\DcpDependencyCheck.cs (2)
91$"'dcp {arguments}' returned exit code {processResult.ExitCode}. {errorStringBuilder.ToString()}{Environment.NewLine}{outputStringBuilder.ToString()}" 119$"{ex.Message} {errorStringBuilder.ToString()}{Environment.NewLine}{outputStringBuilder.ToString()}"
Dcp\DcpExecutor.cs (3)
58private static readonly string s_macOSUserDevCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspire", "dev-certs", "https"); 1764var existing = Environment.GetEnvironmentVariable("SSL_CERT_DIR");
Dcp\DcpHost.cs (2)
251var arguments = $"start-apiserver --monitor {Environment.ProcessId} --detach --kubeconfig \"{locations.DcpKubeconfigPath}\""; 277foreach (DictionaryEntry de in Environment.GetEnvironmentVariables())
Devcontainers\DevcontainerSettingsWriter.cs (2)
39Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
DistributedApplication.cs (5)
249if (Environment.GetEnvironmentVariable(KnownConfigNames.WaitForDebugger) == "true") 254if (Environment.GetEnvironmentVariable(KnownConfigNames.WaitForDebuggerTimeout) is string timeoutString && int.TryParse(timeoutString, out var timeoutSeconds)) 259Console.WriteLine($"AppHost PID: {Environment.ProcessId}"); 263Console.WriteLine($"Waiting for debugger to attach to process: {Environment.ProcessId}"); 267Console.WriteLine($"Timeout waiting for debugger to attach to process: {Environment.ProcessId}");
DistributedApplicationBuilder.cs (2)
907System.Environment.GetFolderPath(System.Environment.SpecialFolder.UserProfile),
Orchestrator\ApplicationOrchestrator.cs (1)
270Url = $"{allocatedEndpoint.UriScheme}://{Environment.MachineName}:{allocatedEndpoint.Port}",
Pipelines\Internal\FileDeploymentStateManager.cs (2)
70Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
Pipelines\PipelineOutputService.cs (1)
39return _outputPath ?? Path.Combine(Environment.CurrentDirectory, "aspire-output");
ProjectResourceBuilderExtensions.cs (3)
660var value = Environment.ExpandEnvironmentVariables(envVar.Value); 894var env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? Environment.GetEnvironmentVariable("DOTNET_ENVIRONMENT");
src\Shared\BundleDiscovery.cs (1)
339var processPath = Environment.ProcessPath;
src\Shared\PathLookupHelper.cs (2)
20? Environment.GetEnvironmentVariable("PATHEXT")?.Split(';', StringSplitOptions.RemoveEmptyEntries) ?? [] 23return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, File.Exists, pathExtensions);
src\Shared\UserSecrets\UserSecretsPathHelper.cs (7)
34string? appData = Environment.GetEnvironmentVariable("APPDATA"); 36?? Environment.GetEnvironmentVariable("HOME") // On Mac/Linux it goes to ~/.microsoft/usersecrets/ 37?? Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) 38?? Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) 39?? Environment.GetEnvironmentVariable(userSecretsFallbackDir); // this fallback is an escape hatch if everything else fails
Utils\DotnetSdkUtils.cs (1)
28WorkingDirectory = workingDirectory ?? Environment.CurrentDirectory,
Aspire.Hosting.Azure (2)
src\Shared\PathLookupHelper.cs (2)
20? Environment.GetEnvironmentVariable("PATHEXT")?.Split(';', StringSplitOptions.RemoveEmptyEntries) ?? [] 23return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, File.Exists, pathExtensions);
Aspire.Hosting.Azure.CosmosDB (2)
src\Shared\AzureCredentialHelper.cs (2)
16if (Environment.GetEnvironmentVariable(DefaultAzureCredential.DefaultEnvironmentVariableName) is not null) 21if (Environment.GetEnvironmentVariable("AZURE_CLIENT_ID") is not null)
Aspire.Hosting.Azure.Kusto (2)
src\Shared\AzureCredentialHelper.cs (2)
16if (Environment.GetEnvironmentVariable(DefaultAzureCredential.DefaultEnvironmentVariableName) is not null) 21if (Environment.GetEnvironmentVariable("AZURE_CLIENT_ID") is not null)
Aspire.Hosting.Azure.Storage (2)
src\Shared\AzureCredentialHelper.cs (2)
16if (Environment.GetEnvironmentVariable(DefaultAzureCredential.DefaultEnvironmentVariableName) is not null) 21if (Environment.GetEnvironmentVariable("AZURE_CLIENT_ID") is not null)
Aspire.Hosting.Azure.Tests (6)
AzureBicepResourceTests.cs (1)
190bicepResource.Resource.TempDirectory = Environment.CurrentDirectory;
AzureContainerAppsTests.cs (2)
132builder.AddExecutable("api", "node.exe", Environment.CurrentDirectory) 172builder.AddExecutable("api", "node.exe", Environment.CurrentDirectory)
AzureDeployerTests.cs (2)
1441Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
PublicApiTests\AppContainersPublicApiTests.cs (1)
65var executable = builder.AddExecutable("api", "node.exe", Environment.CurrentDirectory);
Aspire.Hosting.CodeGeneration.Python (1)
PythonLanguageSupport.cs (1)
192var pathEnv = Environment.GetEnvironmentVariable("PATH");
Aspire.Hosting.GitHub.Models (1)
GitHubModelsExtensions.cs (1)
38Environment.GetEnvironmentVariable("GITHUB_TOKEN") ??
Aspire.Hosting.OpenAI (1)
OpenAIExtensions.cs (1)
34Environment.GetEnvironmentVariable("OPENAI_API_KEY") ??
Aspire.Hosting.Python (1)
PythonAppResourceBuilderExtensions.cs (1)
1261var pathVariable = Environment.GetEnvironmentVariable("PATH");
Aspire.Hosting.RemoteHost (1)
OrphanDetector.cs (1)
39if (Environment.GetEnvironmentVariable(HostProcessId) is not { } pidString || !int.TryParse(pidString, out var pid))
Aspire.Hosting.RemoteHost.Tests (8)
CapabilityDispatcherTests.cs (8)
716var callerThreadId = Environment.CurrentManagedThreadId; 728var callerThreadId = Environment.CurrentManagedThreadId; 740var callerThreadId = Environment.CurrentManagedThreadId; 752var callerThreadId = Environment.CurrentManagedThreadId; 1658return Environment.CurrentManagedThreadId; 1664return Environment.CurrentManagedThreadId; 1670return ValueTask.FromResult(Environment.CurrentManagedThreadId); 1676LastObservedThreadId = Environment.CurrentManagedThreadId;
Aspire.Hosting.Testing (1)
DistributedApplicationFactory.cs (1)
446if (uint.TryParse(Environment.GetEnvironmentVariable(TimeoutEnvironmentKey), out var timeoutInSeconds))
Aspire.Hosting.Testing.Tests (3)
tests\Shared\Logging\XunitLoggerProvider.cs (3)
45private static readonly string[] s_newLineChars = new[] { Environment.NewLine }; 96if (message.EndsWith(Environment.NewLine, StringComparison.Ordinal)) 98message = message.Substring(0, message.Length - Environment.NewLine.Length);
Aspire.Hosting.Tests (34)
AppHostSmokeTests.cs (1)
44Environment.SetEnvironmentVariable(envVar, loc);
Dashboard\DashboardLifecycleHookTests.cs (1)
644$"Error message{Environment.NewLine}System.InvalidOperationException: Error!",
Dcp\DcpExecutorTests.cs (20)
271var exe = builder.AddExecutable("CoolProgram", "cool", Environment.CurrentDirectory, "--alpha", "--bravo") 303var exe = builder.AddExecutable("CoolProgram", "cool", Environment.CurrentDirectory, "--alpha", "--bravo") 335var exe = builder.AddExecutable("CoolProgram", "cool", Environment.CurrentDirectory, "--alpha", "--bravo") 368var exe = builder.AddExecutable("CoolProgram", "cool", Environment.CurrentDirectory, "--alpha", "--bravo") 405builder.AddExecutable("CoolProgram", "cool", Environment.CurrentDirectory, "--alpha", "--bravo") 422builder.AddExecutable("CoolProgram", "cool", Environment.CurrentDirectory, "--alpha", "--bravo") 456builder.AddExecutable("CoolProgram", "cool", Environment.CurrentDirectory, "--alpha", "--bravo") 490builder.AddExecutable("CoolProgram", "cool", Environment.CurrentDirectory, "--alpha", "--bravo") 557var exe = builder.AddExecutable("CoolProgram", "cool", Environment.CurrentDirectory, "--alpha", "--bravo"); 651await pipes.StandardOut.Writer.WriteAsync(Encoding.UTF8.GetBytes("2024-08-19T06:10:33.473275911Z Hello world" + Environment.NewLine)); 662await pipes.StandardErr.Writer.WriteAsync(Encoding.UTF8.GetBytes("2024-08-19T06:10:32.661Z Next" + Environment.NewLine)); 706return new MemoryStream(Encoding.UTF8.GetBytes("2024-08-19T06:10:01.000Z First" + Environment.NewLine)); 708return new MemoryStream(Encoding.UTF8.GetBytes("2024-08-19T06:10:02.000Z Second" + Environment.NewLine)); 710return new MemoryStream(Encoding.UTF8.GetBytes("2024-08-19T06:10:03.000Z Third" + Environment.NewLine)); 713"2024-08-19T06:10:05.000Z Sixth" + Environment.NewLine + 714"2024-08-19T06:10:05.000Z Seventh" + Environment.NewLine + 715"2024-08-19T06:10:04.000Z Forth" + Environment.NewLine + 716"2024-08-19T06:10:04.000Z Fifth" + Environment.NewLine)); 795"2024-08-19T06:10:01.000Z\tinfo\tdcp.ExecutableReconciler\tStarting process...\t{\"Executable\": \"/foo-pwrqgpew\", \"Reconciliation\": 4, \"Cmd\": \"bla\", \"Args\": []}" + Environment.NewLine + 796"2024-08-19T06:10:02.000Z\terror\tdcp.ExecutableReconciler\tFailed to start process\t{\"Executable\": \"/foo-pwrqgpew\", \"Reconciliation\": 4, \"Cmd\": \"bla\", \"Args\": [], \"error\": \"exec: \\\"bla\\\": executable file not found in $PATH\"}" + Environment.NewLine;
MSBuildTests.cs (1)
250Assert.True(process.ExitCode == 0, $"Build failed: {Environment.NewLine}{output}");
ProjectResourceTests.cs (1)
542: $",{Environment.NewLine} \"ASPNETCORE_FORWARDEDHEADERS_ENABLED\": \"true\"";
Schema\SchemaTests.cs (1)
803Assert.True(results.IsValid, string.Join(Environment.NewLine, errorMessages ?? ["Schema failed validation with no errors"]));
tests\Shared\Logging\XunitLoggerProvider.cs (3)
45private static readonly string[] s_newLineChars = new[] { Environment.NewLine }; 96if (message.EndsWith(Environment.NewLine, StringComparison.Ordinal)) 98message = message.Substring(0, message.Length - Environment.NewLine.Length);
Utils\ManifestUtils.cs (3)
22manifestDirectory ??= Environment.CurrentDirectory; 47manifestDirectory ??= Environment.CurrentDirectory; 75var context = new ManifestPublishingContext(executionContext, Path.Combine(Environment.CurrentDirectory, "manifest.json"), writer);
Utils\UnixSocketHelper.cs (2)
10var homeDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
WithEndpointTests.cs (1)
654url => Assert.StartsWith($"https://{Environment.MachineName}:", url.Url));
Aspire.Microsoft.Azure.Cosmos (2)
src\Shared\AzureCredentialHelper.cs (2)
16if (Environment.GetEnvironmentVariable(DefaultAzureCredential.DefaultEnvironmentVariableName) is not null) 21if (Environment.GetEnvironmentVariable("AZURE_CLIENT_ID") is not null)
Aspire.Microsoft.Azure.StackExchangeRedis (2)
src\Shared\AzureCredentialHelper.cs (2)
16if (Environment.GetEnvironmentVariable(DefaultAzureCredential.DefaultEnvironmentVariableName) is not null) 21if (Environment.GetEnvironmentVariable("AZURE_CLIENT_ID") is not null)
Aspire.Microsoft.EntityFrameworkCore.Cosmos (2)
src\Shared\AzureCredentialHelper.cs (2)
16if (Environment.GetEnvironmentVariable(DefaultAzureCredential.DefaultEnvironmentVariableName) is not null) 21if (Environment.GetEnvironmentVariable("AZURE_CLIENT_ID") is not null)
Aspire.OpenAI (1)
src\Components\Common\AITelemetryHelpers.cs (1)
16Environment.GetEnvironmentVariable(KnownOtelConfigNames.InstrumentationGenAiCaptureMessageContent) is string envVar &&
Aspire.Playground.Tests (10)
AppHostTests.cs (1)
24private static readonly string? s_appHostNameFilter = Environment.GetEnvironmentVariable("TEST_PLAYGROUND_APPHOST_FILTER");
src\Shared\PathLookupHelper.cs (2)
20? Environment.GetEnvironmentVariable("PATHEXT")?.Split(';', StringSplitOptions.RemoveEmptyEntries) ?? [] 23return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, File.Exists, pathExtensions);
tests\Aspire.TestUtilities\PlatformDetection.cs (3)
8public static bool IsRunningOnAzdoBuildMachine => Environment.GetEnvironmentVariable("BUILD_BUILDID") is not null; 9public static bool IsRunningOnHelix => Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT") is not null; 10public static bool IsRunningOnGithubActions => Environment.GetEnvironmentVariable("GITHUB_JOB") is not null;
tests\Aspire.TestUtilities\RequiresFeatureAttribute.cs (1)
77if (Environment.GetEnvironmentVariable("PLAYWRIGHT_INSTALLED") is var playwrightInstalled && !string.IsNullOrEmpty(playwrightInstalled))
tests\Shared\Logging\XunitLoggerProvider.cs (3)
45private static readonly string[] s_newLineChars = new[] { Environment.NewLine }; 96if (message.EndsWith(Environment.NewLine, StringComparison.Ordinal)) 98message = message.Substring(0, message.Length - Environment.NewLine.Length);
Aspire.Templates.Tests (28)
tests\Shared\Playwright\PlaywrightProvider.cs (3)
19string? browserPath = Environment.GetEnvironmentVariable(BrowserPathEnvironmentVariableName); 42if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable(PlaywrightBrowsersPathEnvironmentVariableName))) 58Environment.SetEnvironmentVariable(PlaywrightBrowsersPathEnvironmentVariableName, probePath);
tests\Shared\TemplatesTesting\AspireProject.cs (3)
312var exceptionMessage = $"{reason}: {Environment.NewLine}{outputMessage}"; 354if (Environment.GetEnvironmentVariable("DASHBOARD_URL_FOR_TEST") is string dashboardUrlForTest) 535msg += $" Content:{Environment.NewLine}{contentStr}";
tests\Shared\TemplatesTesting\BuildEnvironment.cs (9)
26: Environment.GetEnvironmentVariable("DEV_TEMP") is { } devTemp && Path.Exists(devTemp) 34public static bool IsRunningOnHelix => Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT") is not null; 35public static bool IsRunningOnCIBuildMachine => Environment.GetEnvironmentVariable("BUILD_BUILDID") is not null; 36public static bool IsRunningOnGithubActions => Environment.GetEnvironmentVariable("GITHUB_JOB") is not null; 98string? dotnetPath = Environment.GetEnvironmentVariable("PATH")! 104throw new ArgumentException($"Could not find dotnet.exe in PATH={Environment.GetEnvironmentVariable("PATH")}"); 121string? dotnetPath = Environment.GetEnvironmentVariable("PATH")! 127throw new ArgumentException($"Could not find dotnet.exe in PATH={Environment.GetEnvironmentVariable("PATH")}"); 170EnvVars["PATH"] = $"{sdkForTemplatePath}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}";
tests\Shared\TemplatesTesting\CommandResult.cs (2)
39_ = message.AppendLine(CultureInfo.InvariantCulture, $"{Environment.NewLine}Standard Output:{Environment.NewLine}{Output}");
tests\Shared\TemplatesTesting\EnvironmentVariables.cs (10)
10public static readonly string? SdkForTemplateTestingPath = Environment.GetEnvironmentVariable("SDK_FOR_TEMPLATES_TESTING_PATH"); 11public static readonly string? TestLogPath = Environment.GetEnvironmentVariable("TEST_LOG_PATH"); 12public static readonly string? SkipProjectCleanup = Environment.GetEnvironmentVariable("SKIP_PROJECT_CLEANUP"); 13public static readonly string? BuiltNuGetsPath = Environment.GetEnvironmentVariable("BUILT_NUGETS_PATH"); 14public static readonly bool ShowBuildOutput = Environment.GetEnvironmentVariable("SHOW_BUILD_OUTPUT") is "true"; 16public static readonly bool TestsRunningOutsideOfRepo = Environment.GetEnvironmentVariable("TestsRunningOutsideOfRepo") is "true"; 17public static readonly string? TestScenario = Environment.GetEnvironmentVariable("TEST_SCENARIO"); 18public static readonly string? DefaultTFMForTesting = Environment.GetEnvironmentVariable("DEFAULT_TFM_FOR_TESTING"); 19public static readonly string? TestRootPath = Environment.GetEnvironmentVariable("DEV_TEMP"); 20public static readonly bool RunOnlyBasicBuildTemplatesTests = Environment.GetEnvironmentVariable("RunOnlyBasicBuildTemplateTests") is "true";
tests\Shared\TemplatesTesting\ToolCommand.cs (1)
203return string.Join(System.Environment.NewLine, outputLines);
Aspire.TestUtilities (6)
PlatformDetection.cs (3)
8public static bool IsRunningOnAzdoBuildMachine => Environment.GetEnvironmentVariable("BUILD_BUILDID") is not null; 9public static bool IsRunningOnHelix => Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT") is not null; 10public static bool IsRunningOnGithubActions => Environment.GetEnvironmentVariable("GITHUB_JOB") is not null;
RequiresFeatureAttribute.cs (1)
77if (Environment.GetEnvironmentVariable("PLAYWRIGHT_INSTALLED") is var playwrightInstalled && !string.IsNullOrEmpty(playwrightInstalled))
src\Shared\PathLookupHelper.cs (2)
20? Environment.GetEnvironmentVariable("PATHEXT")?.Split(';', StringSplitOptions.RemoveEmptyEntries) ?? [] 23return FindFullPathFromPath(command, Environment.GetEnvironmentVariable("PATH"), Path.PathSeparator, File.Exists, pathExtensions);
aspire-managed (6)
NuGet\Commands\LayoutCommand.cs (2)
110Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
NuGet\Commands\RestoreCommand.cs (4)
148Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), 197DisableParallel = Environment.ProcessorCount == 1, 218var errors = string.Join(Environment.NewLine,
Client.TypedClient.IntegrationTests (3)
TypedProxyTests.4.0.0.cs (3)
192int startThread = Environment.CurrentManagedThreadId; 195Assert.True(startThread == Environment.CurrentManagedThreadId, String.Format("Expected continuation to happen on thread {0} but actually continued on thread {1}", 196startThread, Environment.CurrentManagedThreadId));
CodeStyleConfigFileGenerator (3)
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
ConfigurationSchemaGenerator (2)
ConfigSchemaGenerator.cs (2)
35if (!schema.EndsWith(Environment.NewLine)) 38schema += Environment.NewLine;
crossgen2 (4)
Crossgen2RootCommand.cs (2)
369var parallelism = Math.Min(24, Environment.ProcessorCount); 372if (!Environment.Is64BitProcess)
src\runtime\src\coreclr\tools\Common\CommandLineHelpers.cs (2)
179details.Add(Environment.GetCommandLineArgs()[0]); 184details.Add(System.Diagnostics.FileVersionInfo.GetVersionInfo(Environment.GetCommandLineArgs()[0]).ToString());
Crossgen2Tasks (4)
CommonFilePulledFromSdkRepo\TaskBase.cs (4)
70Environment.NewLine, 74Environment.NewLine); 95s = s + " ---> " + ExceptionToStringWithoutMessage(e.InnerException) + Environment.NewLine + 104s += Environment.NewLine + stackTrace;
csc (13)
src\roslyn\src\Compilers\Shared\BuildClient.cs (1)
151var libDirectory = Environment.GetEnvironmentVariable("LIB");
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (4)
221var originalThreadId = Environment.CurrentManagedThreadId; 282var releaseThreadId = Environment.CurrentManagedThreadId; 563var environmentVariables = GetServerEnvironmentVariables(Environment.GetEnvironmentVariables(), logger); 683var userName = Environment.UserName;
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (3)
120loggingFilePath = Environment.GetEnvironmentVariable(EnvironmentVariableName); 153var threadId = Environment.CurrentManagedThreadId; 155string output = prefix + message + Environment.NewLine;
src\roslyn\src\Compilers\Shared\Csc.cs (1)
18: base(CSharpCommandLineParser.Default, responseFile, args, buildPaths, Environment.GetEnvironmentVariable("LIB"), analyzerLoader)
src\roslyn\src\Compilers\Shared\ExitingTraceListener.cs (1)
58Environment.FailFast(message);
src\roslyn\src\Compilers\Shared\RuntimeHostInfo.cs (3)
78if (Environment.GetEnvironmentVariable(DotNetHostPathEnvironmentName) is { Length: > 0 } pathToDotNet) 83if (Environment.GetEnvironmentVariable(DotNetExperimentalHostPathEnvironmentName) is { Length: > 0 } pathToDotNetExperimental) 92var path = Environment.GetEnvironmentVariable("PATH") ?? "";
CSharpSyntaxGenerator (10)
Grammar\GrammarGenerator.cs (7)
95var result = "// <auto-generated />" + Environment.NewLine + "grammar csharp;" + Environment.NewLine; 109result += Environment.NewLine + RuleReference(name).Text + Environment.NewLine + " : " + 110string.Join(Environment.NewLine + " | ", sorted) + Environment.NewLine + " ;" + Environment.NewLine;
Program.cs (3)
172text = text.Replace($"{{{Environment.NewLine}{Environment.NewLine}", $"{{{Environment.NewLine}");
datacollector (8)
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (8)
36var debugEnabled = Environment.GetEnvironmentVariable(environmentVariable); 55Environment.ProcessId; 76var vsAttachPath = Environment.GetEnvironmentVariable(env) ?? FindAttachVs(); 79Environment.SetEnvironmentVariable(env, vsAttachPath); 104var paths = Environment.GetEnvironmentVariable("PATH")!.Split(';'); 127var debugEnabled = Environment.GetEnvironmentVariable(environmentVariable); 154var nativeDebugEnabled = Environment.GetEnvironmentVariable(environmentVariable); 180return Environment.GetEnvironmentVariable("VSTEST_DEBUG_NOBP")?.Equals("1") ?? false;
datacollector.arm64 (8)
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (8)
36var debugEnabled = Environment.GetEnvironmentVariable(environmentVariable); 55Environment.ProcessId; 76var vsAttachPath = Environment.GetEnvironmentVariable(env) ?? FindAttachVs(); 79Environment.SetEnvironmentVariable(env, vsAttachPath); 104var paths = Environment.GetEnvironmentVariable("PATH")!.Split(';'); 127var debugEnabled = Environment.GetEnvironmentVariable(environmentVariable); 154var nativeDebugEnabled = Environment.GetEnvironmentVariable(environmentVariable); 180return Environment.GetEnvironmentVariable("VSTEST_DEBUG_NOBP")?.Equals("1") ?? false;
dotnet (141)
BuildServer\VBCSCompilerServer.cs (1)
61string.Join(Environment.NewLine, errors)));
CommandFactory\CommandResolution\ProjectToolsCommandResolver.cs (2)
117string.Join(Environment.NewLine, possiblePackageRoots.Select((p) => $"- {p}")))); 432stdOut + Environment.NewLine + stdErr));
CommandFactory\CommandResolution\WindowsExePreferredCommandSpecFactory.cs (3)
51var comSpec = Environment.GetEnvironmentVariable("ComSpec") ?? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "cmd.exe");
Commands\Help\HelpCommand.cs (2)
52FileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "cmd.exe"),
Commands\Hidden\InternalReportInstallSuccess\InternalReportInstallSuccessCommand.cs (1)
44var sessionId = Environment.GetEnvironmentVariable(EnvironmentVariableNames.DOTNET_CLI_TELEMETRY_SESSIONID);
Commands\MSBuild\MSBuildLogger.cs (1)
65string? sessionId = Environment.GetEnvironmentVariable(EnvironmentVariableNames.DOTNET_CLI_TELEMETRY_SESSIONID);
Commands\New\NewCommandParser.cs (1)
126string? preferredLangEnvVar = Environment.GetEnvironmentVariable(PrefferedLangEnvVarName);
Commands\New\SdkInfoProvider.cs (1)
44: Environment.GetEnvironmentVariable(key),
Commands\NuGet\NuGetCommand.cs (3)
72var originalDotNetHostPath = Environment.GetEnvironmentVariable(EnvironmentVariableNames.DOTNET_HOST_PATH); 73Environment.SetEnvironmentVariable(EnvironmentVariableNames.DOTNET_HOST_PATH, GetDotnetPath()); 80Environment.SetEnvironmentVariable(EnvironmentVariableNames.DOTNET_HOST_PATH, originalDotNetHostPath);
Commands\Package\PackageCommandParser.cs (1)
108: (Environment.CurrentDirectory, AppKinds.ProjectBased),
Commands\Project\Convert\ProjectConvertCommand.cs (1)
599string defaultValueRelative = Path.GetRelativePath(relativeTo: Environment.CurrentDirectory, defaultValue);
Commands\Run\CSharpCompilerCommand.cs (2)
86Environment.SetEnvironmentVariable("DOTNET_HOST_PATH", new Muxer().MuxerPath); 105identifier: $"dotnet run file {Environment.ProcessId}",
Commands\Run\FileBasedAppSourceEditor.cs (1)
75_ => Environment.NewLine,
Commands\Run\RunCommand.cs (1)
661if (rootVariableName != null && string.IsNullOrEmpty(Environment.GetEnvironmentVariable(rootVariableName)))
Commands\Run\VirtualProjectBuildingCommand.cs (5)
282savedEnvironmentVariables[key] = Environment.GetEnvironmentVariable(key); 283Environment.SetEnvironmentVariable(key, value); 394Environment.SetEnvironmentVariable(key, value); 595File.WriteAllText(path: resultOutputFile, contents: result + Environment.NewLine); 697stream.Write(Encoding.UTF8.GetBytes(Environment.NewLine));
Commands\Test\MTP\IPC\Serializers\UnknownMessageSerializer.cs (1)
18=> Environment.FailFast("SDK never serializes UnknownMessage. This should never be hit.");
Commands\Test\MTP\Logger.cs (1)
57_traceFilePath = Environment.GetEnvironmentVariable(CliConstants.TestTraceLoggingEnvVar);
Commands\Test\MTP\MicrosoftTestingPlatformTestCommand.cs (3)
89bool inCI = string.Equals(Environment.GetEnvironmentVariable("TF_BUILD"), "true", StringComparison.OrdinalIgnoreCase) || string.Equals(Environment.GetEnvironmentVariable("GITHUB_ACTIONS"), "true", StringComparison.OrdinalIgnoreCase); 134degreeOfParallelism = Environment.ProcessorCount;
Commands\Test\MTP\MSBuildHandler.cs (1)
50string.Join(Environment.NewLine, vsTestTestProjects.Select(module => Path.GetFileName(module.ProjectFullPath))).Red().Bold()));
Commands\Test\MTP\MSBuildUtility.cs (2)
283bool throwOnUnexpectedFilePassedAsNonFirstPositionalArgument = Environment.GetEnvironmentVariable("DOTNET_TEST_DISABLE_SWITCH_VALIDATION") is not ("true" or "1"); 415new ParallelOptions { MaxDegreeOfParallelism = Environment.ProcessorCount },
Commands\Test\MTP\SolutionAndProjectUtility.cs (1)
492if (rootVariableName is not null && Environment.GetEnvironmentVariable(rootVariableName) != null)
Commands\Test\MTP\Terminal\NativeMethods.cs (1)
78acceptAnsiColorCodes = AnsiDetector.IsAnsiSupported(Environment.GetEnvironmentVariable("TERM"));
Commands\Test\MTP\TestApplication.cs (5)
106_handler.OnTestProcessExited(exitCode, string.Join(Environment.NewLine, stdOutBuilder), string.Join(Environment.NewLine, stdErrBuilder)); 244Environment.FailFast(exAsString); 318Environment.FailFast(exAsString); 353{ HandshakeMessagePropertyNames.PID, Environment.ProcessId.ToString(CultureInfo.InvariantCulture) },
Commands\Test\VSTest\TestCommand.cs (9)
30string testSessionCorrelationId = $"{Environment.ProcessId}_{Guid.NewGuid()}"; 85string? previousNodeWindowSetting = Environment.GetEnvironmentVariable(NodeWindowEnvironmentName); 137Environment.SetEnvironmentVariable(NodeWindowEnvironmentName, previousNodeWindowSetting); 145Environment.SetEnvironmentVariable(NodeWindowEnvironmentName, "1"); 188testSessionCorrelationId = $"{Environment.ProcessId}_{Guid.NewGuid()}"; 409if (Environment.GetEnvironmentVariable("MSBUILDENSURESTDOUTFORTASKPROCESSES") == "1") 490string? liveLoggerArg = Environment.GetEnvironmentVariable("MSBUILDLIVELOGGER"); 491terminalLoggerArg = Environment.GetEnvironmentVariable("MSBUILDTERMINALLOGGER"); 639acceptAnsiColorCodes = AnsiDetector.IsAnsiSupported(Environment.GetEnvironmentVariable("TERM"));
Commands\Test\VSTest\VSTestFeatureFlag.cs (1)
22public bool IsSet(string featureFlag) => _cache.GetOrAdd(featureFlag, f => (Environment.GetEnvironmentVariable(f)?.Trim() ?? "0") != "0");
Commands\Test\VSTest\VSTestForwardingApp.cs (1)
32string vsTestConsolePath = Environment.GetEnvironmentVariable("VSTEST_CONSOLE_PATH");
Commands\Test\VSTest\VSTestTrace.cs (2)
15TraceEnabled = int.TryParse(Environment.GetEnvironmentVariable("DOTNET_CLI_VSTEST_TRACE"), out int enabled) && enabled == 1; 16s_traceFilePath = Environment.GetEnvironmentVariable("DOTNET_CLI_VSTEST_TRACEFILE");
Commands\Tool\Common\ToolManifestFinderExtensions.cs (1)
44Environment.NewLine,
Commands\Tool\Restore\ToolRestoreCommand.cs (9)
95_reporter.WriteLine(string.Join(Environment.NewLine, e.VerboseMessage).Yellow()); 135Environment.NewLine, 142_reporter.WriteLine(string.Join(Environment.NewLine, successMessage)); 149_reporter.WriteLine(string.Join(Environment.NewLine, warnings).Yellow()); 153_errorReporter.WriteLine(Environment.NewLine + 162_reporter.WriteLine(string.Join(Environment.NewLine, 170_reporter.WriteLine(string.Join(Environment.NewLine, warnings).Yellow()); 204string.Join(Environment.NewLine, 213throw new ToolPackageException(string.Join(Environment.NewLine, errors));
Commands\VSTest\VSTestCommand.cs (1)
21string testSessionCorrelationId = $"{Environment.ProcessId}_{Guid.NewGuid()}";
Commands\Workload\Config\WorkloadConfigCommand.cs (1)
53string? globalJsonPath = SdkDirectoryWorkloadManifestProvider.GetGlobalJsonPath(Environment.CurrentDirectory);
Commands\Workload\Install\FileBasedInstaller.cs (1)
60_dotnetDir = dotnetDir ?? Path.GetDirectoryName(Environment.ProcessPath);
Commands\Workload\Install\WorkloadInstallerFactory.cs (2)
31dotnetDir = string.IsNullOrWhiteSpace(dotnetDir) ? Path.GetDirectoryName(Environment.ProcessPath) : dotnetDir; 99dotnetDir ??= Path.GetDirectoryName(Environment.ProcessPath);
Commands\Workload\Install\WorkloadManifestUpdater.cs (4)
55_getEnvironmentVariable = getEnvironmentVariable ?? Environment.GetEnvironmentVariable; 64var dotnetPath = Path.GetDirectoryName(Environment.ProcessPath); 66var workloadManifestProvider = new SdkDirectoryWorkloadManifestProvider(dotnetPath, sdkVersion, userProfileDir, SdkDirectoryWorkloadManifestProvider.GetGlobalJsonPath(Environment.CurrentDirectory)); 172var backgroundUpdatesDisabled = bool.TryParse(Environment.GetEnvironmentVariable(EnvironmentVariableNames.WORKLOAD_UPDATE_NOTIFY_DISABLE), out var disableEnvVar) && disableEnvVar;
Commands\Workload\Install\WorkloadResolverFactory.cs (2)
36result.DotnetPath = Path.GetDirectoryName(Environment.ProcessPath); 38globalJsonStartDir = globalJsonStartDir ?? Environment.CurrentDirectory;
Commands\Workload\InstallingWorkloadCommand.cs (1)
135_globalJsonPath = SdkDirectoryWorkloadManifestProvider.GetGlobalJsonPath(Environment.CurrentDirectory);
Commands\Workload\Search\WorkloadSearchVersionsCommand.cs (1)
75dotnetDir: Path.GetDirectoryName(Environment.ProcessPath),
Commands\Workload\WorkloadHistoryRecorder.cs (1)
25HistoryRecord.CommandLineArgs = Environment.GetCommandLineArgs();
Commands\Workload\WorkloadInfoHelper.cs (3)
36DotnetPath = dotnetDir ?? Path.GetDirectoryName(Environment.ProcessPath)!; 47userProfileDir, SdkDirectoryWorkloadManifestProvider.GetGlobalJsonPath(Environment.CurrentDirectory)); 161var dotnetPath = dotnetDir ?? Path.GetDirectoryName(Environment.ProcessPath);
Extensions\ParseResultExtensions.cs (1)
57message: string.Join(Environment.NewLine, parseResult.Errors.Select(e => e.Message)),
MsbuildProject.cs (2)
193Environment.SetEnvironmentVariable("DOTNET_HOST_PATH", new Muxer().MuxerPath); 217Environment.SetEnvironmentVariable("DOTNET_HOST_PATH", null);
NugetPackageDownloader\FirstPartyNuGetPackageSigningVerifier.cs (1)
152commandOutput = commandResult.StdOut + Environment.NewLine + commandResult.StdErr;
NugetPackageDownloader\NuGetPackageDownloader.cs (1)
103|| (bool.TryParse(Environment.GetEnvironmentVariable(NuGetSignatureVerificationEnabler.DotNetNuGetSignatureVerification), out var shouldVerifySignature)
ParserOptionActions.cs (1)
49Environment.SetEnvironmentVariable(CommandLoggingContext.Variables.Verbose, bool.TrueString);
Program.cs (3)
79s_globalJsonState = NativeWrapper.NETCoreSdkResolverNativeWrapper.GetGlobalJsonState(Environment.CurrentDirectory); 89Environment.SetEnvironmentVariable("MSBUILDFAILONDRIVEENUMERATINGWILDCARD", "1"); 97using var termSignalRegistration = PosixSignalRegistration.Create(PosixSignal.SIGTERM, _ => Environment.Exit(0));
ReleasePropertyProjectLocator.cs (2)
49if (string.Equals(Environment.GetEnvironmentVariable(EnvironmentVariableNames.DISABLE_PUBLISH_AND_PACK_RELEASE), "true", StringComparison.OrdinalIgnoreCase)) 156if (string.Equals(Environment.GetEnvironmentVariable(EnvironmentVariableNames.DOTNET_CLI_LAZY_PUBLISH_AND_PACK_RELEASE_FOR_SOLUTIONS), "true", StringComparison.OrdinalIgnoreCase))
SdkVulnerability\SdkReleaseMetadataCache.cs (1)
29Environment.GetEnvironmentVariable)
ShellShim\LinuxEnvironmentPath.cs (1)
21Environment.GetEnvironmentVariable("DOTNET_CLI_TEST_LINUX_PROFILED_PATH") ??
ShellShim\OsxBashEnvironmentPath.cs (1)
25internal static readonly string DotnetCliToolsPathsDPath = Environment.GetEnvironmentVariable("DOTNET_CLI_TEST_OSX_PATHSD_PATH") ?? @"/etc/paths.d/dotnet-cli-tools";
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.9.0-1.26307.102\contentFiles\cs\net11.0\BuildServerConnection.cs (4)
221var originalThreadId = Environment.CurrentManagedThreadId; 282var releaseThreadId = Environment.CurrentManagedThreadId; 563var environmentVariables = GetServerEnvironmentVariables(Environment.GetEnvironmentVariables(), logger); 683var userName = Environment.UserName;
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.9.0-1.26307.102\contentFiles\cs\net11.0\CompilerServerLogger.cs (3)
120loggingFilePath = Environment.GetEnvironmentVariable(EnvironmentVariableName); 153var threadId = Environment.CurrentManagedThreadId; 155string output = prefix + message + Environment.NewLine;
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.9.0-1.26307.102\contentFiles\cs\net11.0\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.9.0-1.26307.102\contentFiles\cs\net11.0\RuntimeHostInfo.cs (3)
78if (Environment.GetEnvironmentVariable(DotNetHostPathEnvironmentName) is { Length: > 0 } pathToDotNet) 83if (Environment.GetEnvironmentVariable(DotNetExperimentalHostPathEnvironmentName) is { Length: > 0 } pathToDotNetExperimental) 92var path = Environment.GetEnvironmentVariable("PATH") ?? "";
src\sdk\src\Common\EnvironmentVariableNames.cs (2)
67=> TryGetDotNetRootVariableNameImpl(runtimeIdentifier, defaultAppHostRuntimeIdentifier, targetFrameworkVersion, RuntimeInformation.ProcessArchitecture, Environment.Is64BitProcess); 88=> TryGetDotNetRootVariableNameImpl(runtimeIdentifier, defaultAppHostRuntimeIdentifier, null, RuntimeInformation.ProcessArchitecture, Environment.Is64BitProcess, onlyUseArchSpecific: true);
SudoEnvironmentDirectoryOverride.cs (3)
28if (!string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("SUDO_UID"))) 41var homeBeforeOverride = Environment.GetEnvironmentVariable(CliFolderPathCalculator.DotnetHomeVariableName); 42Environment.SetEnvironmentVariable(CliFolderPathCalculator.DotnetHomeVariableName, sudoHome);
Telemetry\DevDeviceIDGetter.cs (10)
53string xdgCacheHome = Environment.GetEnvironmentVariable("XDG_CACHE_HOME"); 60cacheFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".cache", "deviceid"); 71string cacheFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Library", "Application Support", "Microsoft", "DeveloperTools", "deviceid"); 101string xdgCacheHome = Environment.GetEnvironmentVariable("XDG_CACHE_HOME"); 108cacheFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".cache", "deviceid"); 116string cacheFilePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Library", "Application Support", "Microsoft", "DeveloperTools", "deviceid");
Telemetry\ExternalTelemetryProperties.cs (2)
60if (GetProductInfo((uint)Environment.OSVersion.Version.Major, (uint)Environment.OSVersion.Version.Minor, 0, 0, out uint productType))
Telemetry\MacAddressGetter.cs (2)
92FileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "getmac.exe"),
Telemetry\TelemetryCommonProperties.cs (1)
65{ TelemetryProfile, Environment.GetEnvironmentVariable(TelemetryProfileEnvironmentVariable) },
Telemetry\TelemetryFilter.cs (4)
139Environment.NewLine, 143Environment.NewLine); 162s = s + " ---> " + ExceptionToStringWithoutMessage(e.InnerException) + Environment.NewLine + 169s += Environment.NewLine + stackTrace;
ToolManifest\ToolManifestEditor.cs (2)
282var joinedWithIndentation = string.Join(Environment.NewLine, 303string.Join(Environment.NewLine, errors.Select(e => "\t" + e))));
ToolManifest\ToolManifestFinder.cs (4)
31_getEnvironmentVariable = getEnvironmentVariable ?? Environment.GetEnvironmentVariable; 44throw new ToolManifestCannotBeFoundException(string.Format(CliStrings.CannotFindAManifestFile, string.Join(Environment.NewLine, allPossibleManifests.Select(f => "\t" + f.manifestfile.Value)))); 210throw new ToolManifestCannotBeFoundException(string.Format(CliStrings.CannotFindAManifestFile, string.Join(Environment.NewLine, EnumerateDefaultAllPossibleManifests().Select(f => "\t" + f.manifestfile.Value)))); 297throw new ToolManifestCannotBeFoundException(string.Format(CliStrings.CannotFindAManifestFile, string.Join(Environment.NewLine, EnumerateDefaultAllPossibleManifests().Select(f => "\t" + f.manifestfile.Value))));
ToolPackage\ToolPackageDownloader.cs (2)
180currentTargetFramework = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCoreApp, new Version(Environment.Version.Major, Environment.Version.Minor));
ToolPackage\ToolPackageInstance.cs (2)
193var currentFramework = new NuGetFramework(FrameworkConstants.FrameworkIdentifiers.NetCoreApp, new Version(Environment.Version.Major, Environment.Version.Minor));
dotnet-dev-certs (25)
Program.cs (3)
405"already trusted we will run the following command:" + Environment.NewLine + 407Environment.NewLine + "This command might prompt you for your password to install the certificate " + 408"on the keychain. To undo these changes: 'security remove-trusted-cert <<certificate>>'" + Environment.NewLine);
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (1)
1042return string.Join(Environment.NewLine, description);
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
26private static readonly string MacOSUserKeychain = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + "/Library/Keychains/login.keychain-db"; 34private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https");
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (14)
62if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable(OpenSslCertDirectoryOverrideVariableName))) 102var sslCertDirString = Environment.GetEnvironmentVariable(OpenSslCertificateDirectoryVariableName); 137var nssDbs = GetNssDbs(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)); 233var homeDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); 367var existingSslCertDir = Environment.GetEnvironmentVariable(OpenSslCertificateDirectoryVariableName); 464var homeDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)!; 593var searchPath = Environment.GetEnvironmentVariable("PATH"); 653if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("WSL_INTEROP"))) 806var @override = Environment.GetEnvironmentVariable(OpenSslCertDirectoryOverrideVariableName); 832var nssDbOverride = Environment.GetEnvironmentVariable(NssDbOverrideVariableName); 879Log.UnixHomeDirectoryDoesNotExist(homeDirectory, Environment.UserName);
src\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
48if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
src\aspnetcore\src\Tools\Shared\CommandLine\CliContext.cs (1)
20bool.TryParse(Environment.GetEnvironmentVariable("DOTNET_CLI_CONTEXT_VERBOSE"), out bool globalVerbose);
src\aspnetcore\src\Tools\Shared\CommandLine\DebugHelper.cs (1)
24Console.WriteLine($"Process ID: {Environment.ProcessId}");
dotnet-format (7)
Commands\FormatCommandCommon.cs (2)
246Environment.Exit(CheckFailedExitCode); 312var currentDirectory = Environment.CurrentDirectory;
Formatters\EndOfLineFormatter.cs (2)
84_ => Environment.NewLine, 95_ => GetEndOfLineOption(Environment.NewLine),
Formatters\FinalNewlineFormatter.cs (1)
35endOfLine = Environment.NewLine;
ReportWriter.cs (1)
41return Path.Combine(Environment.CurrentDirectory, defaultReportName);
Utilities\DotNetHelper.cs (1)
15logger.LogDebug(string.Join(Environment.NewLine, restoreResult.OutputLines));
dotnet-Microsoft.XmlSerializer.Generator (1)
Sgen.cs (1)
322outputDirectory ??= (gac ? Environment.CurrentDirectory : Path.GetDirectoryName(assembly.Location));
dotnet-sourcelink (3)
dotnet-suggest (8)
DotnetProfileDirectory.cs (2)
20var home = Environment.GetEnvironmentVariable(DotnetHomeVariableName); 23home = Environment.GetEnvironmentVariable(PlatformHomeVariableName);
FileSuggestionRegistration.cs (1)
7using static System.Environment;
Program.cs (4)
30if (Environment.GetEnvironmentVariable(DOTNET_SUGGEST_LOGGING) == "1") 32var appData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); 38File.AppendAllText(logFile, string.Join("|", args) + Environment.NewLine);
SuggestionDispatcher.cs (1)
182return string.Join(Environment.NewLine, Prefixes());
dotnet-svcutil.xmlserializer (5)
Microsoft\Tools\ServiceModel\SvcUtil\Tool.cs (1)
69System.Environment.Exit((int)ToolExitCodes.Unknown);
Microsoft\Tools\ServiceModel\SvcUtil\ToolConsole.cs (4)
542index += Environment.NewLine.Length; 599if ((index + Environment.NewLine.Length) > text.Length) 604for (int i = 0; i < Environment.NewLine.Length; i++) 606if (Environment.NewLine[i] != text[index + i])
dotnet-svcutil-lib (70)
AppInsightsTelemetryClient.cs (3)
31string optOut = Environment.GetEnvironmentVariable(OptOutVariable); 79if (!bool.TryParse(Environment.GetEnvironmentVariable(testModeVariable), out bool testMode)) 115context.User.Id = GetStableHashCode(Environment.UserName).ToString();
Bootstrapper\SvcutilBootstrapper.cs (1)
207throw new BootstrapException(string.Format(CultureInfo.CurrentCulture, "{0}{1}{2}", exception.Message, Environment.NewLine, Resource.BootstrapErrorDisableReferences));
CmdCredentialsProvider.cs (1)
250return separator + Environment.NewLine + certId + cert + separator;
CodeDomFixup\MethodCreationHelper.cs (6)
111indent + "{0} <summary>" + Environment.NewLine + 112indent + "{0} " + SR.ConfigureEndpointCommentSummary + Environment.NewLine + 113indent + "{0} </summary>" + Environment.NewLine + 114indent + "{0} <param name=\"serviceEndpoint\">" + SR.ServiceEndpointComment + "</param>" + Environment.NewLine + 115indent + "{0} <param name=\"clientCredentials\">" + SR.ClientCredentialsComment + "</param>" + Environment.NewLine; 127indent + "Partial Private Shared Sub ConfigureEndpoint(ByVal serviceEndpoint As System.ServiceModel.Description.ServiceEndpoint, ByVal clientCredentials As System.ServiceModel.Description.ClientCredentials)" + Environment.NewLine +
CommandLineParser.cs (1)
141SetValue(options, CommandProcessorOptions.InputsKey, Environment.ExpandEnvironmentVariables(arg));
CommandProcessorOptions.cs (1)
363throw new ToolArgumentException($"{moreThanOneProjectMsg}{Environment.NewLine}{useProjectOptions}");
FrameworkFork\Microsoft.CodeDom\Compiler\RedistVersionInfo.cs (2)
47string comPlus_InstallRoot = Environment.GetEnvironmentVariable("COMPLUS_InstallRoot"); 48string comPlus_Version = Environment.GetEnvironmentVariable("COMPLUS_Version");
FrameworkFork\Microsoft.CodeDom\Microsoft\CSharpCodeProvider.cs (1)
499b.Append(Environment.NewLine);
FrameworkFork\Microsoft.CodeDom\Microsoft\VBCodeProvider.cs (1)
518b.Append(Environment.NewLine);
FrameworkFork\Microsoft.Xml\Xml\Core\SecureStringHasher.cs (1)
38_hashCodeRandomizer = Environment.TickCount;
FrameworkFork\Microsoft.Xml\Xml\Core\XmlWriterSettings.cs (1)
691_newLineChars = Environment.NewLine; // "\r\n" on Windows, "\n" on Unix
FrameworkFork\Microsoft.Xml\Xml\NameTable.cs (1)
56_hashCodeRandomizer = Environment.TickCount;
FrameworkFork\Microsoft.Xml\Xml\Serialization\SchemaObjectWriter.cs (1)
196_w.Append(Environment.NewLine);
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriter.cs (4)
1680if (methodName == null) throw new InvalidOperationException(string.Format(ResXml.XmlInternalErrorMethod, mapping.TypeDesc.Name) + Environment.StackTrace); 2254if (methodName == null) throw new InvalidOperationException("deriaved from " + mapping.TypeDesc.FullName + ", " + string.Format(ResXml.XmlInternalErrorMethod, derived.TypeDesc.Name) + Environment.StackTrace); 2292if (methodName == null) throw new InvalidOperationException(string.Format(ResXml.XmlInternalErrorMethod, mapping.TypeDesc.Name) + Environment.StackTrace); 3376if (methodName == null) throw new InvalidOperationException(string.Format(ResXml.XmlInternalErrorMethod, mapping.TypeDesc.Name) + Environment.StackTrace);
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriterILGen.cs (4)
132if (methodName == null) throw new InvalidOperationException(string.Format(ResXml.XmlInternalErrorMethod, mapping.TypeDesc.Name) + Environment.StackTrace); 772if (methodName == null) throw new InvalidOperationException("deriaved from " + mapping.TypeDesc.FullName + ", " + string.Format(ResXml.XmlInternalErrorMethod, derived.TypeDesc.Name) + Environment.StackTrace); 823if (methodName == null) throw new InvalidOperationException(string.Format(ResXml.XmlInternalErrorMethod, mapping.TypeDesc.Name) + Environment.StackTrace); 2111if (methodName == null) throw new InvalidOperationException(string.Format(ResXml.XmlInternalErrorMethod, mapping.TypeDesc.Name) + Environment.StackTrace);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContractSet.cs (1)
468errorMessage.AppendFormat("{0}\"{1}\" ", Environment.NewLine, conflictingType.AssemblyQualifiedName);
FrameworkFork\System.ServiceModel\Internals\System\Runtime\AssertHelper.cs (1)
42Environment.FailFast(message);
FrameworkFork\System.ServiceModel\Internals\System\Runtime\Fx.cs (1)
170Environment.FailFast(failFastMessage);
FrameworkFork\System.ServiceModel\Internals\System\Runtime\SynchronizedPool.cs (3)
211int thisThreadID = Environment.CurrentManagedThreadId; 264int thisThreadID = Environment.CurrentManagedThreadId; 339return Environment.ProcessorCount;
FrameworkFork\System.ServiceModel\Internals\System\Runtime\TimeoutHelper.cs (1)
284uint currentTime = (uint)Environment.TickCount;
FrameworkFork\System.ServiceModel\System\IdentityModel\Claims\X509CertificateClaimSet.cs (1)
424Environment.NewLine,
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\TransportDefaults.cs (3)
214return 12 * Environment.ProcessorCount; 219return 2 * Environment.ProcessorCount; 235return 12 * Environment.ProcessorCount;
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\UdpConstants.cs (1)
41public static readonly long MaxPendingMessagesTotalSize = 1024 * 1024 * Environment.ProcessorCount; // 512 * 2K messages per processor
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\DataProtectionSecurityStateEncoder.cs (2)
62result.AppendFormat("{0} UseCurrentUserProtectionScope={1}", Environment.NewLine, _useCurrentUserProtectionScope); 63result.AppendFormat("{0} Entropy Length={1}", Environment.NewLine, (_entropy == null) ? 0 : _entropy.Length);
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\TimeBoundedCache.cs (3)
308Environment.FailFast("Cache write lock is not held."); 370Environment.FailFast("Cache write lock is not held."); 387Environment.FailFast("Cache write lock is not held.");
HelpGenerator.cs (4)
365index += Environment.NewLine.Length; 422if ((index + Environment.NewLine.Length) > text.Length) 427for (int i = 0; i < Environment.NewLine.Length; i++) 429if (Environment.NewLine[i] != text[index + i])
Metadata\MetadaExchangeResolver.cs (1)
347_currentRequest.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol " + System.Environment.Version.ToString() + ")";
Shared\Options\OptionsSerializer.cs (1)
205var separator = prettyFormat ? Environment.NewLine : " ";
Shared\ProjectPropertyResolver.cs (1)
98await safeLogger.WriteErrorAsync($"{ex.Message}{Environment.NewLine}{ex.StackTrace}", logToUI: false);
Shared\Utilities\DebugUtils.cs (4)
19set { Environment.SetEnvironmentVariable(SvcutilKeepBootstrapDirEnvVar, value ? "1" : string.Empty); } 20get { return Int32.TryParse(Environment.GetEnvironmentVariable(SvcutilKeepBootstrapDirEnvVar), out int ret) ? (ret > 0 ? true : false) : false; } 30set { Environment.SetEnvironmentVariable(SvcutilDebugVariableEnvVar, value.ToString(CultureInfo.InvariantCulture)); } 31get { return Int32.TryParse(Environment.GetEnvironmentVariable(SvcutilDebugVariableEnvVar), out int ret) ? ret : 0; }
Shared\Utilities\ProcessRunner.cs (2)
66using (var safeLogger = await SafeLogger.WriteStartOperationAsync(logger, $"Executing command [\"{currentDir}\"]{Environment.NewLine}>{processName} {processArgs}").ConfigureAwait(false)) 115Console.WriteLine($"{Path.GetFileName(currentDir)}>{processName} {processArgs}{Environment.NewLine}");
Shared\Utilities\RuntimeEnvironmentHelper.cs (6)
62"<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine + 63"<configuration>" + Environment.NewLine + 64" <packageSources>" + Environment.NewLine + 65" <add key = \"svcutilFeed\" value=\"{0}\" />" + Environment.NewLine + 66" </packageSources>" + Environment.NewLine + 67"</configuration>" + Environment.NewLine;
Shared\Utilities\Utilities.cs (1)
43message.Append(string.Concat(Environment.NewLine, exMsg, includeStackTrace ? e.StackTrace : string.Empty));
ToolConsole.cs (4)
128str = str.Replace("\\r\\n", Environment.NewLine); 135str = logTag + str.Replace(Environment.NewLine, newLineReplacement); 166WriteWarning(conversionError.Message.Replace("\r\n", Environment.NewLine).Trim(trimLFNL)); 170WriteError(conversionError.Message.Replace("\r\n", Environment.NewLine).Trim(trimLFNL));
dotnet-svcutil-lib.Tests (84)
E2ETests.cs (1)
54_ = $"{processResult.OutputText}{Environment.NewLine}{((TestLogger)this_TestCaseLogger)}";
FixupUtil.cs (3)
15static readonly string s_programFilesx64 = Environment.GetEnvironmentVariable("ProgramW6432")?.Replace('\\', '/'); 44new ReplaceInfo(Environment.GetEnvironmentVariable("USERPROFILE"), "$USERPROFILE$"), 86_replacements.Add(new ReplaceInfo(Environment.GetEnvironmentVariable("HOME"), "$USERPROFILE$"));
GlobalToolTests.cs (1)
23var outputText = $"{processResult.OutputText}{Environment.NewLine}{((TestLogger)this_TestCaseLogger)}";
ProjectUtils.cs (2)
73Assert.True(ret.ExitCode == 0, $"Project package restore failed:{Environment.NewLine}{ret.OutputText}{logger}"); 78Assert.True(ret.ExitCode == 0, $"Project build failed:{Environment.NewLine}{ret.OutputText}{logger}");
TestInit.cs (44)
186Assert.True(ret.ExitCode == 0, "Could not install the global tool." + Environment.NewLine + ret.OutputText); 294Environment.NewLine + Environment.NewLine + "Error: The generated file doesn't match the baseline! Different lines:" + 295Environment.NewLine + "< \"{0}\"" + 296Environment.NewLine + "> \"{1}\"" + Environment.NewLine + 297Environment.NewLine + " windiff \"{2}\" \"{3}\"" + Environment.NewLine + 298Environment.NewLine + "To update the baseline run the following command:" + 299Environment.NewLine + " copy /y \"{3}\" \"{2}\""; 302Environment.NewLine + Environment.NewLine + "Error: A file was generated but no baseline exists!" + 303Environment.NewLine + "The \"{0}\" file was created and need to be committed into the source repo. Rerunning the test should succeed if no other error occurred!"; 306Environment.NewLine + Environment.NewLine + "No generated file was found matching the following baselines:" + Environment.NewLine + "{0}" + 307Environment.NewLine + "If no longer valid, run the following command script to delete them:" + Environment.NewLine + " {1}"; 310Environment.NewLine + Environment.NewLine + "To reproduce the problem run the following commands:" + Environment.NewLine + 311Environment.NewLine + " pushd {0}" + Environment.NewLine + 312Environment.NewLine + " dotnet svcutil {1}"; 315Environment.NewLine + "Command: dotnet svcutil {0}" + 316Environment.NewLine + "Workdir: {1}"; 318public static readonly string g_GeneralErrMsg = $"{Environment.NewLine}{Environment.NewLine}Click the Output link for a full report."; 328var resultsMsg = Environment.NewLine + $"Svcutil Result: {actualText}. Expected: {expectedText}"; 332var logText = $"{Environment.NewLine}{outputText}{Environment.NewLine}{Environment.NewLine}{commandMsg}{resultsMsg}"; 337Assert.True(isTestSucess, $"{Environment.NewLine}Test failed:{Environment.NewLine}{outputText}{g_GeneralErrMsg}"); 343Assert.True(validationSuccess, $"{Environment.NewLine}Test failed validation!{failureMessage}{g_GeneralErrMsg}"); 461.Aggregate((msg, b) => $"{msg}{Environment.NewLine}{b}"), scriptPath); 611"<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine + 612"<configuration>" + Environment.NewLine + 613" <packageSources>" + Environment.NewLine + 614" <clear />" + Environment.NewLine + 615" <add key = \"svcutilTestFeed\" value=\"$svcutilTestFeed$\" />" + Environment.NewLine + 616" <add key = \"dotnet-public\" value=\"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json\" />" + Environment.NewLine + 617" </packageSources>" + Environment.NewLine + 618"</configuration>" + Environment.NewLine;
TestLogger.cs (1)
13static readonly string programFilesx64 = Environment.GetEnvironmentVariable("ProgramW6432")?.Replace('\\', '/');
UnitTest.cs (32)
253Environment.NewLine + cmdOptions.Errors.Select(e => e.Message).Aggregate((errors, e) => $"{errors}{Environment.NewLine}{e}"); 255Environment.NewLine + cmdOptions.Warnings.Aggregate((warnings, w) => $"{warnings}{Environment.NewLine}{w}"); 258var log = $"{Environment.NewLine}Input options:{Environment.NewLine}{options}{Environment.NewLine}" + 259$"{Environment.NewLine}Output JSON:{Environment.NewLine}{cmdOptions.Json}{Environment.NewLine}" + 260$"{Environment.NewLine}Output options:{Environment.NewLine}{optionsString}{Environment.NewLine}" + 261$"{Environment.NewLine}Parsing warnings:{cmdwarnings}{Environment.NewLine}" + 262$"{Environment.NewLine}Parsing errors:{cmderrors}{Environment.NewLine}"; 268log += $"{Environment.NewLine}{cmdOptions.GetType().Name} as {updateOptions.GetType().Name}:{Environment.NewLine}{updateOptions.Json}"; 299Environment.NewLine + cmdOptions.Errors.Select(e => e.Message).Aggregate((errors, e) => $"{errors}{Environment.NewLine}{e}"); 301Environment.NewLine + cmdOptions.Warnings.Aggregate((warnings, w) => $"{warnings}{Environment.NewLine}{w}"); 304var log = $"{Environment.NewLine}Input options:{Environment.NewLine}{options}{Environment.NewLine}" + 305$"{Environment.NewLine}Output options:{Environment.NewLine}{optionsString}{Environment.NewLine}" + 306$"{Environment.NewLine}{cmdwarnings}" + 307$"{Environment.NewLine}{cmderrors}"; 355errorMessage = $"{options.GetType().Name} did not pass serialization roundtrip!{Environment.NewLine} windiff {jsonFileSrcPath} {outJsonFile}";
dotnet-user-jwts (16)
Commands\CreateCommand.cs (12)
138var optionsString = schemeNameOption.HasValue() ? $"{Resources.JwtPrint_Scheme}: {scheme}{Environment.NewLine}" : string.Empty; 140var name = nameOption.HasValue() ? nameOption.Value() : Environment.UserName; 141optionsString += $"{Resources.JwtPrint_Name}: {name}{Environment.NewLine}"; 144optionsString += audienceOption.HasValue() ? $"{Resources.JwtPrint_Audiences}: {string.Join(", ", audience)}{Environment.NewLine}" : string.Empty; 151optionsString += issuerOption.HasValue() ? $"{Resources.JwtPrint_Issuer}: {issuer}{Environment.NewLine}" : string.Empty; 161optionsString += $"{Resources.JwtPrint_NotBefore}: {notBefore:O}{Environment.NewLine}"; 180optionsString += $"{Resources.JwtPrint_ExpiresOn}: {expiresOn:O}{Environment.NewLine}"; 200optionsString += $"{Resources.JwtPrint_ExpiresOn}: {expiresOn:O}{Environment.NewLine}"; 205optionsString += rolesOption.HasValue() ? $"{Resources.JwtPrint_Roles}: [{string.Join(", ", roles)}]{Environment.NewLine}" : string.Empty; 208optionsString += scopesOption.HasValue() ? $"{Resources.JwtPrint_Scopes}: {string.Join(", ", scopes)}{Environment.NewLine}" : string.Empty; 218optionsString += $"{Resources.JwtPrint_CustomClaims}: [{string.Join(", ", claims.Select(kvp => $"{kvp.Key}={kvp.Value}"))}]{Environment.NewLine}"; 226optionsString += appsettingsFileOption.HasValue() ? $"{Resources.JwtPrint_appsettingsFile}: {appsettingsFile}{Environment.NewLine}" : string.Empty;
src\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
48if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
src\aspnetcore\src\Tools\Shared\CommandLine\CliContext.cs (1)
20bool.TryParse(Environment.GetEnvironmentVariable("DOTNET_CLI_CONTEXT_VERBOSE"), out bool globalVerbose);
src\aspnetcore\src\Tools\Shared\CommandLine\DebugHelper.cs (1)
24Console.WriteLine($"Process ID: {Environment.ProcessId}");
src\aspnetcore\src\Tools\Shared\SecretsHelpers\UserSecretsCreator.cs (1)
64propertyGroup.Add($"{Environment.NewLine} ");
dotnet-user-secrets (4)
src\aspnetcore\src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
48if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
src\aspnetcore\src\Tools\Shared\CommandLine\CliContext.cs (1)
20bool.TryParse(Environment.GetEnvironmentVariable("DOTNET_CLI_CONTEXT_VERBOSE"), out bool globalVerbose);
src\aspnetcore\src\Tools\Shared\CommandLine\DebugHelper.cs (1)
24Console.WriteLine($"Process ID: {Environment.ProcessId}");
src\aspnetcore\src\Tools\Shared\SecretsHelpers\UserSecretsCreator.cs (1)
64propertyGroup.Add($"{Environment.NewLine} ");
dotnet-watch (1)
Program.cs (1)
49Environment.SetEnvironmentVariable(EnvironmentVariables.Names.DotnetHostPath, environmentOptions.GetMuxerPath());
EventHubsConsumer (1)
Program.cs (1)
9bool useConsumer = Environment.GetEnvironmentVariable("USE_EVENTHUBCONSUMERCLIENT") == "yes";
GenerateDocumentationAndConfigFiles (23)
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (2)
99var parentPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
58if (Environment.OSVersion.Platform == PlatformID.Win32NT)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (3)
67private int _localRandom = Environment.TickCount; 70private static int s_sharedRandom = Environment.TickCount; 90var pool = new ObjectPool<StringTable>(pool => new StringTable(pool), Environment.ProcessorCount * 2);
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
72: this(factory, Environment.ProcessorCount * 2, trimOnFree, trackLeaks, filePath, lineNumber)
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
121_outstanding.TryAdd(obj, new AllocationInfo(obj.GetType(), poolName, _traceLeaks ? Environment.StackTrace : null));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingOptions2.cs (1)
47_ => Environment.NewLine
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\LineFormattingOptions.cs (1)
19[DataMember] public string NewLine { get; init; } = Environment.NewLine;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.LogBlock.cs (3)
17private static readonly ObjectPool<RoslynLogBlock> s_pool = new(() => new RoslynLogBlock(s_pool!), Math.Min(Environment.ProcessorCount * 8, 256)); 49_tick = Environment.TickCount; 66var delta = Environment.TickCount - _tick;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
285: reason + Environment.NewLine + restString;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (3)
47/// The <see cref="Environment.CurrentManagedThreadId" /> of the thread that holds the lock. Zero if no thread is holding 193return _owningThreadId == Environment.CurrentManagedThreadId; 204_owningThreadId = Environment.CurrentManagedThreadId;
ilc (4)
ILCompilerRootCommand.cs (2)
403var parallelism = Math.Min(24, Environment.ProcessorCount); 406if (!Environment.Is64BitProcess)
src\runtime\src\coreclr\tools\Common\CommandLineHelpers.cs (2)
179details.Add(Environment.GetCommandLineArgs()[0]); 184details.Add(System.Diagnostics.FileVersionInfo.GetVersionInfo(Environment.GetCommandLineArgs()[0]).ToString());
ILCompiler.DependencyAnalysisFramework (1)
DependencyAnalyzer.cs (1)
108if (int.TryParse(Environment.GetEnvironmentVariable("CoreRT_DeterminismSeed"), out int seed))
illink (1)
ILLink.Tasks (1)
LinkTask.cs (1)
246_dotnetPath = Environment.GetEnvironmentVariable(DotNetHostPathEnvironmentName);
Infrastructure.Common (14)
CertificateManager.cs (4)
73return Path.Combine(Environment.CurrentDirectory, "wcfLocal.keychain"); 118exceptionString.AppendFormat("while attempting to install cert with thumbprint '{1}'.", Environment.NewLine, certificate.Thumbprint); 119exceptionString.AppendFormat("{0}This is usually due to permissions issues if writing to the LocalMachine location", Environment.NewLine); 120exceptionString.AppendFormat("{0}Try running the test with elevated or superuser permissions.", Environment.NewLine);
ConditionalTestDetectors.cs (4)
122string computerName = Environment.GetEnvironmentVariable("COMPUTERNAME"); 123string logonServer = Environment.GetEnvironmentVariable("LOGONSERVER"); 124string userDomain = Environment.GetEnvironmentVariable("USERDOMAIN"); 238result = Environment.GetEnvironmentVariable("USERDOMAIN");
ConditionalWcfTest.cs (1)
43string value = Environment.GetEnvironmentVariable(conditionName);
ServiceUtilHelper.cs (3)
120Environment.NewLine, rootCertificate)); 213Environment.NewLine, clientCertificate)); 326Environment.NewLine, peerCertificate));
TestProperties.cs (1)
56? Environment.GetEnvironmentVariable(propertyName)
xunit\WcfTestCase.cs (1)
56timer = new Timer((s) => Environment.FailFast($"Test timed out after duration {_failFastDuration}"),
Infrastructure.IntegrationTests (2)
OSAndFrameworkTests.4.1.1.cs (2)
27Environment.NewLine, 29Environment.NewLine,
Infrastructure.Tests (7)
ExtractTestPartitions\ExtractTestPartitionsTests.cs (1)
341return new ToolResult(process.ExitCode, string.Join(Environment.NewLine, outputLines));
ExtractTestPartitions\MockAssemblyBuilder.cs (2)
274var errors = string.Join(Environment.NewLine, 278throw new InvalidOperationException($"Failed to compile mock assembly:{Environment.NewLine}{errors}");
PowerShellScripts\PowerShellCommand.cs (3)
181return string.Join(System.Environment.NewLine, outputLines); 278message += $"{System.Environment.NewLine}Output:{System.Environment.NewLine}{Output}";
WorkflowScripts\NodeCommand.cs (1)
174return string.Join(System.Environment.NewLine, outputLines);
installer.tasks (16)
GenerateFileVersionProps.cs (1)
117string.Concat(versionlessFiles.Select(f => Environment.NewLine + f)));
GenerateRunScript.cs (2)
43Log.LogMessage($"Run commands = {string.Join(Environment.NewLine, RunCommands)}"); 65string[] newlineSeparator = new string[] { Environment.NewLine };
StaticFileRegeneration\TpnDocument.cs (6)
31Environment.NewLine, 53Environment.NewLine, 65Preamble + Environment.NewLine + 66string.Join(Environment.NewLine + Environment.NewLine, Sections) + 67Environment.NewLine;
StaticFileRegeneration\TpnSection.cs (2)
23Header + Environment.NewLine + Environment.NewLine + Content;
StaticFileRegeneration\TpnSectionHeader.cs (5)
75SeparatorLine + Environment.NewLine + 76Environment.NewLine + 81Name + Environment.NewLine + 100string name = string.Join(Environment.NewLine, nameLines); 143Name = string.Join(Environment.NewLine, nameLines),
Microsoft.Arcade.Common (8)
CommandFactory.cs (2)
39var comSpec = System.Environment.GetEnvironmentVariable("ComSpec"); 73foreach (var path in System.Environment.GetEnvironmentVariable("PATH").Split(Path.PathSeparator))
CommandResult.cs (4)
37message.AppendLine($"{Environment.NewLine}Standard Output:{Environment.NewLine}{StdOut}"); 42message.AppendLine($"{Environment.NewLine}Standard Error:{Environment.NewLine}{StdErr}");
CompactConsoleLoggerFormatter.cs (2)
47_newLineWithMessagePadding = Environment.NewLine + _messagePadding; 101textWriter.WriteLine(message.Replace(Environment.NewLine, _newLineWithMessagePadding));
Microsoft.AspNetCore (2)
WebApplicationBuilder.cs (2)
260string cwd = System.Environment.CurrentDirectory; 261if (!OperatingSystem.IsWindows() || !string.Equals(cwd, System.Environment.SystemDirectory, StringComparison.OrdinalIgnoreCase))
Microsoft.AspNetCore.App.CodeFixes (1)
Authorization\AddAuthorizationBuilderFixer.cs (1)
122SyntaxFactory.EndOfLine(Environment.NewLine),
Microsoft.AspNetCore.Authorization (2)
LoggingExtensions.cs (2)
21: "These requirements were not met:" + Environment.NewLine + string.Join(Environment.NewLine, failure.FailedRequirements);
Microsoft.AspNetCore.Components (4)
Reflection\ComponentProperties.cs (4)
242$"when also used to capture unmatched values. Unmatched values:" + Environment.NewLine + 243string.Join(Environment.NewLine, unmatched.Keys)); 263$"per type can use '{nameof(ParameterAttribute)}.{nameof(ParameterAttribute.CaptureUnmatchedValues)}'. Properties:" + Environment.NewLine + 264string.Join(Environment.NewLine, propertyNames));
Microsoft.AspNetCore.Components.Analyzers (2)
ComponentParameterAnalyzer.cs (2)
130Environment.NewLine, 132Environment.NewLine,
Microsoft.AspNetCore.Components.Endpoints (2)
Rendering\EndpointHtmlRenderer.Streaming.cs (2)
333Environment.GetEnvironmentVariable("DOTNET_MODIFIABLE_ASSEMBLIES") is { Length: > 0 } v1 ? v1 : null; 336Environment.GetEnvironmentVariable("__ASPNETCORE_BROWSER_TOOLS") is { Length: > 0 } v2 ? v2 : null;
Microsoft.AspNetCore.Components.SdkAnalyzers (2)
ComponentParameterAnalyzer.cs (2)
117Environment.NewLine, 119Environment.NewLine,
Microsoft.AspNetCore.Components.Server (1)
src\aspnetcore\src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\SequencePool.cs (1)
55: this(Environment.ProcessorCount * 2, ArrayPool<byte>.Create(80 * 1024, 100))
Microsoft.AspNetCore.Components.WebView.WindowsForms (3)
src\BlazorWebView\src\SharedSource\WebView2WebViewManager.cs (3)
393 string.Join(Environment.NewLine, headers.Select(kvp => $"{kvp.Key}: {kvp.Value}")); 416 Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
Microsoft.AspNetCore.Components.WebView.Wpf (3)
src\BlazorWebView\src\SharedSource\WebView2WebViewManager.cs (3)
393 string.Join(Environment.NewLine, headers.Select(kvp => $"{kvp.Key}: {kvp.Value}")); 416 Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
Microsoft.AspNetCore.Cryptography.Internal (1)
Cng\OSVersionUtil.cs (1)
15if (Environment.OSVersion.Platform is not PlatformID.Win32NT)
Microsoft.AspNetCore.DataProtection (8)
Internal\ContainerUtils.cs (1)
111var value = Environment.GetEnvironmentVariable(envVarName);
Repositories\DefaultKeyStorageDirectories.cs (7)
37var localAppDataFromSystemPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); 38var localAppDataFromEnvPath = Environment.GetEnvironmentVariable("LOCALAPPDATA"); 39var homePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); 93if (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("WEBSITE_INSTANCE_ID"))) 95var homeEnvVar = Environment.GetEnvironmentVariable("HOME");
Microsoft.AspNetCore.DeveloperCertificates.XPlat (19)
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (1)
1042return string.Join(Environment.NewLine, description);
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
26private static readonly string MacOSUserKeychain = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + "/Library/Keychains/login.keychain-db"; 34private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https");
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (14)
62if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable(OpenSslCertDirectoryOverrideVariableName))) 102var sslCertDirString = Environment.GetEnvironmentVariable(OpenSslCertificateDirectoryVariableName); 137var nssDbs = GetNssDbs(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)); 233var homeDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); 367var existingSslCertDir = Environment.GetEnvironmentVariable(OpenSslCertificateDirectoryVariableName); 464var homeDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)!; 593var searchPath = Environment.GetEnvironmentVariable("PATH"); 653if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("WSL_INTEROP"))) 806var @override = Environment.GetEnvironmentVariable(OpenSslCertDirectoryOverrideVariableName); 832var nssDbOverride = Environment.GetEnvironmentVariable(NssDbOverrideVariableName); 879Log.UnixHomeDirectoryDoesNotExist(homeDirectory, Environment.UserName);
Microsoft.AspNetCore.Diagnostics (3)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (1)
304.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
src\aspnetcore\src\Shared\Diagnostics\BaseView.cs (1)
293return string.Join("<br />" + Environment.NewLine,
src\aspnetcore\src\Shared\RazorViews\BaseView.cs (1)
283return string.Join("<br />" + Environment.NewLine,
Microsoft.AspNetCore.Hosting (8)
Internal\HostingLoggerExtensions.cs (1)
35message = message + Environment.NewLine + ex.Message;
src\aspnetcore\src\Shared\RazorViews\BaseView.cs (1)
283return string.Join("<br />" + Environment.NewLine,
WebHostBuilder.cs (6)
50UseSetting(WebHostDefaults.EnvironmentKey, Environment.GetEnvironmentVariable("Hosting:Environment") 51?? Environment.GetEnvironmentVariable("ASPNET_ENV")); 57UseSetting(WebHostDefaults.ServerUrlsKey, Environment.GetEnvironmentVariable("ASPNETCORE_SERVER.URLS")); 146if (Environment.GetEnvironmentVariable("Hosting:Environment") != null) 151if (Environment.GetEnvironmentVariable("ASPNET_ENV") != null) 156if (Environment.GetEnvironmentVariable("ASPNETCORE_SERVER.URLS") != null)
Microsoft.AspNetCore.Html.Abstractions (6)
HtmlContentBuilderExtensions.cs (4)
70/// Appends an <see cref="Environment.NewLine"/>. 83/// Appends an <see cref="Environment.NewLine"/> after appending the <see cref="string"/> value. 99/// Appends an <see cref="Environment.NewLine"/> after appending the <see cref="IHtmlContent"/> value. 114/// Appends an <see cref="Environment.NewLine"/> after appending the <see cref="string"/> value.
HtmlString.cs (2)
14/// An <see cref="HtmlString"/> instance for <see cref="Environment.NewLine"/>. 16public static readonly HtmlString NewLine = new HtmlString(Environment.NewLine);
Microsoft.AspNetCore.Http (1)
src\aspnetcore\src\Http\WebUtilities\src\AspNetCoreTempDirectory.cs (1)
19var temp = Environment.GetEnvironmentVariable("ASPNETCORE_TEMP") ?? // ASPNETCORE_TEMP - User set temporary location.
Microsoft.AspNetCore.Http.Connections (4)
Internal\HttpConnectionContext.cs (3)
77LastSeenTicks = TimeSpan.FromMilliseconds(Environment.TickCount64); 621LastSeenTicks = TimeSpan.FromMilliseconds(Environment.TickCount64); 653_startedSendTime = TimeSpan.FromMilliseconds(Environment.TickCount64);
Internal\HttpConnectionManager.cs (1)
144var ticks = TimeSpan.FromMilliseconds(Environment.TickCount64);
Microsoft.AspNetCore.HttpLogging (3)
HttpLog.cs (2)
45builder.Append(Environment.NewLine); 53builder.Append(Environment.NewLine);
W3CLoggingMiddleware.cs (1)
94_serverName ??= Environment.MachineName;
Microsoft.AspNetCore.Mvc.Core (20)
ApiConventionTypeAttribute.cs (3)
75Environment.NewLine + string.Join(Environment.NewLine, unsupportedAttributes) + Environment.NewLine,
ApplicationModels\ApplicationModelFactory.cs (9)
166Environment.NewLine, 213Environment.NewLine, 245var message = Resources.FormatAttributeRoute_DuplicateNames(routeName, Environment.NewLine, string.Join(Environment.NewLine, descriptions)); 333Environment.NewLine, 334string.Join(Environment.NewLine, actionDescriptions)); 342Environment.NewLine, 343string.Join(Environment.NewLine + Environment.NewLine, errorMessages));
ApplicationModels\InferParameterBindingInfoConvention.cs (2)
95var parameters = string.Join(Environment.NewLine, fromBodyParameters.Select(p => p.DisplayName)); 102message += Environment.NewLine + parameters;
Infrastructure\ActionSelector.cs (2)
99Environment.NewLine, 104Environment.NewLine,
Routing\AttributeRoute.cs (4)
164Environment.NewLine + Environment.NewLine, 168Environment.NewLine, 171var message = Resources.FormatAttributeRoute_AggregateErrorMessage(Environment.NewLine, allErrors);
Microsoft.AspNetCore.Mvc.Razor (6)
ApplicationParts\RazorCompiledItemFeatureProvider.cs (2)
28var viewsDifferingInCase = string.Join(Environment.NewLine, duplicates.Select(d => d.Identifier)); 31Environment.NewLine,
RazorView.cs (4)
285locations = Environment.NewLine + string.Join(Environment.NewLine, originalLocations); 291Environment.NewLine + string.Join(Environment.NewLine, layoutPageResult.SearchedLocations);
Microsoft.AspNetCore.Mvc.RazorPages (1)
Infrastructure\DefaultPageHandlerMethodSelector.cs (1)
52throw new InvalidOperationException(Resources.FormatAmbiguousHandler(Environment.NewLine, ambiguousMethods));
Microsoft.AspNetCore.Mvc.TagHelpers (9)
AnchorTagHelper.cs (1)
209Environment.NewLine,
FormActionTagHelper.cs (1)
221Environment.NewLine,
FormTagHelper.cs (1)
228Environment.NewLine,
PartialTagHelper.cs (5)
128var locations = Environment.NewLine + string.Join(Environment.NewLine, viewSearchedLocations); 133locations = Environment.NewLine + string.Join(Environment.NewLine, result.SearchedLocations); 134errorMessage += Environment.NewLine + Resources.FormatViewEngine_FallbackViewNotFound(FallbackName, locations);
ScriptTagHelper.cs (1)
372builder.AppendHtml(Environment.NewLine)
Microsoft.AspNetCore.Mvc.ViewFeatures (11)
Filters\SaveTempDataPropertyFilterBase.cs (1)
114throw new InvalidOperationException(string.Join(Environment.NewLine, errorMessages));
HtmlHelper.cs (4)
527locations = Environment.NewLine + string.Join(Environment.NewLine, originalLocations); 533Environment.NewLine + string.Join(Environment.NewLine, viewEngineResult.SearchedLocations);
ViewComponents\DefaultViewComponentSelector.cs (2)
100var typeNames = string.Join(Environment.NewLine, matchedTypes); 102Resources.FormatViewComponent_AmbiguousTypeMatch(name, Environment.NewLine, typeNames));
ViewEngines\ViewEngineResult.cs (4)
98locations = Environment.NewLine + string.Join(Environment.NewLine, originalLocations); 103locations += Environment.NewLine + string.Join(Environment.NewLine, SearchedLocations);
Microsoft.AspNetCore.Razor.Utilities.Shared (4)
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
72: this(factory, Environment.ProcessorCount * 2, trimOnFree, trackLeaks, filePath, lineNumber)
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
121_outstanding.TryAdd(obj, new AllocationInfo(obj.GetType(), poolName, _traceLeaks ? Environment.StackTrace : null));
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\Assumed.cs (2)
153=> ThrowHelper.ThrowInvalidOperationException(message + Environment.NewLine + SR.FormatFile_0_Line_1(path, line)); 158=> ThrowHelper.ThrowInvalidOperationException<T>(message + Environment.NewLine + SR.FormatFile_0_Line_1(path, line));
Microsoft.AspNetCore.Routing (7)
EndpointMiddleware.cs (3)
108Environment.NewLine + 116Environment.NewLine + 124Environment.NewLine +
Matching\CandidateSet.cs (2)
350$"The following endpoints were found with the same priority:" + Environment.NewLine + 351string.Join(Environment.NewLine, duplicates.Select(e => e.DisplayName));
Matching\DefaultEndpointSelector.cs (2)
122Environment.NewLine, 123string.Join(Environment.NewLine, matches.Select(e => e.DisplayName)));
Microsoft.AspNetCore.Server.IISIntegration (6)
WebHostBuilderIISExtensions.cs (6)
41var port = hostBuilder.GetSetting(ServerPort) ?? Environment.GetEnvironmentVariable($"ASPNETCORE_{ServerPort}"); 42var path = hostBuilder.GetSetting(ServerPath) ?? Environment.GetEnvironmentVariable($"ASPNETCORE_{ServerPath}"); 43var pairingToken = hostBuilder.GetSetting(PairingToken) ?? Environment.GetEnvironmentVariable($"ASPNETCORE_{PairingToken}"); 44var iisAuth = hostBuilder.GetSetting(IISAuth) ?? Environment.GetEnvironmentVariable($"ASPNETCORE_{IISAuth}"); 45var websocketsSupported = hostBuilder.GetSetting(IISWebSockets) ?? Environment.GetEnvironmentVariable($"ASPNETCORE_{IISWebSockets}"); 51isWebSocketsSupported = (Environment.OSVersion.Version >= new Version(6, 2));
Microsoft.AspNetCore.Server.Kestrel.Core (27)
Middleware\HttpsConnectionMiddleware.cs (2)
553if (Environment.OSVersion.Version < new Version(6, 3) // Missing ALPN support 555|| (Environment.OSVersion.Version < new Version(10, 0) && !enableHttp2OnWindows81))
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (1)
1042return string.Join(Environment.NewLine, description);
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
26private static readonly string MacOSUserKeychain = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + "/Library/Keychains/login.keychain-db"; 34private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https");
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (14)
62if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable(OpenSslCertDirectoryOverrideVariableName))) 102var sslCertDirString = Environment.GetEnvironmentVariable(OpenSslCertificateDirectoryVariableName); 137var nssDbs = GetNssDbs(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)); 233var homeDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); 367var existingSslCertDir = Environment.GetEnvironmentVariable(OpenSslCertificateDirectoryVariableName); 464var homeDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)!; 593var searchPath = Environment.GetEnvironmentVariable("PATH"); 653if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("WSL_INTEROP"))) 806var @override = Environment.GetEnvironmentVariable(OpenSslCertDirectoryOverrideVariableName); 832var nssDbOverride = Environment.GetEnvironmentVariable(NssDbOverrideVariableName); 879Log.UnixHomeDirectoryDoesNotExist(homeDirectory, Environment.UserName);
Systemd\KestrelServerOptionsSystemdExtensions.cs (3)
39if (string.Equals(Environment.ProcessId.ToString(CultureInfo.InvariantCulture), Environment.GetEnvironmentVariable(ListenPidEnvVar), StringComparison.Ordinal)) 42if (int.TryParse(Environment.GetEnvironmentVariable(ListenFdsEnvVar), NumberStyles.None, NumberFormatInfo.InvariantInfo, out var listenFds)
TlsConfigurationLoader.cs (3)
190var appData = Environment.GetEnvironmentVariable("APPDATA"); 191var home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
Microsoft.AspNetCore.Watch.BrowserRefresh (4)
src\sdk\src\Dotnet.Watch\Web.Middleware\BrowserRefreshMiddleware.cs (1)
36=> Environment.GetEnvironmentVariable(name) is { Length: > 0 } value ? value : null;
src\sdk\src\Dotnet.Watch\Web.Middleware\BrowserScriptMiddleware.cs (2)
61var endpoint = Environment.GetEnvironmentVariable("ASPNETCORE_AUTO_RELOAD_WS_ENDPOINT")!; 62var serverKey = Environment.GetEnvironmentVariable("ASPNETCORE_AUTO_RELOAD_WS_KEY") ?? string.Empty;
src\sdk\src\Dotnet.Watch\Web.Middleware\StartupHook.cs (1)
14Environment.SetEnvironmentVariable("__ASPNETCORE_BROWSER_TOOLS", "true");
Microsoft.AspNetCore.WebUtilities (1)
AspNetCoreTempDirectory.cs (1)
19var temp = Environment.GetEnvironmentVariable("ASPNETCORE_TEMP") ?? // ASPNETCORE_TEMP - User set temporary location.
Microsoft.Build (125)
BackEnd\BuildManager\BuildManager.cs (2)
819switch (Environment.GetEnvironmentVariable("MSBuildDebugBuildManagerOnStart")) 2433if (Environment.GetEnvironmentVariable("MSBUILDCLEARXMLCACHEONBUILDMANAGER") == "1")
BackEnd\BuildManager\BuildParameters.cs (3)
437set => _enableNodeReuse = Environment.GetEnvironmentVariable("MSBUILDDISABLENODEREUSE") == "1" ? false : value; 1040if (Environment.GetEnvironmentVariable("MSBUILDDISABLENODEREUSE") == "1") // For example to disable node reuse within Visual Studio 1045if (Environment.GetEnvironmentVariable("MSBUILDDETAILEDSUMMARY") == "1") // For example to get detailed summary within Visual Studio
BackEnd\BuildManager\EnvironmentVariableValidator.cs (1)
35string? dotnetHostPath = Environment.GetEnvironmentVariable(Constants.DotnetHostPathEnvVarName);
BackEnd\Client\MSBuildClient.cs (1)
506foreach (DictionaryEntry envVar in Environment.GetEnvironmentVariables())
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (1)
1500file.WriteLine("{0}({1})-{2}: {3}", Thread.CurrentThread.Name, Environment.CurrentManagedThreadId, DateTime.UtcNow.Ticks, message);
BackEnd\Components\Caching\ConfigCache.cs (4)
39if (!int.TryParse(Environment.GetEnvironmentVariable("MSBUILDCONFIGCACHESWEEPTHRESHHOLD"), out _sweepThreshhold)) 246if (String.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDENABLEAGGRESSIVECACHING"))) 383capacity => new ConcurrentDictionary<int, BuildRequestConfiguration>(Environment.ProcessorCount, capacity)); 388_byMetadata = new ConcurrentDictionary<ConfigurationMetadata, BuildRequestConfiguration>(Environment.ProcessorCount, configurationsById.Count);
BackEnd\Components\Communications\NodeLauncher.cs (5)
66bool showNodeWindow = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDNODEWINDOW")); 144$"Failed to launch node from {nodeLaunchData.MSBuildLocation}. CommandLine: {commandLineArgs}{Environment.NewLine}{ex}"); 328string useMSBuildServerEnvVarValue = Environment.GetEnvironmentVariable(Traits.UseMSBuildServerEnvVarName); 333Environment.SetEnvironmentVariable(Traits.UseMSBuildServerEnvVarName, "0"); 341Environment.SetEnvironmentVariable(Traits.UseMSBuildServerEnvVarName, useMSBuildServerEnvVarValue);
BackEnd\Components\Communications\NodeProviderInProc.cs (2)
130concurrencyLevel: Environment.ProcessorCount, 222if (Environment.GetEnvironmentVariable("MSBUILDINPROCENVCHECK") == "1")
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (1)
250string msbuildExeName = Environment.GetEnvironmentVariable("MSBUILD_EXE_NAME");
BackEnd\Components\Communications\NodeProviderOutOfProcTaskHost.cs (3)
175name = Environment.GetEnvironmentVariable("MSBUILDTASKHOST_EXE_NAME") ?? "MSBuildTaskHost.exe"; 428name = Environment.GetEnvironmentVariable("MSBUILD_EXE_NAME"); 610string envPath = Environment.GetEnvironmentVariable(environmentVariable);
BackEnd\Components\Logging\LoggingService.cs (1)
323string queueCapacityEnvironment = Environment.GetEnvironmentVariable("MSBUILDLOGGINGQUEUECAPACITY");
BackEnd\Components\Logging\LoggingServiceLogMethods.cs (4)
232message += Environment.NewLine + "This is an unhandled exception from a task -- PLEASE OPEN A BUG AGAINST THE TASK OWNER."; 236message += Environment.NewLine + exception.ToString(); 266message += Environment.NewLine + "This is an unhandled exception from a task -- PLEASE OPEN A BUG AGAINST THE TASK OWNER."; 271message += Environment.NewLine + exception.ToString();
BackEnd\Components\ProjectCache\ProjectCacheService.cs (1)
36private static readonly ParallelOptions s_parallelOptions = new() { MaxDegreeOfParallelism = Environment.ProcessorCount };
BackEnd\Components\RequestBuilder\RequestBuilder.cs (1)
692if (Environment.GetEnvironmentVariable("MSBUILDFORCESTA") == "1")
BackEnd\Components\RequestBuilder\TargetUpToDateChecker.cs (1)
1255private static readonly bool s_sortInputsOutputs = (Environment.GetEnvironmentVariable("MSBUILDSORTINPUTSOUTPUTS") == "1");
BackEnd\Components\RequestBuilder\TaskBuilder.cs (2)
850if (ExceptionHandling.IsCriticalException(ex) || Environment.GetEnvironmentVariable("MSBUILDDONOTCATCHTASKEXCEPTIONS") == "1") 941if (ExceptionHandling.IsCriticalException(taskException) || (Environment.GetEnvironmentVariable("MSBUILDDONOTCATCHTASKEXCEPTIONS") == "1"))
BackEnd\Components\RequestBuilder\TaskHost.cs (4)
47private static readonly bool s_breakOnLogAfterTaskReturns = Environment.GetEnvironmentVariable("MSBUILDBREAKONLOGAFTERTASKRETURNS") == "1"; 362_yieldThreadId = Environment.CurrentManagedThreadId; 391Assumed.Equal(_yieldThreadId, Environment.CurrentManagedThreadId, $"Cannot call Reacquire() on thread {Environment.CurrentManagedThreadId} when Yield() was called on thread {_yieldThreadId}");
BackEnd\Components\Scheduler\Scheduler.cs (7)
227_schedulingUnlimitedVariable = Environment.GetEnvironmentVariable("MSBUILDSCHEDULINGUNLIMITED"); 238string strNodeLimitOffset = Environment.GetEnvironmentVariable("MSBUILDNODELIMITOFFSET"); 253if (!int.TryParse(Environment.GetEnvironmentVariable("MSBUILDCORELIMIT"), out _coreLimit) || _coreLimit <= 0) 260if (!int.TryParse(Environment.GetEnvironmentVariable("MSBUILDNODECOREALLOCATIONWEIGHT"), out _nodeCoreAllocationWeight) 915string customScheduler = Environment.GetEnvironmentVariable("MSBUILDCUSTOMSCHEDULER"); 960string multiplier = Environment.GetEnvironmentVariable("MSBUILDCUSTOMSCHEDULERFORSQLCONFIGURATIONLIMITMULTIPLIER"); 2684file.Write("{0}({1})-{2}: ", Thread.CurrentThread.Name, Environment.CurrentManagedThreadId, _schedulingData.EventTime.Ticks);
BackEnd\Components\SdkResolution\SdkResolverLoader.cs (3)
25private readonly string IncludeDefaultResolver = Environment.GetEnvironmentVariable("MSBUILDINCLUDEDEFAULTSDKRESOLVER"); 29private readonly string AdditionalResolversFolder = Environment.GetEnvironmentVariable( 35?? Environment.GetEnvironmentVariable("MSBUILDADDITIONALSDKRESOLVERSFOLDER");
BackEnd\Components\SdkResolution\SdkResolverService.cs (4)
259loggingContext.LogError(new BuildEventFileInfo(sdkReferenceLocation), "SingleResolverFailedToResolveSDK", sdk.Name, resolvers[0].Name, string.Join(Environment.NewLine, errors)); 264loggingContext.LogError(new BuildEventFileInfo(sdkReferenceLocation), "FailedToResolveSDK", sdk.Name, string.Join($"{Environment.NewLine} ", errors)); 385string resultWarnings = result.Warnings?.Any() == true ? string.Join(Environment.NewLine, result.Warnings) : "null"; 386string resultErrors = result.Errors?.Any() == true ? string.Join(Environment.NewLine, result.Errors) : "null";
BackEnd\Node\OutOfProcNode.cs (5)
566if (Environment.GetEnvironmentVariable("MSBUILDCLEARXMLCACHEONCHILDNODES") == "1") 735Environment.SetEnvironmentVariable(key, null); 742Environment.SetEnvironmentVariable(environmentPair.Key, environmentPair.Value); 827string forwardPropertiesFromChild = Environment.GetEnvironmentVariable("MSBUILDFORWARDPROPERTIESFROMCHILD"); 839string forwardAllProperties = Environment.GetEnvironmentVariable("MSBUILDFORWARDALLPROPERTIESFROMCHILD");
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (1)
1082Environment.NewLine + e.InnerException);
BuildCheck\Checks\UntrustedLocationCheck.cs (3)
97string? locationFromEnv = Environment.GetEnvironmentVariable("XDG_DOWNLOAD_DIR"); 104return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Downloads");
BuildCheck\Infrastructure\BuildCheckBuildEventHandler.cs (4)
171checkContext.DispatchAsCommentFromText(MessageImportance.Low, $"BuildCheck run times{Environment.NewLine}"); 180=> title + Environment.NewLine + String.Join(Environment.NewLine, rowData.Select(a => $"{a.Key},{a.Value}")) + Environment.NewLine;
Construction\ProjectElementContainer.cs (2)
577var leadingWhitespaceNode = XmlDocument.CreateWhitespace(Environment.NewLine + parentIndentation + DEFAULT_INDENT); 578var trailingWhiteSpaceNode = XmlDocument.CreateWhitespace(Environment.NewLine + parentIndentation);
Definition\Project.cs (1)
55private static readonly bool s_debugEvaluation = (Environment.GetEnvironmentVariable("MSBUILDDEBUGEVALUATION") != null);
ElementLocation\XmlDocumentWithLocation.cs (5)
364string windowsFolder = Environment.GetFolderPath(Environment.SpecialFolder.Windows); 386if (String.Equals(Environment.GetEnvironmentVariable("MSBuildLoadMicrosoftTargetsReadOnly"), "true", StringComparison.OrdinalIgnoreCase)) 391if (String.Equals(Environment.GetEnvironmentVariable("MSBUILDLOADALLFILESASREADONLY"), "1", StringComparison.OrdinalIgnoreCase)) 397if (String.Equals(Environment.GetEnvironmentVariable("MSBUILDLOADALLFILESASWRITEABLE"), "1", StringComparison.OrdinalIgnoreCase))
Evaluation\ConditionEvaluator.cs (1)
172private static readonly bool s_disableExpressionCaching = (Environment.GetEnvironmentVariable("MSBUILDDONOTCACHEEXPRESSIONS") == "1");
Evaluation\Expander.cs (1)
4351if (Environment.GetEnvironmentVariable("MSBUILDENABLEALLPROPERTYFUNCTIONS") == "1")
Evaluation\ItemSpec.cs (1)
585_normalize = options == MatchOnMetadataOptions.PathLike ? (Func<string, string>)(p => FileUtilities.NormalizePathForComparisonNoThrow(p, Environment.CurrentDirectory)) : p => p;
Evaluation\ProjectRootElementCache.cs (3)
75int.TryParse(Environment.GetEnvironmentVariable("MSBUILDPROJECTROOTELEMENTCACHESIZE"), out int cacheSize) ? cacheSize : 200; 80private static readonly bool s_debugLogCacheActivity = Environment.GetEnvironmentVariable("MSBUILDDEBUGXMLCACHE") == "1"; 88private static readonly bool s_сheckFileContent = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDCACHECHECKFILECONTENT"));
Instance\ProjectInstance.cs (3)
3054foreach (DictionaryEntry environmentVariable in Environment.GetEnvironmentVariables()) 3071Environment.SetEnvironmentVariable(environmentVariableName, null); 3084Environment.SetEnvironmentVariable(clearedVariable.Key as string, clearedVariable.Value as string);
Instance\TaskFactories\AssemblyTaskFactory.cs (2)
265ProjectErrorUtilities.ThrowInvalidProject(elementLocation, "TaskLoadFailure", taskName, loadInfo.AssemblyLocation, Environment.NewLine + e.InnerException.ToString()); 479ProjectErrorUtilities.ThrowInvalidProject(elementLocation, "TaskLoadFailure", taskName, _loadedType.Assembly.AssemblyLocation, Environment.NewLine + e.InnerException.ToString());
Instance\TaskRegistry.cs (1)
1479ProjectErrorUtilities.ThrowInvalidProject(elementLocation, "TaskFactoryLoadFailure", TaskFactoryAttributeName, taskFactoryLoadInfo.AssemblyLocation, Environment.NewLine + e.InnerException.ToString());
Logging\BaseConsoleLogger.cs (2)
143WriteHandler(Environment.NewLine); 883Traits.LogAllEnvironmentVariables = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDLOGALLENVIRONMENTVARIABLES"));
Logging\BinaryLogger\BinaryLogger.cs (7)
347_initialIsBinaryLoggerEnabled = Environment.GetEnvironmentVariable("MSBUILDBINARYLOGGERENABLED"); 349Environment.SetEnvironmentVariable("MSBUILDTARGETOUTPUTLOGGING", "true"); 350Environment.SetEnvironmentVariable("MSBUILDLOGIMPORTS", "1"); 351Environment.SetEnvironmentVariable("MSBUILDBINARYLOGGERENABLED", bool.TrueString); 497Environment.SetEnvironmentVariable("MSBUILDTARGETOUTPUTLOGGING", _initialTargetOutputLogging ? "true" : null); 498Environment.SetEnvironmentVariable("MSBUILDLOGIMPORTS", _initialLogImports ? "1" : null); 499Environment.SetEnvironmentVariable("MSBUILDBINARYLOGGERENABLED", _initialIsBinaryLoggerEnabled);
Logging\BinaryLogger\BuildEventArgsReader.cs (1)
1864if (!Environment.Is64BitProcess)
Logging\OptimizedStringIndenter.cs (3)
64int indentedStringLength = segments.Length * (Environment.NewLine.Length + indent); 86Environment.NewLine.CopyTo(output); 87output = output.Slice(Environment.NewLine.Length);
Logging\ParallelLogger\ConsoleOutputAligner.cs (1)
59int estimatedCapacity = message.Length + ((prefixAlreadyWritten ? 0 : prefixWidth) + Environment.NewLine.Length) * (message.Length / averageLineLength + 1);
Logging\TerminalLogger\TerminalLogger.cs (2)
126private readonly string _initialWorkingDirectory = Environment.CurrentDirectory; 291string tlEnvVariable = Environment.GetEnvironmentVariable("MSBUILDTERMINALLOGGER") ?? string.Empty;
Resources\Constants.cs (1)
237var environmentType = new Tuple<string, Type>(null, typeof(Environment));
src\msbuild\artifacts\.packages\microsoft.codeanalysis.pooledobjects\5.0.0-1.25277.114\contentFiles\cs\netstandard2.0\ObjectPool`1.cs (1)
112: this(factory, Environment.ProcessorCount * 2, trimOnFree)
src\msbuild\src\Shared\Debugging\DebugUtils.cs (3)
178builder.Append(Environment.NewLine); 181builder.Append(Environment.NewLine); 183builder.Append(Environment.NewLine);
src\msbuild\src\Shared\LogMessagePacketBase.cs (2)
265private static readonly int s_defaultPacketVersion = (Environment.Version.Major * 10) + Environment.Version.Minor;
src\msbuild\src\Shared\TaskLoggingHelper.cs (3)
1258message += Environment.NewLine + exception.StackTrace; 1623bool diagnostics = Environment.GetEnvironmentVariable("MSBUILDDIAGNOSTICS") != null; 1630message += Environment.NewLine + exception.StackTrace;
src\msbuild\src\Shared\Tracing.cs (2)
60string val = Environment.GetEnvironmentVariable("MSBUILDTRACEINTERVAL"); 121Trace.WriteLine(System.Environment.StackTrace);
Utilities\EngineFileUtilities.cs (1)
572string? wildCards = Environment.GetEnvironmentVariable("MsBuildSkipEagerWildCardEvaluationRegexes");
Utilities\Utilities.cs (12)
38private static bool s_shouldTreatHigherToolsVersionsAsCurrent = (Environment.GetEnvironmentVariable("MSBUILDTREATHIGHERTOOLSVERSIONASCURRENT") != null); 44private static bool s_shouldTreatOtherToolsVersionsAsCurrent = (Environment.GetEnvironmentVariable("MSBUILDTREATALLTOOLSVERSIONSASCURRENT") != null); 51private static bool s_uselegacyDefaultToolsVersionBehavior = (Environment.GetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION") != null); 56private static string s_defaultToolsVersionFromEnvironment = Environment.GetEnvironmentVariable("MSBUILDDEFAULTTOOLSVERSION"); 72s_shouldTreatHigherToolsVersionsAsCurrent = (Environment.GetEnvironmentVariable("MSBUILDTREATHIGHERTOOLSVERSIONASCURRENT") != null); 73s_shouldTreatOtherToolsVersionsAsCurrent = (Environment.GetEnvironmentVariable("MSBUILDTREATALLTOOLSVERSIONSASCURRENT") != null); 74s_uselegacyDefaultToolsVersionBehavior = (Environment.GetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION") != null); 75s_defaultToolsVersionFromEnvironment = Environment.GetEnvironmentVariable("MSBUILDDEFAULTTOOLSVERSION"); 560localAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); 565localAppData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
Microsoft.Build.Framework (117)
BackEnd\CommunicationsUtilities.cs (4)
238/// Sets an environment variable using <see cref="Environment.SetEnvironmentVariable(string,string)" />. 241=> Environment.SetEnvironmentVariable(name, value); 265IDictionary vars = Environment.GetEnvironmentVariables(); 775writer.WriteLine($"{Thread.CurrentThread.Name} (TID {Environment.CurrentManagedThreadId}) {now,15} +{millisecondsSinceLastLog,10}ms: {message}");
BackEnd\Handshake.cs (1)
81string handshakeSalt = Environment.GetEnvironmentVariable("MSBUILDNODEHANDSHAKESALT") ?? "";
BuildEnvironmentHelper.cs (2)
456return Environment.GetEnvironmentVariable(variable); 696return Environment.GetEnvironmentVariable("MSBuildSDKsPath") ?? defaultSdkPath;
BuildEnvironmentState.cs (3)
32string? msbuildHostName = Environment.GetEnvironmentVariable("MSBUILD_HOST_NAME"); 38if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("VSCODE_CWD")) 39|| string.Equals(Environment.GetEnvironmentVariable("TERM_PROGRAM"), "vscode", StringComparison.OrdinalIgnoreCase))
ChangeWaves.cs (1)
136string msbuildDisableFeaturesFromVersion = Environment.GetEnvironmentVariable("MSBUILDDISABLEFEATURESFROMVERSION");
DebugUtils.cs (5)
68string environmentDebugPath = FileUtilities.TrimAndStripAnyQuotes(Environment.GetEnvironmentVariable("MSBUILDDEBUGPATH")); 89Environment.SetEnvironmentVariable("MSBUILDDEBUGPATH", debugDirectory); 102() => NodeModeHelper.ExtractFromCommandLine(Environment.CommandLine)); 106var processNameToBreakInto = Environment.GetEnvironmentVariable("MSBuildDebugProcessName"); 124private static string GetProcessInfoString() => $"{(ProcessNodeMode.Value?.ToString() ?? "CentralNode")}_{EnvironmentUtilities.ProcessName}_PID={EnvironmentUtilities.CurrentProcessId}_x{(Environment.Is64BitProcess ? "64" : "86")}";
DotnetHostEnvironmentHelper.cs (4)
53Environment.SetEnvironmentVariable(DotnetRootEnvVarName, null); 60Environment.SetEnvironmentVariable(varName, null); 74string? resolvedPath = dotnetHostPath ?? Environment.GetEnvironmentVariable(Constants.DotnetHostPathEnvVarName); 139dotnetHostPath ??= Environment.GetEnvironmentVariable(Constants.DotnetHostPathEnvVarName);
EncodingUtilities.cs (3)
303if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && Environment.OSVersion.Version.Major >= 10) // UTF-8 is only officially supported on 10+. 325return string.Equals(Environment.GetEnvironmentVariable("DOTNET_CLI_FORCE_UTF8_ENCODING"), "true", StringComparison.OrdinalIgnoreCase); 338string? dotnetCliLanguage = Environment.GetEnvironmentVariable("DOTNET_CLI_UI_LANGUAGE");
EnvironmentUtilities.cs (5)
30return Environment.ProcessId; 64return Environment.ProcessPath; 116string? value = Environment.GetEnvironmentVariable(name); 135string? value = Environment.GetEnvironmentVariable(name); 151string? value = Environment.GetEnvironmentVariable(name);
ErrorUtilities.cs (1)
18private static readonly bool s_enableMSBuildDebugTracing = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDENABLEDEBUGTRACING"));
FileClassifier.cs (1)
124string? programFiles = Environment.GetEnvironmentVariable(programFilesEnv);
FileUtilities.cs (2)
1119if (!int.TryParse(Environment.GetEnvironmentVariable("MSBUILDDIRECTORYDELETERETRYCOUNT"), out retryCount)) 1124if (!int.TryParse(Environment.GetEnvironmentVariable("MSBUILDDIRECTORYDELETRETRYTIMEOUT"), out retryTimeOut))
FileUtilities_TempFiles.cs (1)
42if (string.Equals(Environment.GetEnvironmentVariable("MSBUILDPRESERVETOOLTEMPFILES"), "1", StringComparison.Ordinal))
InternalErrorException.cs (3)
115if (Environment.GetEnvironmentVariable("MSBUILDLAUNCHDEBUGGER") != null) 122if (!RunningTests() && Environment.GetEnvironmentVariable("MSBUILDDONOTLAUNCHDEBUGGER") == null 123&& Environment.GetEnvironmentVariable("_NTROOT") == null)
LazyFormattedBuildEventArgs.cs (1)
128argValue = $"Argument conversion to string failed{Environment.NewLine}{e}";
MSBuildConstants.cs (1)
131internal static readonly string[] EnvironmentNewLine = [Environment.NewLine];
MultiProcessTaskEnvironmentDriver.cs (1)
48return Environment.GetEnvironmentVariable(name);
MultiThreadedTaskEnvironmentDriver.cs (1)
46IDictionary variables = Environment.GetEnvironmentVariables();
NativeMethods.cs (2)
194int numberOfCpus = Environment.ProcessorCount; 1299acceptAnsiColorCodes = AnsiDetector.IsAnsiSupported(Environment.GetEnvironmentVariable("TERM"));
src\msbuild\artifacts\.packages\microsoft.codeanalysis.contracts\5.0.0-1.25277.114\contentFiles\cs\net9.0\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
Traits.cs (63)
31DebugScheduler = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDDEBUGSCHEDULER")); 32DebugNodeCommunication = DebugEngine || !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDDEBUGCOMM")); 37internal readonly string? MSBuildDisableFeaturesFromVersion = Environment.GetEnvironmentVariable("MSBUILDDISABLEFEATURESFROMVERSION"); 40public readonly bool ForceAllTasksOutOfProcToTaskHost = Environment.GetEnvironmentVariable("MSBUILDFORCEALLTASKSOUTOFPROC") == "1"; 46public readonly bool ForceMultiThreaded = Environment.GetEnvironmentVariable("MSBUILDFORCEMULTITHREADED") == "1"; 51public readonly bool UseLazyWildCardEvaluation = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MsBuildSkipEagerWildCardEvaluationRegexes")); 52public readonly bool LogExpandedWildcards = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDLOGEXPANDEDWILDCARDS")); 53public readonly bool ThrowOnDriveEnumeratingWildcard = Environment.GetEnvironmentVariable("MSBUILDFAILONDRIVEENUMERATINGWILDCARD") == "1"; 58public readonly bool CacheFileExistence = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MsBuildCacheFileExistence")); 60public readonly bool UseSimpleProjectRootElementCacheConcurrency = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MsBuildUseSimpleProjectRootElementCacheConcurrency")); 65public readonly bool MSBuildCacheFileEnumerations = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MsBuildCacheFileEnumerations")); 67public readonly bool EnableAllPropertyFunctions = Environment.GetEnvironmentVariable("MSBUILDENABLEALLPROPERTYFUNCTIONS") == "1"; 72public readonly bool EnableRestoreFirst = Environment.GetEnvironmentVariable("MSBUILDENABLERESTOREFIRST") == "1"; 77public static readonly string? MSBuildNodeHandshakeSalt = Environment.GetEnvironmentVariable("MSBUILDNODEHANDSHAKESALT"); 82public readonly bool ForceEvaluateAsFullFramework = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MsBuildForceEvaluateAsFullFramework")); 95public readonly bool EmitSolutionMetaproj = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBuildEmitSolution")); 105public readonly bool SolutionBatchTargets = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBuildSolutionBatchTargets")); 110public readonly bool LogPropertyFunctionsRequiringReflection = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBuildLogPropertyFunctionsRequiringReflection")); 115public readonly bool LogAllAssemblyLoads = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDLOGALLASSEMBLYLOADS")); 120public static bool LogAllEnvironmentVariables = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDLOGALLENVIRONMENTVARIABLES")); 136public readonly bool EnableRarNode = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBuildRarNode")); 158public static string? MSBuildLoggingArgs => Environment.GetEnvironmentVariable(MSBuildLoggingArgsEnvVarName); 163public readonly bool EmitLogsAsMessage = string.Equals(Environment.GetEnvironmentVariable(MSBuildLoggingArgsLevelEnvVarName), "message", StringComparison.OrdinalIgnoreCase); 165public readonly bool DebugEngine = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBuildDebugEngine")); 168public readonly bool DebugUnitTests = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBuildDebugUnitTests")); 170public readonly bool InProcNodeDisabled = Environment.GetEnvironmentVariable("MSBUILDNOINPROCNODE") == "1"; 175public readonly bool ForceTaskFactoryOutOfProc = Environment.GetEnvironmentVariable("MSBUILDFORCEINLINETASKFACTORIESOUTOFPROC") == "1"; 180public readonly bool ConsoleUseDefaultEncoding = Environment.GetEnvironmentVariable("MSBUILD_CONSOLE_USE_DEFAULT_ENCODING") == "1" || Environment.GetEnvironmentVariable("DOTNET_CLI_CONSOLE_USE_DEFAULT_ENCODING") == "1"; 195public readonly bool SlnParsingWithSolutionPersistenceOptIn = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILD_PARSE_SLN_WITH_SOLUTIONPERSISTENCE")); 212public readonly bool DoNotSendDeferredMessagesToBuildManager = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MsBuildDoNotSendDeferredMessagesToBuildManager")); 218public readonly bool DoNotExpandQualifiedMetadataInUpdateOperation = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBuildDoNotExpandQualifiedMetadataInUpdateOperation")); 228public readonly bool AlwaysUseContentTimestamp = Environment.GetEnvironmentVariable("MSBUILDALWAYSCHECKCONTENTTIMESTAMP") == "1"; 234public readonly bool TruncateTaskInputs = Environment.GetEnvironmentVariable("MSBUILDTRUNCATETASKINPUTS") == "1"; 239public readonly bool DoNotTruncateConditions = Environment.GetEnvironmentVariable("MSBuildDoNotTruncateConditions") == "1"; 244public readonly bool AlwaysEvaluateDangerousGlobs = Environment.GetEnvironmentVariable("MSBuildAlwaysEvaluateDangerousGlobs") == "1"; 249public readonly bool AlwaysDoImmutableFilesUpToDateCheck = Environment.GetEnvironmentVariable("MSBUILDDONOTCACHEMODIFICATIONTIME") == "1"; 254public readonly bool CopyWithoutDelete = Environment.GetEnvironmentVariable("MSBUILDCOPYWITHOUTDELETE") == "1"; 271_logProjectImports = !String.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDLOGIMPORTS")); 288_logTaskInputs = Environment.GetEnvironmentVariable("MSBUILDLOGTASKINPUTS") == "1"; 307var variable = Environment.GetEnvironmentVariable("MSBUILDLOGPROPERTIESANDITEMSAFTEREVALUATION"); 327public readonly bool CacheAssemblyInformation = Environment.GetEnvironmentVariable("MSBUILDDONOTCACHERARASSEMBLYINFORMATION") != "1"; 334public readonly bool UseSymlinkTimeInsteadOfTargetTime = Environment.GetEnvironmentVariable("MSBUILDUSESYMLINKTIMESTAMP") == "1"; 339public readonly bool ReuseTaskHostNodes = Environment.GetEnvironmentVariable("MSBUILDREUSETASKHOSTNODES") == "1"; 344public readonly bool IgnoreEmptyImports = Environment.GetEnvironmentVariable("MSBUILDIGNOREEMPTYIMPORTS") == "1"; 349public readonly bool IgnoreTreatAsLocalProperty = Environment.GetEnvironmentVariable("MSBUILDIGNORETREATASLOCALPROPERTY") != null; 354public readonly bool DebugEvaluation = Environment.GetEnvironmentVariable("MSBUILDDEBUGEVALUATION") != null; 359public readonly bool WarnOnUninitializedProperty = !String.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDWARNONUNINITIALIZEDPROPERTY")); 367public readonly bool UseCaseSensitiveItemNames = Environment.GetEnvironmentVariable("MSBUILDUSECASESENSITIVEITEMNAMES") == "1"; 372public readonly bool DisableLongPaths = Environment.GetEnvironmentVariable("MSBUILDDISABLELONGPATHS") == "1"; 377public readonly bool DisableSdkResolutionCache = Environment.GetEnvironmentVariable("MSBUILDDISABLESDKCACHE") == "1"; 382public readonly bool TargetPathForRelatedFiles = Environment.GetEnvironmentVariable("MSBUILDTARGETPATHFORRELATEDFILES") == "1"; 387public readonly bool UseSingleLoadContext = Environment.GetEnvironmentVariable("MSBUILDSINGLELOADCONTEXT") == "1"; 394public readonly bool UseCustomLoadContextForDependenciesInToolsDirectory = Environment.GetEnvironmentVariable("MSBUILDUSECUSTOMLOADCONTEXTFORDEPENDENCIESINTOOLSDIRECTORY") == "1"; 399public readonly bool UseAutoRunWhenLaunchingProcessUnderCmd = Environment.GetEnvironmentVariable("MSBUILDUSERAUTORUNINCMD") == "1"; 404public readonly bool AvoidUnicodeWhenWritingToolTaskBatch = Environment.GetEnvironmentVariable("MSBUILDAVOIDUNICODE") == "1"; 409public readonly bool EnsureStdOutForChildNodesIsPrimaryStdout = Environment.GetEnvironmentVariable("MSBUILDENSURESTDOUTFORTASKPROCESSES") == "1"; 417public readonly bool UseMinimalResxParsingInCoreScenarios = Environment.GetEnvironmentVariable("MSBUILDUSEMINIMALRESX") == "1"; 425public readonly bool DoNotVersionBuildResult = Environment.GetEnvironmentVariable("MSBUILDDONOTVERSIONBUILDRESULT") == "1"; 430public readonly bool DoNotLimitBuildCheckResultsNumber = Environment.GetEnvironmentVariable("MSBUILDDONOTLIMITBUILDCHECKRESULTSNUMBER") == "1"; 465var value = Environment.GetEnvironmentVariable(environmentVariable); 479var mode = Environment.GetEnvironmentVariable("MSBUILD_PROJECTINSTANCE_TRANSLATION_MODE"); 501var mode = Environment.GetEnvironmentVariable("MSBUILD_SDKREFERENCE_PROPERTY_EXPANSION_MODE");
Utilities\FrameworkLocationHelper.cs (8)
140internal static readonly string programFiles = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles); 841string complusInstallRoot = Environment.GetEnvironmentVariable("COMPLUS_INSTALLROOT"); 842string complusVersion = Environment.GetEnvironmentVariable("COMPLUS_VERSION"); 936string programFilesX86 = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86); 958programFilesX64 = Environment.GetEnvironmentVariable("ProgramW6432"); 976string combinedPath = Environment.GetEnvironmentVariable("ReferenceAssemblyRoot");
Utilities\ProcessExtensions.cs (1)
75string? value = Environment.GetEnvironmentVariable("MSBUILDPROCESSCOMMANDLINESOURCE");
Microsoft.Build.Tasks.CodeAnalysis (20)
src\roslyn\src\Compilers\Core\MSBuildTask\ManagedCompiler.cs (1)
647string? libDirectory = Environment.GetEnvironmentVariable("LIB");
src\roslyn\src\Compilers\Core\MSBuildTask\ManagedToolTask.cs (2)
264.. Environment.GetEnvironmentVariables().Cast<System.Collections.DictionaryEntry>() 271if (RuntimeHostInfo.ShouldDisableTieredCompilation && Environment.GetEnvironmentVariable(RuntimeHostInfo.DotNetTieredCompilationEnvironmentName) == null)
src\roslyn\src\Compilers\Core\MSBuildTask\Vbc.cs (1)
240private static readonly string[] s_separator = { Environment.NewLine };
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (4)
221var originalThreadId = Environment.CurrentManagedThreadId; 282var releaseThreadId = Environment.CurrentManagedThreadId; 563var environmentVariables = GetServerEnvironmentVariables(Environment.GetEnvironmentVariables(), logger); 683var userName = Environment.UserName;
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (3)
120loggingFilePath = Environment.GetEnvironmentVariable(EnvironmentVariableName); 153var threadId = Environment.CurrentManagedThreadId; 155string output = prefix + message + Environment.NewLine;
src\roslyn\src\Compilers\Shared\RuntimeHostInfo.cs (3)
78if (Environment.GetEnvironmentVariable(DotNetHostPathEnvironmentName) is { Length: > 0 } pathToDotNet) 83if (Environment.GetEnvironmentVariable(DotNetExperimentalHostPathEnvironmentName) is { Length: > 0 } pathToDotNetExperimental) 92var path = Environment.GetEnvironmentVariable("PATH") ?? "";
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
Microsoft.Build.Tasks.Core (68)
AssemblyDependency\Node\OutOfProcRarNode.cs (1)
23: this(Environment.ProcessorCount)
BootstrapperUtil\BootstrapperBuilder.cs (5)
35private static readonly bool s_logging = !String.IsNullOrEmpty(Environment.GetEnvironmentVariable("VSPLOG")); 520productsOrder.Append(p.ProductCode).Append(Environment.NewLine); 1980return str.Replace("%NEWLINE%", Environment.NewLine); 2205Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
Exec.cs (1)
516return Environment.GetEnvironmentVariable("ComSpec");
GenerateApplicationManifest.cs (4)
230int t1 = Environment.TickCount; 249Util.WriteLog($"GenerateApplicationManifest.AddIsolatedComReferences t={Environment.TickCount - t1}"); 275int t1 = Environment.TickCount; 335Util.WriteLog($"GenerateApplicationManifest.AddClickOnceFiles t={Environment.TickCount - t1}");
GenerateManifestBase.cs (6)
428_startTime = Environment.TickCount; 516int t1 = Environment.TickCount; 526Util.WriteLog($"GenerateManifestBase.ResolveFiles t={Environment.TickCount - t1}"); 619int t1 = Environment.TickCount; 633Util.WriteLog($"GenerateManifestBase.WriteManifest t={Environment.TickCount - t1}"); 634Util.WriteLog($"Total time to generate manifest '{Path.GetFileName(OutputManifest.ItemSpec)}': t={Environment.TickCount - _startTime}");
ManifestUtil\ApplicationManifest.cs (4)
431int t1 = Environment.TickCount; 510Util.WriteLog($"GenerateManifest.CheckForComDuplicates t={Environment.TickCount - t1}"); 640int t1 = Environment.TickCount; 720Util.WriteLog($"GenerateManifest.CheckManifestReferences t={Environment.TickCount - t1}");
ManifestUtil\ComImporter.cs (1)
208if (Environment.Is64BitProcess)
ManifestUtil\EmbeddedManifestReader.cs (2)
74int t1 = Environment.TickCount; 76Util.WriteLog($"EmbeddedManifestReader.Read t={Environment.TickCount - t1}");
ManifestUtil\ManifestFormatter.cs (2)
16int t1 = Environment.TickCount; 98Util.WriteLog($"ManifestWriter.Format t={Environment.TickCount - t1}");
ManifestUtil\ManifestReader.cs (4)
177int t1 = Environment.TickCount; 219Util.WriteLog(String.Format(CultureInfo.InvariantCulture, "ManifestReader.ReadManifest t={0}", Environment.TickCount - t1)); 240int t1 = Environment.TickCount; 245Util.WriteLog($"ManifestReader.Deserialize t={Environment.TickCount - t1}");
ManifestUtil\ManifestWriter.cs (4)
28int t1 = Environment.TickCount; 30Util.WriteLog($"ManifestWriter.Serialize t={Environment.TickCount - t1}"); 94int t1 = Environment.TickCount; 190Util.WriteLog($"ManifestWriter.WriteManifest t={Environment.TickCount - t1}");
ManifestUtil\PathUtil.cs (1)
230$"{path.AsSpan(0, i)}{Environment.MachineName.ToLowerInvariant()}{path.AsSpan(i + localHost.Length)}" :
ManifestUtil\SecurityUtil.cs (3)
718Environment.GetFolderPath(Environment.SpecialFolder.Windows), 720Environment.Is64BitProcess ? "Framework64" : "Framework",
ManifestUtil\TrustInfo.cs (2)
704int t1 = Environment.TickCount; 794Util.WriteLog($"ManifestWriter.WriteTrustInfo t={Environment.TickCount - t1}");
ManifestUtil\Util.cs (5)
27internal static readonly string Schema = Environment.GetEnvironmentVariable("VSPSCHEMA"); 28internal static readonly bool logging = !String.IsNullOrEmpty(Environment.GetEnvironmentVariable("VSPLOG")); 116Version v = Environment.Version; 267string logPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"Microsoft\VisualStudio\8.0\VSPLOG");
ManifestUtil\XmlUtil.cs (10)
78int t1 = Environment.TickCount; 82int t2 = Environment.TickCount; 85Util.WriteLog($"new XPathDocument(1) t={Environment.TickCount - t2}"); 87int t3 = Environment.TickCount; 94Util.WriteLog($"XslCompiledTransform.Load t={Environment.TickCount - t3}"); 101int t4 = Environment.TickCount; 104Util.WriteLog($"new XmlReader(2) t={Environment.TickCount - t4}"); 125int t5 = Environment.TickCount; 127Util.WriteLog($"XslCompiledTransform.Transform t={Environment.TickCount - t4}"); 133Util.WriteLog($"XslCompiledTransform(\"{resource}\") t={Environment.TickCount - t1}");
RoslynCodeTaskFactory\RoslynCodeTaskFactory.cs (3)
732bool deleteSourceCodeFile = Environment.GetEnvironmentVariable("MSBUILDLOGCODETASKFACTORYOUTPUT") == null; 755string toolExe = Environment.GetEnvironmentVariable("CscToolExe"); 771string toolExe = Environment.GetEnvironmentVariable("VbcToolExe");
RoslynCodeTaskFactory\RoslynCodeTaskFactoryCompilers.cs (1)
55_dotnetCliPath = Environment.GetEnvironmentVariable(Constants.DotnetHostPathEnvVarName);
src\msbuild\src\Shared\AssemblyFolders\AssemblyFoldersEx.cs (1)
85bool is64bitOS = Environment.Is64BitOperatingSystem;
src\msbuild\src\Shared\AssemblyFolders\AssemblyFoldersFromConfig.cs (1)
43if (Environment.Is64BitOperatingSystem)
src\msbuild\src\Shared\Debugging\DebugUtils.cs (3)
178builder.Append(Environment.NewLine); 181builder.Append(Environment.NewLine); 183builder.Append(Environment.NewLine);
src\msbuild\src\Shared\LogMessagePacketBase.cs (2)
265private static readonly int s_defaultPacketVersion = (Environment.Version.Major * 10) + Environment.Version.Minor;
src\msbuild\src\Shared\Tracing.cs (2)
60string val = Environment.GetEnvironmentVariable("MSBUILDTRACEINTERVAL"); 121Trace.WriteLine(System.Environment.StackTrace);
Microsoft.Build.Tasks.Git (4)
GitDataReader\GitEnvironment.cs (4)
85return Environment.GetEnvironmentVariable(name); 96homeDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile, Environment.SpecialFolderOption.DoNotVerify);
Microsoft.Build.Utilities.Core (23)
AssemblyFolders\AssemblyFoldersFromConfigInfo.cs (1)
35DirectoryPath = Environment.ExpandEnvironmentVariables(directoryPath);
CommandLineBuilder.cs (1)
220CommandLine.Append(Environment.NewLine);
src\msbuild\src\Shared\AssemblyFolders\AssemblyFoldersEx.cs (1)
85bool is64bitOS = Environment.Is64BitOperatingSystem;
src\msbuild\src\Shared\AssemblyFolders\AssemblyFoldersFromConfig.cs (1)
43if (Environment.Is64BitOperatingSystem)
src\msbuild\src\Shared\Debugging\DebugUtils.cs (3)
178builder.Append(Environment.NewLine); 181builder.Append(Environment.NewLine); 183builder.Append(Environment.NewLine);
src\msbuild\src\Shared\TaskLoggingHelper.cs (3)
1258message += Environment.NewLine + exception.StackTrace; 1623bool diagnostics = Environment.GetEnvironmentVariable("MSBUILDDIAGNOSTICS") != null; 1630message += Environment.NewLine + exception.StackTrace;
src\msbuild\src\Shared\Tracing.cs (2)
60string val = Environment.GetEnvironmentVariable("MSBUILDTRACEINTERVAL"); 121Trace.WriteLine(System.Environment.StackTrace);
ToolLocationHelper.cs (9)
1626return Environment.GetFolderPath(Environment.SpecialFolder.System); 1829if (!Environment.Is64BitOperatingSystem || platformTarget.Equals("x86", StringComparison.OrdinalIgnoreCase) || platformTarget.Equals("arm", StringComparison.OrdinalIgnoreCase)) 2872bool is64bitOS = Environment.Is64BitOperatingSystem; 2900string userLocalAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); 2948string sdkDirectoryRootsFromEnvironment = Environment.GetEnvironmentVariable("MSBUILDSDKREFERENCEDIRECTORY"); 2975string sdkDirectoryRootsFromEnvironment = Environment.GetEnvironmentVariable("MSBUILDMULTIPLATFORMSDKREFERENCEDIRECTORY"); 2995string disableRegistryForSDKLookup = Environment.GetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP");
ToolTask.cs (2)
63private static readonly bool s_preserveTempFiles = string.Equals(Environment.GetEnvironmentVariable("MSBUILDPRESERVETOOLTEMPFILES"), "1", StringComparison.Ordinal); 1555$@"%SystemRoot%\System32\chcp.com {encoding.CodePage}>nul{Environment.NewLine}",
Microsoft.CodeAnalysis (31)
Collections\CachingFactory.cs (1)
200Environment.ProcessorCount * 2);
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
337private readonly int _workerCount = Environment.ProcessorCount;
DiagnosticAnalyzer\AnalyzerExecutor.cs (3)
1387Environment.FailFast(CreateAnalyzerExceptionDiagnostic(analyzer, ex, info).ToString()); 1441var contextInformation = string.Join(Environment.NewLine, CreateDiagnosticDescription(info, e), CreateDisablingMessage(analyzer, analyzerName)).Trim(); 1454return string.Join(Environment.NewLine,
DiagnosticAnalyzer\ProgramFilesAnalyzerPathResolver.cs (2)
34var programFilesPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
DiaSymReader\SymUnmanagedFactory.cs (1)
83foreach (var method in typeof(Environment).GetTypeInfo().GetDeclaredMethods("GetEnvironmentVariable"))
FileSystem\PathUtilities.cs (2)
99var parentPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
InternalUtilities\NoMessagePumpSyncContext.cs (1)
58if (Environment.OSVersion.Platform == PlatformID.Win32NT)
InternalUtilities\RoslynParallel.cs (2)
15internal static readonly ParallelOptions DefaultParallelOptions = new ParallelOptions() { MaxDegreeOfParallelism = Environment.ProcessorCount }; 21? new ParallelOptions { CancellationToken = cancellationToken, MaxDegreeOfParallelism = Environment.ProcessorCount }
InternalUtilities\StringTable.cs (3)
67private int _localRandom = Environment.TickCount; 70private static int s_sharedRandom = Environment.TickCount; 90var pool = new ObjectPool<StringTable>(pool => new StringTable(pool), Environment.ProcessorCount * 2);
InternalUtilities\TextKeyedCache.cs (1)
88Environment.ProcessorCount * 4);
Interop\ClrStrongName.cs (2)
39if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("COMPLUS_InstallRoot"))) 41var version = Environment.GetEnvironmentVariable("COMPLUS_Version");
RuleSet\RuleSetInclude.cs (1)
107includePath = Environment.ExpandEnvironmentVariables(includePath);
SourceGeneration\GeneratorDriver.cs (1)
453Environment.FailFast(CreateGeneratorExceptionDiagnostic(messageProvider, sourceGenerator, e, isInit).ToString());
src\roslyn\src\Compilers\Core\AnalyzerDriver\AnalyzerExceptionDescriptionBuilder.cs (2)
16private static readonly string s_separator = Environment.NewLine + "-----" + Environment.NewLine;
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
72: this(factory, Environment.ProcessorCount * 2, trimOnFree, trackLeaks, filePath, lineNumber)
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
121_outstanding.TryAdd(obj, new AllocationInfo(obj.GetType(), poolName, _traceLeaks ? Environment.StackTrace : null));
Microsoft.CodeAnalysis.Analyzers (29)
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (2)
99var parentPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
58if (Environment.OSVersion.Platform == PlatformID.Win32NT)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (3)
67private int _localRandom = Environment.TickCount; 70private static int s_sharedRandom = Environment.TickCount; 90var pool = new ObjectPool<StringTable>(pool => new StringTable(pool), Environment.ProcessorCount * 2);
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
72: this(factory, Environment.ProcessorCount * 2, trimOnFree, trackLeaks, filePath, lineNumber)
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
121_outstanding.TryAdd(obj, new AllocationInfo(obj.GetType(), poolName, _traceLeaks ? Environment.StackTrace : null));
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (5)
36/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 54/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 214/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 232/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 374private static int DefaultDegreeOfParallelism => Environment.ProcessorCount;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (1)
173foreach (var line in child.ToString().Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingOptions2.cs (1)
47_ => Environment.NewLine
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\LineFormattingOptions.cs (1)
19[DataMember] public string NewLine { get; init; } = Environment.NewLine;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.LogBlock.cs (3)
17private static readonly ObjectPool<RoslynLogBlock> s_pool = new(() => new RoslynLogBlock(s_pool!), Math.Min(Environment.ProcessorCount * 8, 256)); 49_tick = Environment.TickCount; 66var delta = Environment.TickCount - _tick;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
285: reason + Environment.NewLine + restString;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (3)
47/// The <see cref="Environment.CurrentManagedThreadId" /> of the thread that holds the lock. Zero if no thread is holding 193return _owningThreadId == Environment.CurrentManagedThreadId; 204_owningThreadId = Environment.CurrentManagedThreadId;
Microsoft.CodeAnalysis.AnalyzerUtilities (29)
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (2)
99var parentPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
58if (Environment.OSVersion.Platform == PlatformID.Win32NT)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (3)
67private int _localRandom = Environment.TickCount; 70private static int s_sharedRandom = Environment.TickCount; 90var pool = new ObjectPool<StringTable>(pool => new StringTable(pool), Environment.ProcessorCount * 2);
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
72: this(factory, Environment.ProcessorCount * 2, trimOnFree, trackLeaks, filePath, lineNumber)
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
121_outstanding.TryAdd(obj, new AllocationInfo(obj.GetType(), poolName, _traceLeaks ? Environment.StackTrace : null));
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (5)
36/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 54/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 214/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 232/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 374private static int DefaultDegreeOfParallelism => Environment.ProcessorCount;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (1)
173foreach (var line in child.ToString().Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingOptions2.cs (1)
47_ => Environment.NewLine
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\LineFormattingOptions.cs (1)
19[DataMember] public string NewLine { get; init; } = Environment.NewLine;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.LogBlock.cs (3)
17private static readonly ObjectPool<RoslynLogBlock> s_pool = new(() => new RoslynLogBlock(s_pool!), Math.Min(Environment.ProcessorCount * 8, 256)); 49_tick = Environment.TickCount; 66var delta = Environment.TickCount - _tick;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
285: reason + Environment.NewLine + restString;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (3)
47/// The <see cref="Environment.CurrentManagedThreadId" /> of the thread that holds the lock. Zero if no thread is holding 193return _owningThreadId == Environment.CurrentManagedThreadId; 204_owningThreadId = Environment.CurrentManagedThreadId;
Microsoft.CodeAnalysis.CodeStyle (29)
src\roslyn\src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderHelper.cs (1)
122var eolLength = Environment.NewLine.Length;
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (2)
99var parentPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
58if (Environment.OSVersion.Platform == PlatformID.Win32NT)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (3)
67private int _localRandom = Environment.TickCount; 70private static int s_sharedRandom = Environment.TickCount; 90var pool = new ObjectPool<StringTable>(pool => new StringTable(pool), Environment.ProcessorCount * 2);
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
72: this(factory, Environment.ProcessorCount * 2, trimOnFree, trackLeaks, filePath, lineNumber)
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
121_outstanding.TryAdd(obj, new AllocationInfo(obj.GetType(), poolName, _traceLeaks ? Environment.StackTrace : null));
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (5)
36/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 54/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 214/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 232/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 374private static int DefaultDegreeOfParallelism => Environment.ProcessorCount;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingOptions2.cs (1)
47_ => Environment.NewLine
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\LineFormattingOptions.cs (1)
19[DataMember] public string NewLine { get; init; } = Environment.NewLine;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.LogBlock.cs (3)
17private static readonly ObjectPool<RoslynLogBlock> s_pool = new(() => new RoslynLogBlock(s_pool!), Math.Min(Environment.ProcessorCount * 8, 256)); 49_tick = Environment.TickCount; 66var delta = Environment.TickCount - _tick;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
285: reason + Environment.NewLine + restString;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (3)
47/// The <see cref="Environment.CurrentManagedThreadId" /> of the thread that holds the lock. Zero if no thread is holding 193return _owningThreadId == Environment.CurrentManagedThreadId; 204_owningThreadId = Environment.CurrentManagedThreadId;
Microsoft.CodeAnalysis.CSharp (4)
Binder\Binder.cs (1)
989var lines = scope.ScopeDesignator.ToString().Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
CommandLine\CSharpCommandLineParser.cs (1)
296Console.WriteLine($"Compiler started with process ID {Environment.ProcessId}");
Utilities\EnvironmentExtensions.cs (2)
11extension(Environment) 18return Environment.ProcessId;
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
91var newLine = Environment.NewLine;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\roslyn\src\Analyzers\CSharp\CodeFixes\DocumentationComments\CSharpAddDocCommentNodesCodeFixProvider.cs (2)
81return elementNode.WithTrailingTrivia(SyntaxFactory.ParseTrailingTrivia(Environment.NewLine)); 85SyntaxFactory.ParseLeadingTrivia(Environment.NewLine)
Microsoft.CodeAnalysis.CSharp.Features (5)
Completion\CompletionProviders\SnippetCompletionProvider.cs (1)
189description: (snippet.Title + Environment.NewLine + snippet.Description).ToSymbolDisplayParts(),
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
592[EndOfLine(Environment.NewLine)]),
Snippets\CSharpSnippetFunctionService.cs (1)
54var str = "case " + fullyQualifiedTypeName + "." + firstEnumMemberName + ":" + Environment.NewLine + " break;";
src\roslyn\src\Analyzers\CSharp\CodeFixes\DocumentationComments\CSharpAddDocCommentNodesCodeFixProvider.cs (2)
81return elementNode.WithTrailingTrivia(SyntaxFactory.ParseTrailingTrivia(Environment.NewLine)); 85SyntaxFactory.ParseLeadingTrivia(Environment.NewLine)
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
91var newLine = Environment.NewLine;
Microsoft.CodeAnalysis.Extensions.Package (5)
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
72: this(factory, Environment.ProcessorCount * 2, trimOnFree, trackLeaks, filePath, lineNumber)
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
121_outstanding.TryAdd(obj, new AllocationInfo(obj.GetType(), poolName, _traceLeaks ? Environment.StackTrace : null));
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (1)
Options\OmniSharpLineFormattingOptions.cs (1)
14public string NewLine { get; init; } = Environment.NewLine;
Microsoft.CodeAnalysis.Features (14)
Completion\CommonCompletionProvider.cs (1)
92parts = parts.Add(new TaggedText(TextTags.LineBreak, Environment.NewLine));
Completion\Providers\Snippets\AbstractSnippetCompletionProvider.cs (1)
95description: (snippetData.Description + Environment.NewLine + string.Format(FeaturesResources.Code_snippet_for_0, snippetData.Description)).ToSymbolDisplayParts(),
Diagnostics\Service\DiagnosticAnalyzerService_ComputeDiagnosticAnalysisResults.cs (1)
51=> $"project: ({project.Id}), ({string.Join(Environment.NewLine, analyzers.Select(a => a.ToString()))})";
EditAndContinue\EditAndContinueService.cs (1)
80var path = Environment.GetEnvironmentVariable("Microsoft_CodeAnalysis_EditAndContinue_LogDir");
ExternalAccess\UnitTesting\Notification\AbstractGlobalOperationNotificationService.cs (1)
41if (!Environment.HasShutdownStarted)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingLowPriorityProcessor.cs (1)
102Logger.Log(FunctionId.WorkCoordinator_Project_Enqueue, s_enqueueLogger, Environment.TickCount, item.ProjectId, !added);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingNormalPriorityProcessor.cs (1)
69Logger.Log(FunctionId.WorkCoordinator_DocumentWorker_Enqueue, s_enqueueLogger, Environment.TickCount, item.DocumentId, !added);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (2)
263Logger.Log(FunctionId.WorkCoordinator_SemanticChange_Enqueue, s_enqueueLogger, Environment.TickCount, documentId, changedMember != null); 379Logger.Log(FunctionId.WorkCoordinator_Project_Enqueue, s_enqueueLogger, Environment.TickCount, projectId);
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (1)
292var documentTooltip = navigateDocument.FilePath + Environment.NewLine + dllPath;
SemanticSearch\SearchExceptionDefinitionItem.cs (1)
27new TaggedText(TextTags.Space, Environment.NewLine),
src\roslyn\src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderHelper.cs (1)
122var eolLength = Environment.NewLine.Length;
src\roslyn\src\Compilers\Core\AnalyzerDriver\AnalyzerExceptionDescriptionBuilder.cs (2)
16private static readonly string s_separator = Environment.NewLine + "-----" + Environment.NewLine;
Microsoft.CodeAnalysis.Razor.Compiler (13)
Language\Components\ComponentDiagnosticFactory.cs (6)
134Environment.NewLine + string.Join(Environment.NewLine, attributes.Select(p => p.TagHelper.DisplayName))); 146Environment.NewLine + string.Join(Environment.NewLine, attributes.Select(p => p.TagHelper.DisplayName))); 367Environment.NewLine + string.Join(Environment.NewLine, attributes.Select(p => p.TagHelper.DisplayName)));
Language\Extensions\EliminateMethodBodyPass.cs (3)
41IntermediateNodeFactory.CSharpToken("#pragma warning disable 0414" + Environment.NewLine), 44IntermediateNodeFactory.CSharpToken("#pragma warning disable 0649" + Environment.NewLine), 47IntermediateNodeFactory.CSharpToken("#pragma warning disable 0169" + Environment.NewLine)
Language\Legacy\SourceLocationTracker.cs (2)
37if ((Environment.NewLine.Length == 1 && characterRead == Environment.NewLine[0]) ||
Language\RazorCodeGenerationOptions.cs (1)
11private static string DefaultNewLine => Environment.NewLine;
Language\Syntax\SyntaxSerializer.cs (1)
210Builder.Append(value.Replace(Environment.NewLine, "LF"));
Microsoft.CodeAnalysis.ResxSourceGenerator (34)
AbstractResxGenerator.cs (5)
250var exceptionLines = ex.ToString().Split([Environment.NewLine], StringSplitOptions.None); 251var text = string.Join("", exceptionLines.Select(line => "#error " + line + Environment.NewLine)); 563{{string.Join(Environment.NewLine, getResourceStringAttributes.Select(attr => memberIndent + attr))}} 621namespaceStart = $@"namespace {namespaceName}{Environment.NewLine}{{"; 641var crLf = Environment.NewLine;
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (2)
99var parentPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
58if (Environment.OSVersion.Platform == PlatformID.Win32NT)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (3)
67private int _localRandom = Environment.TickCount; 70private static int s_sharedRandom = Environment.TickCount; 90var pool = new ObjectPool<StringTable>(pool => new StringTable(pool), Environment.ProcessorCount * 2);
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
72: this(factory, Environment.ProcessorCount * 2, trimOnFree, trackLeaks, filePath, lineNumber)
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
121_outstanding.TryAdd(obj, new AllocationInfo(obj.GetType(), poolName, _traceLeaks ? Environment.StackTrace : null));
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (5)
36/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 54/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 214/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 232/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 374private static int DefaultDegreeOfParallelism => Environment.ProcessorCount;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (1)
173foreach (var line in child.ToString().Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingOptions2.cs (1)
47_ => Environment.NewLine
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\LineFormattingOptions.cs (1)
19[DataMember] public string NewLine { get; init; } = Environment.NewLine;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.LogBlock.cs (3)
17private static readonly ObjectPool<RoslynLogBlock> s_pool = new(() => new RoslynLogBlock(s_pool!), Math.Min(Environment.ProcessorCount * 8, 256)); 49_tick = Environment.TickCount; 66var delta = Environment.TickCount - _tick;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
285: reason + Environment.NewLine + restString;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (3)
47/// The <see cref="Environment.CurrentManagedThreadId" /> of the thread that holds the lock. Zero if no thread is holding 193return _owningThreadId == Environment.CurrentManagedThreadId; 204_owningThreadId = Environment.CurrentManagedThreadId;
Microsoft.CodeAnalysis.Scripting (2)
Hosting\ObjectFormatter\CommonObjectFormatter.cs (2)
43newLine: Environment.NewLine, 74builder.Append(Environment.NewLine);
Microsoft.CodeAnalysis.TestAnalyzerReference (1)
NonSourceFileRefactoring.cs (1)
28var newText = SourceText.From(text.ToString() + Environment.NewLine + "# Refactored");
Microsoft.CodeAnalysis.Workspaces (45)
Log\RoslynEventSource.LogBlock.cs (2)
72_tick = Environment.TickCount; 147var delta = Environment.TickCount - _tick;
Log\TraceLogger.cs (3)
22=> Trace.WriteLine(string.Format("[{0}] {1} - {2}", Environment.CurrentManagedThreadId, functionId.ToString(), logMessage.GetMessage())); 25=> Trace.WriteLine(string.Format("[{0}] Start({1}) : {2} - {3}", Environment.CurrentManagedThreadId, uniquePairId, functionId.ToString(), logMessage.GetMessage())); 30Trace.WriteLine(string.Format("[{0}] End({1}) : [{2}ms] {3}", Environment.CurrentManagedThreadId, uniquePairId, delta, functionString));
Log\WorkspaceErrorLogger.cs (1)
25=> exception.Message + Environment.NewLine + exception.StackTrace;
Log\WorkspaceStructureLogger.cs (2)
222return ReplacePathComponent(s, Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "%USERPROFILE%");
Remote\IRemoteKeepAliveService.cs (1)
221if (Environment.HasShutdownStarted)
Shared\TestHooks\AsynchronousOperationListenerProvider.cs (2)
207var enabled = Environment.GetEnvironmentVariable("RoslynWaiterEnabled"); 228var enabled = Environment.GetEnvironmentVariable("RoslynWaiterDiagnosticTokenEnabled");
src\roslyn\src\Compilers\Core\Portable\DiagnosticAnalyzer\ProgramFilesAnalyzerPathResolver.cs (2)
34var programFilesPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (2)
99var parentPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
58if (Environment.OSVersion.Platform == PlatformID.Win32NT)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (3)
67private int _localRandom = Environment.TickCount; 70private static int s_sharedRandom = Environment.TickCount; 90var pool = new ObjectPool<StringTable>(pool => new StringTable(pool), Environment.ProcessorCount * 2);
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
72: this(factory, Environment.ProcessorCount * 2, trimOnFree, trackLeaks, filePath, lineNumber)
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
121_outstanding.TryAdd(obj, new AllocationInfo(obj.GetType(), poolName, _traceLeaks ? Environment.StackTrace : null));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingOptions2.cs (1)
47_ => Environment.NewLine
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\LineFormattingOptions.cs (1)
19[DataMember] public string NewLine { get; init; } = Environment.NewLine;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.LogBlock.cs (3)
17private static readonly ObjectPool<RoslynLogBlock> s_pool = new(() => new RoslynLogBlock(s_pool!), Math.Min(Environment.ProcessorCount * 8, 256)); 49_tick = Environment.TickCount; 66var delta = Environment.TickCount - _tick;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
285: reason + Environment.NewLine + restString;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (3)
47/// The <see cref="Environment.CurrentManagedThreadId" /> of the thread that holds the lock. Zero if no thread is holding 193return _owningThreadId == Environment.CurrentManagedThreadId; 204_owningThreadId = Environment.CurrentManagedThreadId;
TemporaryStorage\TemporaryStorageService.Factory.cs (1)
35var forceSingleFile = !Environment.Is64BitProcess;
Workspace\Host\PersistentStorage\IPersistentStorageConfiguration.cs (3)
50var appDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData, Environment.SpecialFolderOption.Create);
Workspace\ProjectSystem\ReferenceFileChangeTracker.cs (5)
73if (Environment.GetEnvironmentVariable("DOTNET_ROOT") is string dotnetRoot && !string.IsNullOrEmpty(dotnetRoot)) 80referenceDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "Reference Assemblies", "Microsoft", "Framework")); 81referenceDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "dotnet", "packs"));
Microsoft.CodeAnalysis.Workspaces.MSBuild (7)
MSBuild\BuildHostProcessManager.cs (4)
137throw new Exception($"The build host was started but we were unable to connect to it's pipe. The process exited with {process.ExitCode}. Process output:{Environment.NewLine}{buildHostProcess.GetBuildHostProcessOutput()}", innerException: e); 180static string GetProcessPath() => Environment.ProcessPath ?? throw new InvalidOperationException("Unable to determine the path of the current process."); 540_logger.LogError("The BuildHost process is not responding. Process output:{newLine}{processLog}", Environment.NewLine, processLog); 542_logger.LogError("The BuildHost process exited with {errorCode}. Process output:{newLine}{processLog}", _process.ExitCode, Environment.NewLine, processLog);
MSBuild\DiagnosticReporterLoggerProvider.cs (1)
53message += Environment.NewLine + exception.ToString();
Rpc\RpcClient.cs (2)
67var message = $"Failed to deserialize response from build host:{Environment.NewLine}{line}"; 161var requestJson = JsonSerializer.Serialize(request, JsonSettings.SingleLineSerializerOptions) + Environment.NewLine;
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (7)
BuildHostLogger.cs (1)
34output.Write(Environment.NewLine);
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (2)
99var parentPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
58if (Environment.OSVersion.Platform == PlatformID.Win32NT)
Microsoft.CodeAnalysis.Workspaces.MSBuild.Contracts (4)
MonoMSBuildDiscovery.cs (1)
29var path = Environment.GetEnvironmentVariable("PATH");
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
Microsoft.Data.Analysis (1)
TextFieldParser.cs (1)
181private readonly char[] _newLineChars = Environment.NewLine.ToCharArray();
Microsoft.Data.Analysis.Tests (1)
src\Microsoft.Data.Analysis\TextFieldParser.cs (1)
181private readonly char[] _newLineChars = Environment.NewLine.ToCharArray();
Microsoft.Diagnostics.DataContractReader.Legacy (8)
Dbi\DacDbiImpl.cs (4)
2594$"Type param {i} mismatch{Environment.NewLine}" + 2595$" cDAC: ({FormatExpandedTypeData(entries[i])}){Environment.NewLine}" + 2719$"Type param {i} mismatch{Environment.NewLine}" + 2720$" cDAC: ({FormatExpandedTypeData(entries[i])}){Environment.NewLine}" +
DebugExtensions.cs (3)
111message += $"{Environment.NewLine}---- cDAC exception ----{Environment.NewLine}{ex}{Environment.NewLine}---- end cDAC exception ----";
LegacyFallbackHelper.cs (1)
20Environment.GetEnvironmentVariable("CDAC_NO_FALLBACK") == "1";
Microsoft.DiaSymReader (1)
SymUnmanagedFactory.cs (1)
119return Environment.GetEnvironmentVariable(name);
Microsoft.DotNet.ApiCompat.Task (4)
src\sdk\src\Tasks\Common\TaskBase.cs (4)
70Environment.NewLine, 74Environment.NewLine); 95s = s + " ---> " + ExceptionToStringWithoutMessage(e.InnerException) + Environment.NewLine + 104s += Environment.NewLine + stackTrace;
Microsoft.DotNet.ApiCompatibility (1)
Logging\SuppressionEngine.cs (1)
147xmlWriter.WriteWhitespace(Environment.NewLine);
Microsoft.DotNet.Arcade.Sdk (2)
src\GenerateResxSource.cs (1)
248namespaceStart = $@"namespace {namespaceName}{Environment.NewLine}{{";
src\LocateDotNet.cs (1)
48var paths = Environment.GetEnvironmentVariable("PATH");
Microsoft.DotNet.Build.Tasks.Installers (1)
src\CreateWixBuildWixpack.cs (1)
432File.WriteAllText(Path.Combine(WixpackWorkingDir, "create.rsp"), string.Join(System.Environment.NewLine, commandLineArgs));
Microsoft.DotNet.Build.Tasks.VisualStudio (3)
OptProf\GetRunSettingsSessionConfiguration.cs (3)
92$"Unable to read bootstrapper info: {e.Message}{Environment.NewLine}" + 93$"Content of BootstrapperInfo.json:{Environment.NewLine}" + 133Environment.NewLine,
Microsoft.DotNet.Cli.CoreUtils (2)
GracefulException.cs (2)
23: this(string.Join(Environment.NewLine, messages), isUserError: isUserError) 27VerboseMessage = string.Join(Environment.NewLine, verboseMessages);
Microsoft.DotNet.Cli.Definitions (12)
Commands\Test\TestCommandDefinition.cs (3)
35=> Create(Environment.CurrentDirectory, Environment.GetEnvironmentVariable(TestRunnerEnvironmentVariableName)); 38=> Create(startDirectory, Environment.GetEnvironmentVariable(TestRunnerEnvironmentVariableName));
Common\CommonOptions.cs (1)
357DefaultValueFactory = (ar) => EnvironmentVariableParser.ParseBool(Environment.GetEnvironmentVariable("DOTNET_NOLOGO"), defaultValue),
Common\TargetPlatformOptions.cs (1)
112: Environment.GetEnvironmentVariable(key));
src\sdk\src\Resolvers\Microsoft.DotNet.NativeWrapper\EnvironmentProvider.cs (3)
118getEnvironmentVariable = Environment.GetEnvironmentVariable; 126getEnvironmentVariable ??= Environment.GetEnvironmentVariable; 136currentProcessPath = Environment.ProcessPath;
Telemetry\EnvironmentDetectionRule.cs (4)
32return _variables.Any(variable => EnvironmentVariableParser.ParseBool(Environment.GetEnvironmentVariable(variable), defaultValue: false)); 50return _variables.All(variable => !string.IsNullOrEmpty(Environment.GetEnvironmentVariable(variable))); 68return _variables.Any(variable => !string.IsNullOrEmpty(Environment.GetEnvironmentVariable(variable))); 106var value = Environment.GetEnvironmentVariable(_variable);
Microsoft.DotNet.Cli.Utils (32)
AnsiConsole.cs (1)
18_ansiEnabled = string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("NO_COLOR"));
DebugHelper.cs (1)
23int processId = Environment.ProcessId;
EnvironmentProvider.cs (9)
16private readonly Lazy<string> _userHomeDirectory = new(() => Environment.GetEnvironmentVariable("HOME") ?? string.Empty); 26? Environment.GetEnvironmentVariable("PATHEXT")? 44searchPaths.AddRange(Environment 109return Environment.GetEnvironmentVariable(name); 114var str = Environment.GetEnvironmentVariable(name); 137return Environment.GetEnvironmentVariable(variable, target); 142value = Environment.GetEnvironmentVariable(name); 148Environment.SetEnvironmentVariable(variable, value, target); 153if (Environment.GetEnvironmentVariable(variable) is string strValue && int.TryParse(strValue, out int intValue))
Extensions\AnsiExtensions.cs (1)
11var environment = Environment.GetEnvironmentVariable("TERM");
Extensions\LockFileFormatExtensions.cs (1)
20Environment.NewLine,
MSBuildForwardingAppWithoutLogging.cs (5)
152savedEnvironmentVariables[kvp.Key] = Environment.GetEnvironmentVariable(kvp.Key); 153Environment.SetEnvironmentVariable(kvp.Key, kvp.Value); 177Environment.SetEnvironmentVariable(kvp.Key, kvp.Value); 198var envMSBuildSDKsPath = Environment.GetEnvironmentVariable("MSBuildSDKsPath"); 219{ "MSBuildExtensionsPath", MSBuildExtensionsPathTestHook ?? Environment.GetEnvironmentVariable("MSBuildExtensionsPath") ?? AppContext.BaseDirectory },
Muxer.cs (3)
58string? processPath = Environment.ProcessPath; 68processPath = Environment.GetEnvironmentVariable("DOTNET_HOST_PATH"); 72var root = Environment.GetEnvironmentVariable("DOTNET_ROOT");
PathUtility.cs (1)
358Environment.NewLine,
ProcessReaper.cs (1)
180Environment.ExitCode = _process.ExitCode;
RuntimeEnvironment.cs (3)
64return Environment.OSVersion.Version.ToString(3); 69return Environment.OSVersion.Version.ToString(2); 78return Environment.OSVersion.Version.ToString(1);
UILanguageOverride.cs (6)
80string? dotnetCliLanguage = Environment.GetEnvironmentVariable(DOTNET_CLI_UI_LANGUAGE); 92string? vsLang = Environment.GetEnvironmentVariable(VSLANG); 108string? currentValue = Environment.GetEnvironmentVariable(environmentVariableName); 111Environment.SetEnvironmentVariable(environmentVariableName, value); 122if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && Environment.OSVersion.Version.Major >= 10) // UTF-8 is only officially supported on 10+. 149return string.Equals(Environment.GetEnvironmentVariable("DOTNET_CLI_FORCE_UTF8_ENCODING"), "true", StringComparison.OrdinalIgnoreCase);
Microsoft.DotNet.Configurer (5)
CliFolderPathCalculator.cs (2)
17Environment.GetEnvironmentVariable("DOTNET_CLI_TEST_FALLBACKFOLDER") ?? 34return string.IsNullOrEmpty(Environment.GetEnvironmentVariable(DotnetHomeVariableName))
src\sdk\src\Common\CliFolderPathCalculatorCore.cs (3)
17: this(Environment.GetEnvironmentVariable) 59home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
Microsoft.DotNet.HotReload.Watch (11)
Context\EnvironmentVariables.cs (10)
33var value = Environment.GetEnvironmentVariable("DOTNET_CLI_CONTEXT_VERBOSE"); 49Environment.GetEnvironmentVariable("DOTNET_WATCH_DEBUG_SDK_DIRECTORY") ?? ""; 59public static TestFlags TestFlags => Environment.GetEnvironmentVariable("__DOTNET_WATCH_TEST_FLAGS") is { } value ? Enum.Parse<TestFlags>(value) : TestFlags.None; 60public static string TestOutputDir => Environment.GetEnvironmentVariable("__DOTNET_WATCH_TEST_OUTPUT_DIR") ?? ""; 62public static string? BrowserWebSocketHostName => Environment.GetEnvironmentVariable("DOTNET_WATCH_AUTO_RELOAD_WS_HOSTNAME"); 75public static string? BrowserPath => Environment.GetEnvironmentVariable("DOTNET_WATCH_BROWSER_PATH"); 90=> ParseBool(Environment.GetEnvironmentVariable(variableName)); 93=> Environment.GetEnvironmentVariable(variableName) is var value && long.TryParse(value, out var intValue) && intValue >= 0 ? TimeSpan.FromMilliseconds(intValue) : null; 96=> Environment.GetEnvironmentVariable(variableName) is var value && long.TryParse(value, out var intValue) && intValue >= 0 ? TimeSpan.FromSeconds(intValue) : null; 99=> Environment.GetEnvironmentVariable(variableName) is var value && int.TryParse(value, out var intValue) ? intValue : null;
UI\ShutdownHandler.cs (1)
33Environment.Exit(0);
Microsoft.DotNet.HotReload.WebAssembly.Browser (7)
src\sdk\src\Dotnet.Watch\HotReloadAgent\HotReloadAgent.cs (6)
300var startupHooks = Environment.GetEnvironmentVariable(AgentEnvironmentVariables.DotNetStartupHooks); 303Environment.SetEnvironmentVariable(AgentEnvironmentVariables.DotNetStartupHooks, 307Environment.SetEnvironmentVariable(AgentEnvironmentVariables.DotNetWatchHotReloadNamedPipeName, null); 308Environment.SetEnvironmentVariable(AgentEnvironmentVariables.DotNetWatchHotReloadWebSocketEndpoint, null); 309Environment.SetEnvironmentVariable(AgentEnvironmentVariables.DotNetWatchHotReloadWebSocketKey, null); 310Environment.SetEnvironmentVariable(AgentEnvironmentVariables.HotReloadDeltaClientLogMessages, null);
WebAssemblyHotReload.cs (1)
67if (MetadataUpdater.IsSupported && Environment.GetEnvironmentVariable("__ASPNETCORE_BROWSER_TOOLS") == "true" &&
Microsoft.DotNet.NativeWrapper (3)
EnvironmentProvider.cs (3)
118getEnvironmentVariable = Environment.GetEnvironmentVariable; 126getEnvironmentVariable ??= Environment.GetEnvironmentVariable; 136currentProcessPath = Environment.ProcessPath;
Microsoft.DotNet.ProjectTools (3)
LaunchSettings\LaunchProfileParser.cs (1)
38=> Environment.ExpandEnvironmentVariables(value);
VirtualProjectBuilder.cs (2)
144: Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
Microsoft.DotNet.SdkResolver (1)
NETCoreSdkResolver.cs (1)
25: this(Environment.GetEnvironmentVariable, VSSettings.Ambient)
Microsoft.DotNet.SharedFramework.Sdk (1)
src\ValidateFileVersions.cs (1)
86string.Concat(versionlessFiles.Select(f => Environment.NewLine + f)));
Microsoft.DotNet.TemplateLocator (9)
src\sdk\src\Common\EnvironmentVariableNames.cs (2)
67=> TryGetDotNetRootVariableNameImpl(runtimeIdentifier, defaultAppHostRuntimeIdentifier, targetFrameworkVersion, RuntimeInformation.ProcessArchitecture, Environment.Is64BitProcess); 88=> TryGetDotNetRootVariableNameImpl(runtimeIdentifier, defaultAppHostRuntimeIdentifier, null, RuntimeInformation.ProcessArchitecture, Environment.Is64BitProcess, onlyUseArchSpecific: true);
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\SdkDirectoryWorkloadManifestProvider.cs (2)
60: this(sdkRootPath, sdkVersion, Environment.GetEnvironmentVariable, userProfileDir, globalJsonPath) 66return new SdkDirectoryWorkloadManifestProvider(sdkRootPath, sdkVersion, Environment.GetEnvironmentVariable, userProfileDir, globalJsonPath: null, workloadSetVersion);
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadInstallType.cs (2)
44return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "dotnet", "workloads", architecture, sdkFeatureBand.ToString(), "InstallState");
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadResolver.cs (1)
45var packRootEnvironmentVariable = (getEnvironmentVariable ?? Environment.GetEnvironmentVariable)(EnvironmentVariableNames.WORKLOAD_PACK_ROOTS);
TemplateLocator.cs (2)
19: this(Environment.GetEnvironmentVariable, null, VSSettings.Ambient, null, null) 56string? globalJsonPath = SdkDirectoryWorkloadManifestProvider.GetGlobalJsonPath(Environment.CurrentDirectory);
Microsoft.DotNet.VersionTools.Cli (1)
Program.cs (1)
16RootCommand rootCommand = new("Microsoft.DotNet.VersionTools.Cli v" + Environment.Version.ToString(2))
Microsoft.Extensions.AI (2)
TelemetryHelpers.cs (1)
15Environment.GetEnvironmentVariable(OpenTelemetryConsts.GenAICaptureMessageContentEnvVar) is string envVar &&
ToolReduction\EmbeddingToolReductionStrategy.cs (1)
47return t.Name + Environment.NewLine + t.Description;
Microsoft.Extensions.AI.Abstractions (1)
Contents\AIContentExtensions.cs (1)
86builder.AppendLiteral(Environment.NewLine);
Microsoft.Extensions.AI.Abstractions.Tests (4)
ChatCompletion\ChatResponseTests.cs (1)
122ChatResponse response = new(new ChatMessage(ChatRole.Assistant, $"This is a test.{Environment.NewLine}It's multiple lines."));
SpeechToText\SpeechToTextResponseTests.cs (2)
196SpeechToTextResponse response = new("This is a test." + Environment.NewLine + "It's multiple lines."); 197Assert.Equal("This is a test." + Environment.NewLine + "It's multiple lines.", response.ToString());
test\Shared\JsonSchemaExporter\SchemaTestHelpers.cs (1)
47{string.Join(Environment.NewLine, errors)}
Microsoft.Extensions.AI.Evaluation.Console (13)
Commands\ReportCommand.cs (1)
146Environment.UserInteractive && (OperatingSystem.IsWindows() || !isRedirected);
Telemetry\DeviceIdHelper.cs (5)
136string? xdgCacheHome = Environment.GetEnvironmentVariable("XDG_CACHE_HOME"); 140string userProfilePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); 158string userProfilePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
Telemetry\EnvironmentHelper.cs (3)
16Environment.GetEnvironmentVariable(name)?.ToUpperInvariant() switch 48if (bool.TryParse(Environment.GetEnvironmentVariable(variable), out bool value) && value) 56if (Array.TrueForAll(variables, static variable => !string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable(variable))))
Telemetry\TelemetryConstants.cs (2)
124string? homeDirectoryPath = Environment.GetEnvironmentVariable("DOTNET_CLI_HOME"); 128Environment.GetEnvironmentVariable(
Telemetry\TelemetryHelper.cs (2)
51[TelemetryConstants.PropertyNames.OSVersion] = Environment.OSVersion.VersionString, 52[TelemetryConstants.PropertyNames.OSPlatform] = Environment.OSVersion.Platform.ToString(),
Microsoft.Extensions.AI.Evaluation.Integration.Tests (1)
Setup.cs (1)
15Environment.GetEnvironmentVariable("AITESTING_OFFLINE") == "1";
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (1)
EmbeddingTests.cs (1)
17if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("TF_BUILD")))
Microsoft.Extensions.AI.Evaluation.Safety (2)
ContentSafetyEvaluator.cs (1)
114string.Join(Environment.NewLine, textContents.Select(c => c.Text)) is string contextString &&
ContentSafetyServicePayloadUtilities.cs (1)
135userTextListStrings = [string.Join(Environment.NewLine, userTextListStrings)];
Microsoft.Extensions.AI.Integration.Tests (3)
VerbatimHttpHandler.cs (3)
135$"Expected:{Environment.NewLine}" + 136$"{expected}{Environment.NewLine}" + 137$"Actual:{Environment.NewLine}" +
Microsoft.Extensions.AI.OpenAI (2)
OpenAIClientExtensions.cs (1)
90$"{descriptionNode.GetValue<string>()}{Environment.NewLine}{additionalDescription}" :
OpenAIResponsesChatClient.cs (1)
792$"{result.Instructions}{Environment.NewLine}{instructions}";
Microsoft.Extensions.AI.OpenAI.Tests (1)
OpenAIAssistantChatClientIntegrationTests.cs (1)
120AssistantClient ac = new(Environment.GetEnvironmentVariable("AI:OpenAI:ApiKey")!);
Microsoft.Extensions.AI.Tests (1)
ChatCompletion\ChatClientStructuredOutputExtensionsTests.cs (1)
419var resultDuplicatedJson = JsonSerializer.Serialize(expectedResult, JsonContext2.Default.Options) + Environment.NewLine + JsonSerializer.Serialize(expectedResult, JsonContext2.Default.Options);
Microsoft.Extensions.Caching.Hybrid.Tests (2)
HybridCacheEventSourceTests.cs (2)
226log.WriteLine($".NET {Environment.Version} on {Environment.OSVersion}, {IntPtr.Size * 8}-bit");
Microsoft.Extensions.Configuration.KeyPerFile (2)
KeyPerFileConfigurationProvider.cs (2)
46=> value.EndsWith(Environment.NewLine, StringComparison.Ordinal) 47? value.Substring(0, value.Length - Environment.NewLine.Length)
Microsoft.Extensions.Configuration.UserSecrets (7)
PathHelper.cs (7)
61string? appData = Environment.GetEnvironmentVariable("APPDATA"); 63?? Environment.GetEnvironmentVariable("HOME") // On Mac/Linux it goes to ~/.microsoft/usersecrets/ 64?? Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) 65?? Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) 66?? Environment.GetEnvironmentVariable(userSecretsFallbackDir); // this fallback is an escape hatch if everything else fails
Microsoft.Extensions.DataIngestion (4)
Chunkers\ElementsChunker.cs (4)
116AppendNewLineAndSpan(_currentChunk, tableBuilder.AsSpan(0, tableLength - Environment.NewLine.Length)); 140AppendNewLineAndSpan(_currentChunk, tableBuilder.AsSpan(0, tableLength - Environment.NewLine.Length)); 253vsb.Append(Environment.NewLine); 268vsb.Append(Environment.NewLine);
Microsoft.Extensions.DataIngestion.Abstractions (1)
IngestionDocumentElement.cs (1)
96=> string.Join(Environment.NewLine, Elements.Select(e => e.GetMarkdown()));
Microsoft.Extensions.DataIngestion.Tests (1)
Chunkers\SemanticSimilarityChunkerTests.cs (1)
102Assert.Equal(text1 + Environment.NewLine + text2, chunks[0].Content);
Microsoft.Extensions.DependencyInjection (2)
ServiceLookup\CallSiteFactory.cs (1)
649Environment.NewLine,
ServiceLookup\DynamicServiceProviderEngine.cs (1)
44Debug.Fail($"We should never get exceptions from the background compilation.{Environment.NewLine}{ex}");
Microsoft.Extensions.DependencyModel (3)
EnvironmentWrapper.cs (1)
15public string? GetEnvironmentVariable(string name) => Environment.GetEnvironmentVariable(name);
Resolution\PackageCompilationAssemblyResolver.cs (2)
59string basePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
Microsoft.Extensions.Diagnostics.ResourceMonitoring (6)
Windows\Interop\ProcessInfo.cs (1)
40return (ulong)Environment.WorkingSet;
Windows\WindowsSnapshotProvider.cs (5)
101var cpuUsage = Environment.CpuUsage; 106memoryUsageInBytes: (ulong)Environment.WorkingSet); 120return Environment.CpuUsage.TotalTime.Ticks; 127internal static int GetCpuUnits() => Environment.ProcessorCount; 131return Environment.WorkingSet;
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (2)
Windows\WindowsSnapshotProviderTests.cs (2)
48Assert.Equal(Environment.ProcessorCount, provider.Resources.GuaranteedCpuUnits); 49Assert.Equal(Environment.ProcessorCount, provider.Resources.MaximumCpuUnits);
Microsoft.Extensions.DotNetDeltaApplier (13)
src\sdk\src\Dotnet.Watch\HotReloadAgent.Host\StartupHook.cs (4)
21private static readonly string? s_standardOutputLogPrefix = Environment.GetEnvironmentVariable(AgentEnvironmentVariables.HotReloadDeltaClientLogMessages); 37var processPath = Environment.GetCommandLineArgs().FirstOrDefault(); 78Console.CancelKeyPress += (_, _) => Environment.Exit(0); 143Environment.Exit(0);
src\sdk\src\Dotnet.Watch\HotReloadAgent.Host\Transport.cs (3)
30var namedPipeName = Environment.GetEnvironmentVariable(AgentEnvironmentVariables.DotNetWatchHotReloadNamedPipeName); 37var webSocketEndpoint = Environment.GetEnvironmentVariable(AgentEnvironmentVariables.DotNetWatchHotReloadWebSocketEndpoint); 47var serverPublicKey = Environment.GetEnvironmentVariable(AgentEnvironmentVariables.DotNetWatchHotReloadWebSocketKey);
src\sdk\src\Dotnet.Watch\HotReloadAgent\HotReloadAgent.cs (6)
300var startupHooks = Environment.GetEnvironmentVariable(AgentEnvironmentVariables.DotNetStartupHooks); 303Environment.SetEnvironmentVariable(AgentEnvironmentVariables.DotNetStartupHooks, 307Environment.SetEnvironmentVariable(AgentEnvironmentVariables.DotNetWatchHotReloadNamedPipeName, null); 308Environment.SetEnvironmentVariable(AgentEnvironmentVariables.DotNetWatchHotReloadWebSocketEndpoint, null); 309Environment.SetEnvironmentVariable(AgentEnvironmentVariables.DotNetWatchHotReloadWebSocketKey, null); 310Environment.SetEnvironmentVariable(AgentEnvironmentVariables.HotReloadDeltaClientLogMessages, null);
Microsoft.Extensions.FileProviders.Physical (1)
PhysicalFileProvider.cs (1)
184string? environmentValue = Environment.GetEnvironmentVariable(PollingEnvironmentKey);
Microsoft.Extensions.Hosting (3)
HostingHostBuilderExtensions.cs (2)
221string cwd = Environment.CurrentDirectory; 228!string.Equals(cwd, Environment.SystemDirectory, StringComparison.OrdinalIgnoreCase))
Internal\HostingLoggerExtensions.cs (1)
21message = message + Environment.NewLine + ex.Message;
Microsoft.Extensions.Hosting.Systemd (9)
SystemdHelpers.cs (7)
29if (Environment.OSVersion.Platform != PlatformID.Unix) 34int processId = Environment.ProcessId; 38string? systemdExecPid = Environment.GetEnvironmentVariable(SystemdConstants.SystemdExecPid); 55return !string.IsNullOrEmpty(Environment.GetEnvironmentVariable(SystemdConstants.NotifySocket)) || 56!string.IsNullOrEmpty(Environment.GetEnvironmentVariable(SystemdConstants.ListenPid)); 86if (Environment.OSVersion.Platform != PlatformID.Unix) 91string? socketPath = Environment.GetEnvironmentVariable(SystemdConstants.NotifySocket);
SystemdHostBuilderExtensions.cs (1)
126Environment.SetEnvironmentVariable(SystemdConstants.NotifySocket, null);
SystemdNotifier.cs (1)
61string? socketPath = Environment.GetEnvironmentVariable(SystemdConstants.NotifySocket);
Microsoft.Extensions.Hosting.WindowsServices (1)
Internal\Win32.cs (1)
26int currentProcessId = Environment.ProcessId;
Microsoft.Extensions.Http (3)
DependencyInjection\SocketsHttpHandlerBuilderExtensions.cs (1)
36string message = SR.Format(SR.SocketsHttpHandlerBuilder_PrimaryHandlerIsInvalid, nameof(b.PrimaryHandler), typeof(SocketsHttpHandler).FullName, Environment.NewLine, b.PrimaryHandler?.ToString() ?? "(null)");
HttpMessageHandlerBuilder.cs (1)
109Environment.NewLine,
src\runtime\src\libraries\Common\src\System\Net\Http\UriRedactionHelper.cs (1)
20string? envVar = Environment.GetEnvironmentVariable("DOTNET_SYSTEM_NET_HTTP_DISABLEURIREDACTION");
Microsoft.Extensions.Logging.Console (14)
ConsoleLoggerProcessor.cs (1)
133message: SR.Format(SR.WarningMessageOnDrop + Environment.NewLine, _messagesDropped),
JsonConsoleFormatter.cs (1)
116textWriter.Write(Environment.NewLine);
SimpleConsoleFormatter.cs (7)
17private static readonly string _newLineWithMessagePadding = Environment.NewLine + _messagePadding; 111textWriter.Write(Environment.NewLine); 128textWriter.Write(Environment.NewLine); 139WriteReplacing(textWriter, Environment.NewLine, " ", message); 144WriteReplacing(textWriter, Environment.NewLine, _newLineWithMessagePadding, message); 145textWriter.Write(Environment.NewLine); 223textWriter.Write(Environment.NewLine);
src\runtime\src\libraries\Common\src\System\Console\ConsoleUtils.cs (3)
46if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("FORCE_COLOR")) || 47!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION"))) 53if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("NO_COLOR")))
SystemdConsoleFormatter.cs (2)
104textWriter.Write(Environment.NewLine); 108string newMessage = message.Replace(Environment.NewLine, " ");
Microsoft.Extensions.Logging.Debug (2)
DebugLogger.cs (2)
68message = $"{logLevel}: {formatted}{Environment.NewLine}{Environment.NewLine}{exception}";
Microsoft.Extensions.ObjectPool (5)
DefaultObjectPool.cs (1)
30: this(policy, Environment.ProcessorCount * 2)
DefaultObjectPoolProvider.cs (1)
17public int MaximumRetained { get; set; } = Environment.ProcessorCount * 2;
LeakTrackingObjectPool.cs (3)
65_stack = Environment.StackTrace; 76if (!_disposed && !Environment.HasShutdownStarted) 78Debug.Fail($"{typeof(T).Name} was leaked. Created at: {Environment.NewLine}{_stack}");
Microsoft.Extensions.ServiceDiscovery.Dns (3)
DnsSrvServiceEndpointProviderFactory.cs (2)
126var host = Environment.GetEnvironmentVariable("KUBERNETES_SERVICE_HOST"); 127var port = Environment.GetEnvironmentVariable("KUBERNETES_SERVICE_PORT");
ServiceDiscoveryDnsServiceCollectionExtensions.cs (1)
141var envVar = Environment.GetEnvironmentVariable("MICROSOFT_EXTENSIONS_SERVICE_DISCOVERY_DNS_USE_DNSCLIENT_FALLBACK");
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (3)
XunitLoggerFactoryExtensions.cs (3)
63private static readonly string[] s_newLineChars = new[] { Environment.NewLine }; 114if (message.EndsWith(Environment.NewLine, StringComparison.Ordinal)) 116message = message.Substring(0, message.Length - Environment.NewLine.Length);
Microsoft.Extensions.ServiceDiscovery.Dns.Tests.Fuzzing (1)
Program.cs (1)
28{string.Join(Environment.NewLine, fuzzers.Select(f => $" {f.Name}"))}
Microsoft.Extensions.Telemetry (5)
Enrichment\ProcessLogEnricher.cs (1)
32_threadId ??= Environment.CurrentManagedThreadId.ToInvariantString();
Latency\Internal\LatencyConsoleExporter.cs (2)
23private static readonly string _title = "Latency sample #{0}: {1}ms, {2} checkpoints, {3} tags, {4} measures" + Environment.NewLine; 24private static readonly Func<int, string> _rows = Memoize.Function((int nameColumnWidth) => $" {{0,-{nameColumnWidth}}} | {{1}}" + Environment.NewLine);
Logging\ExtendedLogger.cs (2)
188trace = trace.Replace(Environment.NewLine, Environment.NewLine + indentStr + " ").Trim(' ');
Microsoft.Extensions.Telemetry.Tests (1)
Latency\Internal\LatencyConsoleExporterTests.cs (1)
155private static string NormalizeLineEndings(string value) => value.Replace("\r\n", "\n").Replace("\r", "\n").Replace("\n", Environment.NewLine);
Microsoft.Gen.MetricsReports.Unit.Tests (1)
EmitterTests.cs (1)
131string newLine = Environment.NewLine;
Microsoft.Maui (2)
Animations\AnimationManager.cs (1)
68 Environment.TickCount & int.MaxValue;
VisualDiagnostics\VisualDiagnostics.cs (1)
16 static Lazy<bool> isVisualDiagnosticsEnvVarSet = new Lazy<bool>(() => Environment.GetEnvironmentVariable("ENABLE_XAML_DIAGNOSTICS_SOURCE_INFO") is { } value && value == "1");
Microsoft.Maui.Resizetizer (5)
AppleIconAssetsGenerator.cs (1)
78 {{string.Join("," + Environment.NewLine, appIconImagesJson)}}
AsyncTask.cs (1)
69 LogError(ex.Message + Environment.NewLine + ex.StackTrace);
GenerateTizenManifest.cs (1)
61 _tizenManifestFilePath = Path.Combine(Environment.CurrentDirectory, TizenManifestFile);
SkiaSharpTools.cs (2)
30 var retryVariable = Environment.GetEnvironmentVariable("DOTNET_ANDROID_FILE_WRITE_RETRY_ATTEMPTS"); 47 var delayVariable = Environment.GetEnvironmentVariable("DOTNET_ANDROID_FILE_WRITE_RETRY_DELAY_MS");
Microsoft.ML.AutoML (2)
AutoMLExperiment\IPerformanceMonitor.cs (1)
125var cpuUsageInTotal = cpuUsedMs / (Environment.ProcessorCount * _checkIntervalInMilliseconds);
AutoMlUtils.cs (1)
22var res = Environment.GetEnvironmentVariable(MLNetMaxThread);
Microsoft.ML.AutoML.SourceGenerator (15)
Template\EstimatorType.cs (3)
168if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture)) 180textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
Template\SearchSpace.cs (3)
185if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture)) 197textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
Template\SweepableEstimator.cs (3)
187if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture)) 199textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
Template\SweepableEstimator_T_.cs (3)
192if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture)) 204textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
Template\SweepableEstimatorFactory.cs (3)
163if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture)) 175textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
Microsoft.ML.AutoML.Tests (6)
AutoFeaturizerTests.cs (1)
35if (Environment.GetEnvironmentVariable("HELIX_CORRELATION_ID") != null)
ColumnInferenceTests.cs (1)
240if (Environment.GetEnvironmentVariable("HELIX_CORRELATION_ID") != null)
SweepableEstimatorPipelineTest.cs (1)
38if (Environment.GetEnvironmentVariable("HELIX_CORRELATION_ID") != null)
SweepableExtensionTest.cs (1)
40if (Environment.GetEnvironmentVariable("HELIX_CORRELATION_ID") != null)
SweepablePipelineTests.cs (1)
35if (Environment.GetEnvironmentVariable("HELIX_CORRELATION_ID") != null)
TrialResultManagerTest.cs (1)
83fileContent = fileContent.Replace(Environment.NewLine, "\r");
Microsoft.ML.CodeGenerator (30)
Templates\Azure\Console\AzureModelBuilder.cs (3)
262if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture)) 274textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
Templates\Azure\Model\AzureImageModelOutputClass.cs (3)
203if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture)) 215textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
Templates\Azure\Model\AzureObjectDetectionModelOutputClass.cs (3)
203if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture)) 215textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
Templates\Console\ConsumeModel.cs (3)
214if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture)) 226textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
Templates\Console\ModelBuilder.cs (3)
579if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture)) 591textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
Templates\Console\ModelInputClass.cs (3)
177if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture)) 189textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
Templates\Console\ModelOutputClass.cs (3)
220if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture)) 232textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
Templates\Console\ModelProject.cs (3)
209if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture)) 221textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
Templates\Console\PredictProgram.cs (3)
236if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture)) 248textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
Templates\Console\PredictProject.cs (3)
214if (textToAppend.EndsWith(global::System.Environment.NewLine, global::System.StringComparison.CurrentCulture)) 226textToAppend = textToAppend.Replace(global::System.Environment.NewLine, (global::System.Environment.NewLine + this.currentIndentField));
Microsoft.ML.CodeGenerator.Tests (2)
ApprovalTests\ConsoleCodeGeneratorTests.cs (1)
42if (System.Environment.GetEnvironmentVariable("HELIX_CORRELATION_ID") != null)
ApprovalTests\TemplateTest.cs (1)
24if (Environment.GetEnvironmentVariable("HELIX_CORRELATION_ID") != null)
Microsoft.ML.Core (12)
ComponentModel\ComponentCatalog.cs (2)
1063errorMsg = err + Environment.NewLine + "Usage For '" + name + "':" + Environment.NewLine + helpText;
Utilities\PathUtils.cs (1)
78var envDir = Environment.GetEnvironmentVariable(CustomSearchDirEnvVariable);
Utilities\ResourceManagerUtils.cs (9)
45var envUrl = Environment.GetEnvironmentVariable(CustomResourcesUrlEnvVariable); 104/// a folder called "mlnet-resources" in the <see cref="Environment.SpecialFolder.ApplicationData"/> directory.</param> 192var envTimeout = Environment.GetEnvironmentVariable(TimeoutEnvVariable); 200/// inside <see cref="Environment.SpecialFolder.LocalApplicationData"/>\mlnet-resources\. 204var envDir = Environment.GetEnvironmentVariable(Utils.CustomSearchDirEnvVariable); 205var appDataBaseDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); 218if (Environment.OSVersion.Platform == PlatformID.Unix) 237if (Environment.OSVersion.Platform == PlatformID.Unix)
Microsoft.ML.Core.Tests (14)
UnitTests\TestEntryPoints.cs (1)
346.Replace(Environment.NewLine, ""))
UnitTests\TestResourceDownload.cs (13)
30var envVarOld = Environment.GetEnvironmentVariable(ResourceManagerUtils.CustomResourcesUrlEnvVariable); 31var resourcePathVarOld = Environment.GetEnvironmentVariable(Utils.CustomSearchDirEnvVariable); 32Environment.SetEnvironmentVariable(Utils.CustomSearchDirEnvVariable, null); 36var envVar = Environment.GetEnvironmentVariable(ResourceManagerUtils.CustomResourcesUrlEnvVariable); 46Environment.SetEnvironmentVariable(ResourceManagerUtils.CustomResourcesUrlEnvVariable, badUri.AbsoluteUri); 47envVar = Environment.GetEnvironmentVariable(ResourceManagerUtils.CustomResourcesUrlEnvVariable); 75Environment.SetEnvironmentVariable(ResourceManagerUtils.CustomResourcesUrlEnvVariable, cnn.AbsoluteUri); 76envVar = Environment.GetEnvironmentVariable(ResourceManagerUtils.CustomResourcesUrlEnvVariable); 102Environment.SetEnvironmentVariable(ResourceManagerUtils.CustomResourcesUrlEnvVariable, envVarOld); 103envVar = Environment.GetEnvironmentVariable(ResourceManagerUtils.CustomResourcesUrlEnvVariable); 128$"MICROSOFTML_RESOURCE_PATH is set to {Environment.GetEnvironmentVariable(Utils.CustomSearchDirEnvVariable)}"); 137Environment.SetEnvironmentVariable(ResourceManagerUtils.CustomResourcesUrlEnvVariable, envVarOld); 138Environment.SetEnvironmentVariable(Utils.CustomSearchDirEnvVariable, resourcePathVarOld);
Microsoft.ML.CpuMath.PerformanceTests (1)
PerformanceTests.cs (1)
51string cpumathSeed = Environment.GetEnvironmentVariable("CPUMATH_SEED");
Microsoft.ML.CpuMath.UnitTests (3)
UnitTests.cs (3)
36public static bool IsNetCore => Environment.Version.Major >= 5 || RuntimeInformation.FrameworkDescription.StartsWith(".NET Core", StringComparison.OrdinalIgnoreCase); 37public static bool IsNetCore2OrOlder => Environment.Version.Major == 4 && Environment.Version.Minor == 0;
Microsoft.ML.Data (6)
Data\DataViewUtils.cs (1)
100int conc = Math.Max(2, Environment.ProcessorCount - 1);
DataLoadSave\Binary\BinaryLoader.cs (3)
783_threads = Math.Max(1, args.Threads ?? (Environment.ProcessorCount / 2)); 849_threads = Math.Max(1, Environment.ProcessorCount / 2); 857_threads = Math.Max(1, Environment.ProcessorCount / 2);
DataLoadSave\Binary\BinarySaver.cs (1)
667Task[] compressionThreads = new Task[Environment.ProcessorCount];
Dirty\ModelParametersBase.cs (1)
88ch.Warning(NormalizerWarningFormat, typePredictor, Environment.NewLine);
Microsoft.ML.FastTree (4)
FastTree.cs (2)
185InitializeThreads(FastTreeTrainerOptions.NumberOfThreads ?? Environment.ProcessorCount); 817ch.Trace("Host = {0}", Environment.MachineName);
GamTrainer.cs (1)
604ThreadTaskManager.Initialize(GamTrainerOptions.NumberOfThreads ?? Environment.ProcessorCount);
SumupPerformanceCommand.cs (1)
99_parallel = args.Parallel ?? Environment.ProcessorCount;
Microsoft.ML.GenAI.LLaMA.Tests (2)
LLaMA3_1Tests.cs (1)
24if (Environment.GetEnvironmentVariable("HELIX_CORRELATION_ID") != null)
LLaMA3_2Tests.cs (1)
19if (Environment.GetEnvironmentVariable("HELIX_CORRELATION_ID") != null)
Microsoft.ML.GenAI.Mistral.Tests (1)
Mistral_7B_Instruct_V0_3Tests.cs (1)
21if (Environment.GetEnvironmentVariable("HELIX_CORRELATION_ID") != null)
Microsoft.ML.GenAI.Phi.Tests (2)
Phi2Tests.cs (1)
21if (Environment.GetEnvironmentVariable("HELIX_CORRELATION_ID") != null)
Phi3Tests.cs (1)
22if (Environment.GetEnvironmentVariable("HELIX_CORRELATION_ID") != null)
Microsoft.ML.KMeansClustering (1)
KMeansPlusPlusTrainer.cs (1)
278int maxThreads = Environment.ProcessorCount / 2;
Microsoft.ML.Mkl.Components (1)
SymSgdClassificationTrainer.cs (1)
705int numThreads = _options.NumberOfThreads ?? Environment.ProcessorCount;
Microsoft.ML.OneDal (3)
OneDalUtils.cs (3)
23if (Environment.GetEnvironmentVariable("MLNET_BACKEND") == "ONEDAL" && 34var originalPath = Environment.GetEnvironmentVariable("PATH"); 35Environment.SetEnvironmentVariable("PATH", nativeLibs + ";" + originalPath);
Microsoft.ML.OnnxTransformerTest (2)
DnnImageFeaturizerTest.cs (2)
62if (!Environment.Is64BitProcess) 138if (!Environment.Is64BitProcess)
Microsoft.ML.PerformanceTests (1)
Harness\ProjectGenerator.cs (1)
70return string.Join(Environment.NewLine, File.ReadAllLines(csproj.FullName).Where(line => line.Contains("<NativeAssemblyReference")));
Microsoft.ML.Recommender (2)
MatrixFactorizationTrainer.cs (2)
366_threads = options.NumberOfThreads ?? Environment.ProcessorCount; 408_threads = args.NumberOfThreads ?? Environment.ProcessorCount;
Microsoft.ML.Samples (2)
Dynamic\Transforms\NormalizeMinMaxMulticolumn.cs (2)
87Console.WriteLine(Environment.NewLine); 109Console.WriteLine(Environment.NewLine);
Microsoft.ML.SearchSpace.Tests (3)
TestBase.cs (3)
19if (Environment.GetEnvironmentVariable("HELIX_CORRELATION_ID") != null) 39var cwd = Environment.CurrentDirectory; 51var cwd = Environment.CurrentDirectory;
Microsoft.ML.StandardTrainers (6)
Standard\LogisticRegression\LbfgsPredictorBase.cs (3)
451if (Environment.GetEnvironmentVariable("MLNET_BACKEND") == "ONEDAL" && 469int numThreads = !UseThreads ? 1 : (NumThreads ?? Environment.ProcessorCount); 570int numThreads = !UseThreads ? 1 : (NumThreads ?? Environment.ProcessorCount);
Standard\SdcaBinary.cs (1)
141=> Math.Min(8, Math.Max(1, Environment.ProcessorCount / 2));
Standard\SdcaRegression.cs (1)
171=> Math.Min(2, Math.Max(1, Environment.ProcessorCount / 2));
Standard\StochasticTrainerBase.cs (1)
48=> Math.Min(8, Math.Max(1, Environment.ProcessorCount / 2));
Microsoft.ML.Sweeper (1)
ConfigRunner.cs (1)
207RunProcess(Exe, new string[] { arguments }, Environment.CurrentDirectory,
Microsoft.ML.TensorFlow.Tests (3)
TensorflowTests.cs (3)
83_timeOutOldValue = Environment.GetEnvironmentVariable(ResourceManagerUtils.TimeoutEnvVariable); 84Environment.SetEnvironmentVariable(ResourceManagerUtils.TimeoutEnvVariable, (3 * 60 * 1000).ToString()); 90Environment.SetEnvironmentVariable(ResourceManagerUtils.TimeoutEnvVariable, _timeOutOldValue);
Microsoft.ML.TestFramework (13)
Attributes\LightGBMFactAttribute.cs (1)
23return Environment.Is64BitProcess && NativeLibrary.NativeLibraryExists("lib_lightgbm");
Attributes\LightGBMTheoryAttribute.cs (1)
23return Environment.Is64BitProcess && NativeLibrary.NativeLibraryExists("lib_lightgbm");
Attributes\TensorflowFactAttribute.cs (1)
23return (Environment.Is64BitProcess &&
Attributes\TensorflowTheoryAttribute.cs (1)
23return (Environment.Is64BitProcess &&
Attributes\TorchSharpFactAttribute.cs (1)
28return (Environment.Is64BitProcess &&
BaseTestBaseline.cs (7)
150if (!Environment.Is64BitProcess) 166if (Environment.Is64BitProcess) 660var message = iterationOnCollection != null ? "" : $"Output and baseline mismatch at line {iterationOnCollection}." + Environment.NewLine; 664$"Values to compare are {expected} and {actual}" + Environment.NewLine + 665$"\t AllowedVariance: {allowedVariance}" + Environment.NewLine + 666$"\t delta: {delta}" + Environment.NewLine + 667$"\t delta2: {delta2}" + Environment.NewLine);
GlobalBase.cs (1)
34Environment.SetEnvironmentVariable("MKL_CBWR", "COMPATIBLE");
Microsoft.ML.TestFrameworkCommon (5)
Attributes\X64FactAttribute.cs (1)
22return Environment.Is64BitProcess && System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture == System.Runtime.InteropServices.Architecture.X64;
TestCommon.cs (1)
65string directory = Environment.GetEnvironmentVariable(TestDataDirEnvVariable);
Utility\NativeLibrary.cs (1)
24else if (Environment.OSVersion.Platform == PlatformID.Unix)
Utility\PathResolver.cs (2)
151return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget", "packages");
Microsoft.ML.Tests (7)
OnnxConversionTest.cs (6)
199if (Environment.Is64BitProcess && NativeLibrary.NativeLibraryExists("lib_lightgbm")) 240if (Environment.Is64BitProcess && NativeLibrary.NativeLibraryExists("lib_lightgbm")) 295if (Environment.Is64BitProcess) 1673if (Environment.Is64BitProcess && NativeLibrary.NativeLibraryExists("lib_lightgbm")) 1951if (Environment.Is64BitProcess && NativeLibrary.NativeLibraryExists("lib_lightgbm")) 2000if (Environment.Is64BitProcess && NativeLibrary.NativeLibraryExists("lib_lightgbm"))
TrainerEstimators\OneDalEstimators.cs (1)
36Environment.SetEnvironmentVariable("MLNET_BACKEND", "ONEDAL");
Microsoft.ML.Tokenizers (4)
Model\CodeGenTokenizer.cs (2)
1756throw new ArgumentException($"Problems met when parsing JSON vocabulary object.{Environment.NewLine}Error message: {e.Message}"); 1796throw new IOException($"Cannot read the file Merge file.{Environment.NewLine}Error message: {e.Message}", e);
Model\EnglishRobertaTokenizer.cs (2)
188throw new ArgumentException($"Problems met when parsing JSON vocabulary object.{Environment.NewLine}Error message: {e.Message}"); 228throw new IOException($"Cannot read the file Merge file.{Environment.NewLine}Error message: {e.Message}", e);
Microsoft.ML.Tokenizers.Data.Tests (1)
src\Common\tests\RetryHelper.cs (1)
17private static readonly bool _debug = Environment.GetEnvironmentVariable("DEBUG_RETRYHELPER") == "1";
Microsoft.ML.Tokenizers.Tests (3)
BpeTests.cs (2)
614string result = $"[{string.Join(", ", encoding.Select(t => $"{t.Id}"))} ] {Environment.NewLine}"; 615result += $"[{string.Join(", ", encoding.Select(t => $"\"{t.Value}\""))} ] {Environment.NewLine}";
src\Common\tests\RetryHelper.cs (1)
17private static readonly bool _debug = Environment.GetEnvironmentVariable("DEBUG_RETRYHELPER") == "1";
Microsoft.NET.Build.Containers (10)
AuthHandshakeMessageHandler.cs (2)
397var credU = Environment.GetEnvironmentVariable(unameVar); 398var credP = Environment.GetEnvironmentVariable(passwordVar);
LocalDaemons\DockerCli.cs (2)
56foreach (string directory in (Environment.GetEnvironmentVariable("PATH") ?? string.Empty).Split(Path.PathSeparator)) 260string messages = string.Join(Environment.NewLine, errorProperty.EnumerateArray());
Registry\RegistrySettings.cs (2)
16ForceChunkedUpload = Environment.GetEnvironmentVariable(EnvVariables.ForceChunkedUpload) is not null ? 19ParallelUploadEnabled = Environment.GetEnvironmentVariable(EnvVariables.ParallelUploadEnabled) is not null ?
Tasks\CreateNewImage.cs (4)
57Environment.SetEnvironmentVariable(ContainerHelpers.HostObjectUser, userName); 58Environment.SetEnvironmentVariable(ContainerHelpers.HostObjectPass, pass); 75Environment.SetEnvironmentVariable(ContainerHelpers.HostObjectUser, null); 76Environment.SetEnvironmentVariable(ContainerHelpers.HostObjectPass, null);
Microsoft.NET.Build.Tasks (18)
CheckSdkVulnerabilities.cs (1)
28if (bool.TryParse(Environment.GetEnvironmentVariable(Microsoft.DotNet.Cli.EnvironmentVariableNames.SDK_VULNERABILITY_CHECK_DISABLE), out bool disabled) && disabled)
FrameworkPackages\FrameworkPackages.cs (1)
133log.LogMessage("Pack directories found: {0}", string.Join(Environment.NewLine, packDirectories));
ProcessFrameworkReferences.cs (1)
680string.Join(Environment.NewLine, matchingRuntimePacks.Select(rp => rp.RuntimePackNamePatterns)));
ShowMissingWorkloads.cs (1)
45string globalJsonPath = SdkDirectoryWorkloadManifestProvider.GetGlobalJsonPath(Environment.CurrentDirectory);
src\sdk\src\Common\CliFolderPathCalculatorCore.cs (3)
17: this(Environment.GetEnvironmentVariable) 59home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
src\sdk\src\Common\EnvironmentVariableNames.cs (2)
67=> TryGetDotNetRootVariableNameImpl(runtimeIdentifier, defaultAppHostRuntimeIdentifier, targetFrameworkVersion, RuntimeInformation.ProcessArchitecture, Environment.Is64BitProcess); 88=> TryGetDotNetRootVariableNameImpl(runtimeIdentifier, defaultAppHostRuntimeIdentifier, null, RuntimeInformation.ProcessArchitecture, Environment.Is64BitProcess, onlyUseArchSpecific: true);
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\SdkDirectoryWorkloadManifestProvider.cs (2)
60: this(sdkRootPath, sdkVersion, Environment.GetEnvironmentVariable, userProfileDir, globalJsonPath) 66return new SdkDirectoryWorkloadManifestProvider(sdkRootPath, sdkVersion, Environment.GetEnvironmentVariable, userProfileDir, globalJsonPath: null, workloadSetVersion);
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadInstallType.cs (2)
44return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "dotnet", "workloads", architecture, sdkFeatureBand.ToString(), "InstallState");
src\sdk\src\Resolvers\Microsoft.NET.Sdk.WorkloadManifestReader\WorkloadResolver.cs (1)
45var packRootEnvironmentVariable = (getEnvironmentVariable ?? Environment.GetEnvironmentVariable)(EnvironmentVariableNames.WORKLOAD_PACK_ROOTS);
src\sdk\src\Tasks\Common\TaskBase.cs (4)
70Environment.NewLine, 74Environment.NewLine); 95s = s + " ---> " + ExceptionToStringWithoutMessage(e.InnerException) + Environment.NewLine + 104s += Environment.NewLine + stackTrace;
Microsoft.NET.HostModel (2)
Bundle\Bundler.cs (1)
59_outputDir = Path.GetFullPath(string.IsNullOrEmpty(outputDir) ? Environment.CurrentDirectory : outputDir);
Bundle\TargetInfo.cs (1)
36FrameworkVersion = targetFrameworkVersion ?? Environment.Version;
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (2)
BrotliCompress.cs (1)
44_dotnetPath = Environment.GetEnvironmentVariable("DOTNET_HOST_PATH");
GenerateServiceWorkerAssetsManifest.cs (1)
68Environment.NewLine,
Microsoft.NET.Sdk.Publish.Tasks (16)
EnvironmentHelper.cs (2)
10return Environment.GetEnvironmentVariable(name); 15var str = Environment.GetEnvironmentVariable(name);
MsDeploy\CommonUtility.cs (2)
1680strBuilder.Append(Environment.NewLine); 1686strBuilder.Append(Environment.NewLine);
src\sdk\src\Common\EnvironmentVariableNames.cs (2)
67=> TryGetDotNetRootVariableNameImpl(runtimeIdentifier, defaultAppHostRuntimeIdentifier, targetFrameworkVersion, RuntimeInformation.ProcessArchitecture, Environment.Is64BitProcess); 88=> TryGetDotNetRootVariableNameImpl(runtimeIdentifier, defaultAppHostRuntimeIdentifier, null, RuntimeInformation.ProcessArchitecture, Environment.Is64BitProcess, onlyUseArchSpecific: true);
Tasks\GenerateEFSQLScripts.cs (3)
86string? previousAspNetCoreEnvironment = Environment.GetEnvironmentVariable(AspNetCoreEnvironment); 87Environment.SetEnvironmentVariable(AspNetCoreEnvironment, "Development"); 134Environment.SetEnvironmentVariable(AspNetCoreEnvironment, previousAspNetCoreEnvironment);
Tasks\MsDeploy\CreateMSDeployScript.cs (1)
45var lines = fileContents.Split(new string[] { Environment.NewLine, "\n" }, StringSplitOptions.None);
Tasks\MsDeploy\MSDeploy.cs (6)
265string programFiles = Environment.ExpandEnvironmentVariables("%ProgramFiles(x86)%"); 272if (!Environment.Is64BitOperatingSystem || Environment.Is64BitProcess) 274programFiles = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles); 280programFiles = Environment.ExpandEnvironmentVariables("%ProgramW6432%");
Microsoft.NET.Sdk.Razor.Tasks (18)
DotnetToolTask.cs (5)
61var dotnetHostPath = Environment.GetEnvironmentVariable("DOTNET_HOST_PATH"); 85var processId = Environment.ProcessId; 236var lines = output.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); 249var lines = output.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); 277var list = responseFileCommands.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
src\sdk\src\RazorSdk\Tool\PipeName.cs (1)
34var userName = Environment.UserName;
src\sdk\src\RazorSdk\Tool\ServerProtocol\ServerConnection.cs (8)
57var tmp = Environment.GetEnvironmentVariable("TMP"); 63var temp = Environment.GetEnvironmentVariable("TEMP"); 82var userProfile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); 88return Environment.GetEnvironmentVariable("SYSTEMROOT"); 281var expectedPath = Environment.GetEnvironmentVariable("DOTNET_HOST_PATH"); 288expectedPath = System.Environment.ProcessPath; 301var paths = Environment.GetEnvironmentVariable("PATH").Split(Path.PathSeparator);
src\sdk\src\RazorSdk\Tool\ServerProtocol\ServerLogger.cs (4)
37var loggingFileName = Environment.GetEnvironmentVariable(EnvironmentVariable); 113GetCurrentProcessId(), Environment.CurrentManagedThreadId, Environment.TickCount); 128Environment.ProcessId;
Microsoft.NET.Sdk.StaticWebAssets.Tasks (24)
Compression\BrotliCompress.cs (1)
35_dotnetPath = Environment.GetEnvironmentVariable("DOTNET_HOST_PATH");
ComputeReferenceStaticWebAssetItems.cs (2)
87Environment.NewLine + string.Join(Environment.NewLine, all.Select(a => $"({a.Identity},{a.AssetKind})")));
ComputeStaticWebAssetsForCurrentProject.cs (2)
60Environment.NewLine + string.Join(Environment.NewLine, all.Select(a => $"({a.Identity},{a.AssetKind})")));
DefineStaticWebAssets.cs (6)
533var errorMessage = "More than two assets are targeting the same path: " + Environment.NewLine + 534"'{0}' with kind '{1}'" + Environment.NewLine + 535"'{2}' with kind '{3}'" + Environment.NewLine + 555var errorMessage = "Two assets found targeting the same path with incompatible asset kinds:" + Environment.NewLine + 556"'{0}' with kind '{1}'" + Environment.NewLine + 557"'{2}' with kind '{3}'" + Environment.NewLine +
GenerateStaticWebAssetEndpointsManifest.cs (1)
194return (string.Join(Environment.NewLine, parsed), parsed);
JSModules\ApplyJsModules.cs (4)
70Environment.NewLine + 71string.Join(Environment.NewLine, jsModuleFiles.Select(f => f.ItemSpec))); 83Environment.NewLine + 84string.Join(Environment.NewLine, jsModuleFiles.Select(f => f.ItemSpec)));
OverrideHtmlAssetPlaceholders.cs (1)
151return String.Join(Environment.NewLine, links.Select(l => l.Value));
ScopedCss\ApplyCssScopes.cs (4)
73Environment.NewLine + 74string.Join(Environment.NewLine, scopeFiles.Select(f => f.ItemSpec))); 86Environment.NewLine + 87string.Join(Environment.NewLine, scopeFiles.Select(f => f.ItemSpec)));
ServiceWorker\GenerateServiceWorkerAssetsManifest.cs (2)
81Environment.NewLine, 100var content = $"self.assetsManifest = {data};{Environment.NewLine}";
ServiceWorker\UpdateServiceWorkerFileWithVersion.cs (1)
32var versionedContent = $"/* Manifest version: {ManifestVersion} */{Environment.NewLine}{sourceContent}";
Microsoft.NET.Sdk.WorkloadManifestReader (7)
SdkDirectoryWorkloadManifestProvider.cs (2)
60: this(sdkRootPath, sdkVersion, Environment.GetEnvironmentVariable, userProfileDir, globalJsonPath) 66return new SdkDirectoryWorkloadManifestProvider(sdkRootPath, sdkVersion, Environment.GetEnvironmentVariable, userProfileDir, globalJsonPath: null, workloadSetVersion);
src\sdk\src\Common\EnvironmentVariableNames.cs (2)
67=> TryGetDotNetRootVariableNameImpl(runtimeIdentifier, defaultAppHostRuntimeIdentifier, targetFrameworkVersion, RuntimeInformation.ProcessArchitecture, Environment.Is64BitProcess); 88=> TryGetDotNetRootVariableNameImpl(runtimeIdentifier, defaultAppHostRuntimeIdentifier, null, RuntimeInformation.ProcessArchitecture, Environment.Is64BitProcess, onlyUseArchSpecific: true);
WorkloadInstallType.cs (2)
44return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "dotnet", "workloads", architecture, sdkFeatureBand.ToString(), "InstallState");
WorkloadResolver.cs (1)
45var packRootEnvironmentVariable = (getEnvironmentVariable ?? Environment.GetEnvironmentVariable)(EnvironmentVariableNames.WORKLOAD_PACK_ROOTS);
Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver (5)
CachingWorkloadResolver.cs (1)
61var envVar = Environment.GetEnvironmentVariable("MSBuildEnableWorkloadResolver");
src\sdk\src\Common\CliFolderPathCalculatorCore.cs (3)
17: this(Environment.GetEnvironmentVariable) 59home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
WorkloadSdkResolver.cs (1)
105string? startDir = Environment.CurrentDirectory;
Microsoft.NET.StringTools (2)
WeakStringCache.Concurrent.cs (2)
23_stringsByHashCode = new ConcurrentDictionary<int, string>(Environment.ProcessorCount, _initialCapacity); 24_weakHandlesByHashCode = new ConcurrentDictionary<int, StringWeakHandle>(Environment.ProcessorCount, _initialCapacity);
Microsoft.Private.Windows.Core (7)
src\winforms\src\Microsoft.Private.Windows.Polyfills\System\OperatingSystemExtensions.cs (2)
11/// Checks whether the Windows version (returned by <see cref="Environment.OSVersion"/>) is greater than 25Version current = Environment.OSVersion.Version;
Windows\Win32\Graphics\GdiPlus\GdiplusStartupInputEx.cs (1)
10OperatingSystem os = Environment.OSVersion;
Windows\Win32\PInvokeCore.GetClassLong.cs (1)
18=> Environment.Is64BitProcess
Windows\Win32\PInvokeCore.GetWindowLong.cs (1)
28nint result = Environment.Is64BitProcess
Windows\Win32\PInvokeCore.SetClassLong.cs (1)
16=> Environment.Is64BitProcess
Windows\Win32\PInvokeCore.SetWindowLong.cs (1)
17nint result = Environment.Is64BitProcess
Microsoft.SourceLink.AzureRepos.Git (1)
GetSourceLinkUrl.cs (1)
96var value = Environment.GetEnvironmentVariable(name);
Microsoft.TemplateEngine.Abstractions (1)
IEnvironment.cs (1)
22/// Replaces the name of each environment variable embedded in the specified string with the string equivalent of the value of the variable, then returns the resulting string. Equivalent to <see cref="Environment.ExpandEnvironmentVariables(string)"/>.
Microsoft.TemplateEngine.Cli (7)
CliEnvironment.cs (3)
19var env = Environment.GetEnvironmentVariables(); 29public string NewLine { get; } = Environment.NewLine; 39return Environment.ExpandEnvironmentVariables(name);
Commands\create\TemplateCommand.cs (1)
41template.Name + Environment.NewLine + template.Description)
TemplatePackageDisplay.cs (3)
382reporter.Write(Environment.NewLine); 388Environment.NewLine, 390reporter.Write(Environment.NewLine);
Microsoft.TemplateEngine.Core (1)
Expressions\Shared\SharedEvaluatorDefinition.cs (1)
186: (faultedMessage + Environment.NewLine + e.Message);
Microsoft.TemplateEngine.Edge (8)
DefaultEnvironment.cs (4)
11/// Gets environment variables from <see cref="Environment"/>. 24NewLine = Environment.NewLine; 38return Environment.ExpandEnvironmentVariables(name); 57IDictionary env = Environment.GetEnvironmentVariables();
DefaultTemplateEngineHost.cs (1)
37WorkingDirectory = Environment.CurrentDirectory;
Settings\TemplateCache.cs (1)
195templatesList.ToString().TrimEnd(Environment.NewLine.ToCharArray()),
Template\TemplateCreator.cs (1)
220string message = string.Join(Environment.NewLine, ExceptionMessages(cx));
VirtualEnvironment.cs (1)
19/// <param name="includeRealEnvironment">If set to true - variables from <see cref="Environment"/> are added.</param>
Microsoft.TestPlatform.Build (8)
Tasks\TestTaskUtils.cs (2)
219Environment.SetEnvironmentVariable("VSTEST_MSBUILD_NOLOGO", "1"); 250var dotnetHostPath = Environment.GetEnvironmentVariable("DOTNET_HOST_PATH");
Tasks\VSTestLogsTask.cs (1)
25Log.LogMessage(MessageImportance.Normal, Resources.Resources.BuildCompleted + Environment.NewLine);
Tasks\VSTestTask.cs (2)
48var traceEnabledValue = Environment.GetEnvironmentVariable("VSTEST_BUILD_TRACE"); 51var debugEnabled = Environment.GetEnvironmentVariable("VSTEST_BUILD_DEBUG");
Tasks\VSTestTask2.cs (3)
61_disableUtf8ConsoleEncoding = Environment.GetEnvironmentVariable("VSTEST_DISABLE_UTF8_CONSOLE_ENCODING") == "1"; 62var isPrependedWithAnsi = Environment.GetEnvironmentVariable("DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION"); 167var n = Environment.NewLine;
Microsoft.TestPlatform.CommunicationUtilities (1)
DataCollectionRequestHandler.cs (1)
271Path.GetFullPath(Environment.ExpandEnvironmentVariables(datacollectorSearchPath));
Microsoft.TestPlatform.CoreUtilities (11)
Extensions\StringBuilderExtensions.cs (1)
31data += Environment.NewLine;
FeatureFlag\FeatureFlag.cs (1)
33public bool IsSet(string featureFlag) => _cache.GetOrAdd(featureFlag, f => (Environment.GetEnvironmentVariable(f)?.Trim() ?? "0") != "0");
Helpers\DotnetHostHelper.cs (1)
113var pathString = Environment.GetEnvironmentVariable("PATH")!;
Helpers\EnvironmentHelper.cs (1)
20var envVarValue = Environment.GetEnvironmentVariable(VstestConnectionTimeout);
Helpers\EnvironmentVariableHelper.cs (4)
15=> Environment.GetEnvironmentVariable(variable); 19=> Environment.GetEnvironmentVariable(variable) is string value && !string.IsNullOrEmpty(value) 25=> Environment.SetEnvironmentVariable(variable, value); 29=> Environment.GetEnvironmentVariables();
Output\ConsoleOutput.cs (1)
58Write(Environment.NewLine, level);
Tracing\EqtTrace.cs (2)
732string prefix = Environment.NewLine + '\t'; 788message.Append(Environment.NewLine);
Microsoft.TestPlatform.CrossPlatEngine (13)
Adapter\FrameworkHandle.cs (1)
93WorkingDirectory = workingDirectory ?? Environment.CurrentDirectory
Client\Parallel\ParallelOperationManager.cs (1)
24Environment.GetEnvironmentVariable(nameof(VSTEST_HOSTPRESTART_COUNT)),
Client\ProxyOperationManager.cs (3)
256var hostDebugEnabled = Environment.GetEnvironmentVariable("VSTEST_HOST_DEBUG"); 257var nativeHostDebugEnabled = Environment.GetEnvironmentVariable("VSTEST_HOST_NATIVE_DEBUG"); 328var timeout = int.TryParse(Environment.GetEnvironmentVariable("VSTEST_TESTHOST_SHUTDOWN_TIMEOUT"), out var time)
DataCollection\InProcDataCollector.cs (1)
158assembly = _assemblyLoadContext.LoadAssemblyFromPath(Environment.ExpandEnvironmentVariables(codeBase));
DataCollection\ProxyDataCollectionManager.cs (1)
267var dataCollectorDebugEnabled = Environment.GetEnvironmentVariable(DebugEnvironmentVaribleName);
EventHandlers\TestRequestHandler.cs (3)
116var remotePath = Environment.GetEnvironmentVariable("VSTEST_UWP_DEPLOY_REMOTE_PATH") ?? self.RemotePath ?? currentProcessDirectory; 118var localPath = Environment.GetEnvironmentVariable("VSTEST_UWP_DEPLOY_LOCAL_PATH") ?? self.LocalPath; 354var flag = Environment.GetEnvironmentVariable("VSTEST_DISABLE_PROTOCOL_3_VERSION_DOWNGRADE");
Execution\BaseRunTests.cs (1)
411var pid = Environment.ProcessId;
PostProcessing\ArtifactProcessingManager.cs (2)
70var pid = Environment.ProcessId; 252private static bool IsTelemetryOptedIn() => Environment.GetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN")?.Equals("1", StringComparison.Ordinal) == true;
Microsoft.TestPlatform.Extensions.BlameDataCollector (14)
BlameCollector.cs (3)
705var temp = Environment.GetEnvironmentVariable("VSTEST_DUMP_TEMP_PATH") ?? Environment.GetEnvironmentVariable("AGENT_TEMPDIRECTORY") ?? Path.GetTempPath(); 722var dumpDirectoryOverride = Environment.GetEnvironmentVariable("VSTEST_DUMP_PATH");
BlameLogger.cs (1)
103sb.Append(tcn).Append(Environment.NewLine);
CrashDumperFactory.cs (1)
43var procdumpOverride = Environment.GetEnvironmentVariable("VSTEST_DUMP_FORCEPROCDUMP")?.Trim();
HangDumperFactory.cs (1)
21var procdumpOverride = Environment.GetEnvironmentVariable("VSTEST_DUMP_FORCEPROCDUMP")?.Trim();
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (8)
36var debugEnabled = Environment.GetEnvironmentVariable(environmentVariable); 55Environment.ProcessId; 76var vsAttachPath = Environment.GetEnvironmentVariable(env) ?? FindAttachVs(); 79Environment.SetEnvironmentVariable(env, vsAttachPath); 104var paths = Environment.GetEnvironmentVariable("PATH")!.Split(';'); 127var debugEnabled = Environment.GetEnvironmentVariable(environmentVariable); 154var nativeDebugEnabled = Environment.GetEnvironmentVariable(environmentVariable); 180return Environment.GetEnvironmentVariable("VSTEST_DEBUG_NOBP")?.Equals("1") ?? false;
Microsoft.TestPlatform.PlatformAbstractions (7)
common\Tracing\PlatformEqtTrace.cs (2)
226Environment.CurrentManagedThreadId, 394string[] args = Environment.GetCommandLineArgs();
Interfaces\System\IEnvironment.cs (1)
38/// <inheritdoc cref="System.Environment.ProcessorCount"/>
net462\System\ProcessHelper.cs (1)
107if (!Environment.Is64BitOperatingSystem)
netcore\System\PlatformEnvironment.cs (3)
63public int ProcessorCount => Environment.ProcessorCount; 68Environment.Exit(exitcode); 73=> Environment.CurrentManagedThreadId;
Microsoft.TestPlatform.TestHostRuntimeProvider (1)
Hosting\DotnetTestHostManager.cs (1)
629string? processorArchitecture = Environment.GetEnvironmentVariable(PROCESSOR_ARCHITECTURE, EnvironmentVariableTarget.Machine);
Microsoft.TestPlatform.Utilities (2)
ClientUtilities.cs (1)
65fileName = Environment.ExpandEnvironmentVariables(fileName);
InferRunSettingsHelper.cs (1)
710&& (targetPlatform == Architecture.X64 && !Environment.Is64BitOperatingSystem || sourcePlatform != targetPlatform);
Microsoft.TestPlatform.VsTestConsole.TranslationLayer (3)
ConsoleParameters.cs (1)
52/// You most likely want to use <see cref="System.Environment.GetEnvironmentVariables(System.EnvironmentVariableTarget)"/> and combine
VsTestConsoleWrapper.cs (2)
173_consoleParameters.ParentProcessId = Environment.ProcessId; 686_consoleParameters.ParentProcessId = Environment.ProcessId;
Microsoft.TestUtilities (1)
XUnit\EnvironmentVariableConditionAttribute.cs (1)
66_currentValue ??= Environment.GetEnvironmentVariable(VariableName);
Microsoft.VisualBasic.Core (19)
Microsoft\VisualBasic\CompilerServices\IOUtils.vb (1)
45DirName = Environment.CurrentDirectory
Microsoft\VisualBasic\CompilerServices\ProjectData.vb (1)
182System.Environment.Exit(0) 'System.Environment.Exit will cause finalizers to be run at shutdown
Microsoft\VisualBasic\FileIO\FileSystem.vb (4)
945If showUI <> UIOptionInternal.NoUI AndAlso Environment.UserInteractive Then 1142If Environment.OSVersion.Platform = PlatformID.Win32NT Then ' Platforms supporting MoveFileEx. 1201If (showUI <> UIOptionInternal.NoUI) AndAlso Environment.UserInteractive Then 1235If (showUI <> UIOptionInternal.NoUI) AndAlso Environment.UserInteractive Then
Microsoft\VisualBasic\FileIO\SpecialDirectories.vb (7)
8Imports System.Environment 28Return GetDirectoryPath(Environment.GetFolderPath(SpecialFolder.Personal), SR.IO_SpecialDirectory_MyDocuments) 40Return GetDirectoryPath(Environment.GetFolderPath(SpecialFolder.MyMusic), SR.IO_SpecialDirectory_MyMusic) 52Return GetDirectoryPath(Environment.GetFolderPath(SpecialFolder.MyPictures), SR.IO_SpecialDirectory_MyPictures) 63Return GetDirectoryPath(Environment.GetFolderPath(SpecialFolder.Desktop), SR.IO_SpecialDirectory_Desktop) 74Return GetDirectoryPath(Environment.GetFolderPath(SpecialFolder.Programs), SR.IO_SpecialDirectory_Programs) 85Return GetDirectoryPath(Environment.GetFolderPath(SpecialFolder.ProgramFiles), SR.IO_SpecialDirectory_ProgramFiles)
Microsoft\VisualBasic\FileSystem.vb (1)
389DirName = Environment.CurrentDirectory
Microsoft\VisualBasic\Interaction.vb (5)
40Dim s As String = Environment.CommandLine 61LengthOfAppName = Environment.GetCommandLineArgs(0).Length 90m_SortedEnvList = New System.Collections.SortedList(Environment.GetEnvironmentVariables()) 113Return Environment.GetEnvironmentVariable(Expression) 516If String.Equals(Environment.MachineName, ServerName, StringComparison.OrdinalIgnoreCase) Then
Microsoft.VisualStudio.TestPlatform.Client (1)
TestPlatform.cs (1)
341string adapterPath = Path.GetFullPath(Environment.ExpandEnvironmentVariables(path));
Microsoft.VisualStudio.TestPlatform.Common (10)
DataCollection\DataCollectionAttachmentManager.cs (1)
113var expandedOutputDirectory = Environment.ExpandEnvironmentVariables(outputDirectory);
DataCollection\TestPlatformDataCollectionLogger.cs (4)
73"Data collector '{0}' logged the following error:" + Environment.NewLine + 74"Description: {1}" + Environment.NewLine + 75"Exception type: {2}" + Environment.NewLine + "Exception message: {3}" 76+ Environment.NewLine + "Exception stack trace: {4}",
ExtensionFramework\TestPluginCache.cs (4)
91"TestPluginCache.GetExtensionPaths: Filtered extension paths: {0}", string.Join(Environment.NewLine, extensions)); 97"TestPluginCache.GetExtensionPaths: Added default extension paths: {0}", string.Join(Environment.NewLine, _defaultExtensionPaths)); 101"TestPluginCache.GetExtensionPaths: Added unfilterableExtensionPaths: {0}", string.Join(Environment.NewLine, _unfilterableExtensionPaths)); 151"TestPluginCache.DiscoverTestExtensions: Discovering the extensions using allExtensionPaths: {0}", string.Join(Environment.NewLine, allExtensionPaths));
Utilities\RunSettingsUtilities.cs (1)
45return Environment.ExpandEnvironmentVariables(runConfiguration.ResultsDirectory);
Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger (2)
HtmlLogger.cs (2)
323Environment.GetEnvironmentVariable("UserName"), Environment.MachineName,
Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger (12)
ObjectModel\TestRun.cs (2)
64_name = string.Format(CultureInfo.CurrentCulture, TrxLoggerResources.Common_TestRunName, Environment.GetEnvironmentVariable("UserName"), Environment.MachineName, FormatDateTimeForRunName(DateTime.Now));
TrxLogger.cs (3)
244runMessage = new RunInfo(e.Message, null, Environment.MachineName, TrxLoggerObjectModel.TestOutcome.Warning); 249runMessage = new RunInfo(e.Message, null, Environment.MachineName, TrxLoggerObjectModel.TestOutcome.Error); 383RunInfo runMessage = new(msg, null, Environment.MachineName, TrxLoggerObjectModel.TestOutcome.Error);
Utility\Converter.cs (7)
449targetDirectory = Path.Combine(targetDirectory, Environment.MachineName); 474string fileName = Path.Combine(Environment.MachineName, Path.GetFileName(targetFileName)); 490Environment.MachineName, 505testResultDirectory = Path.Combine(testResultDirectory, Environment.MachineName); 529string fileName = Path.Combine(Environment.MachineName, Path.GetFileName(targetFileName)); 689new TestResultAggregation(runId, testId, executionId, parentExecutionId, resultName, Environment.MachineName, outcome, testType, testCategoryId, _trxFileHelper) : 690new UnitTestResult(runId, testId, executionId, parentExecutionId, resultName, Environment.MachineName, outcome, testType, testCategoryId, _trxFileHelper);
Microsoft.VisualStudio.TestPlatform.ObjectModel (5)
DataCollector\TransferInformation\FileTransferInformation.cs (1)
58path = Environment.ExpandEnvironmentVariables(path);
RunSettings\RunConfiguration.cs (2)
898solutionDirectory = Environment.ExpandEnvironmentVariables(solutionDirectory); 948dotnetHostPath = Environment.ExpandEnvironmentVariables(dotnetHostPath);
TestServiceLocator.cs (1)
33Resolves.Add(new Resolve(name, typeof(TRegistration).FullName!, Environment.StackTrace));
Utilities\StringUtilities.cs (1)
26result = result.TrimEnd(Environment.NewLine.ToCharArray());
Microsoft.Win32.Registry (1)
Microsoft\Win32\RegistryKey.cs (1)
1178str = Environment.ExpandEnvironmentVariables(str);
MSBuild (36)
CommandLine\CommandLineParser.cs (1)
387argsFromResponseFile.AddRange(QuotingUtilities.SplitUnquoted(Environment.ExpandEnvironmentVariables(responseFileLine)));
CommandLine\CommandLineSwitchException.cs (1)
75return base.Message + Environment.NewLine + ResourceUtilities.FormatResourceStringStripCodeAndKeyword("InvalidSwitchIndicator", commandLineArg);
InitializationException.cs (3)
80return base.Message + Environment.NewLine + ResourceUtilities.FormatResourceStringStripCodeAndKeyword("InvalidSwitchIndicator", invalidSwitch); 149errorMessage += Environment.NewLine + e.ToString(); 176errorMessage += Environment.NewLine + e.ToString();
OutOfProcTaskHostNode.cs (1)
1235if (Environment.GetEnvironmentVariable("MSBUILDTASKHOSTABORTTASKONCANCEL") == "1")
PerformanceLogEventListener.cs (2)
55string logDirectory = Environment.GetEnvironmentVariable(PerfLogDirEnvVar); 145s_builder.Append($"[{DateTime.UtcNow:o}] Event={eventData.EventSource.Name}/{eventData.EventName} ProcessID={_processIDStr} ThreadID={Environment.CurrentManagedThreadId}\t ");
src\msbuild\src\Shared\Debugging\DebugUtils.cs (3)
178builder.Append(Environment.NewLine); 181builder.Append(Environment.NewLine); 183builder.Append(Environment.NewLine);
src\msbuild\src\Shared\LogMessagePacketBase.cs (2)
265private static readonly int s_defaultPacketVersion = (Environment.Version.Major * 10) + Environment.Version.Minor;
XMake.cs (23)
307if (Environment.GetEnvironmentVariable("MSBUILDDUMPPROCESSCOUNTERS") == "1") 314Environment.GetEnvironmentVariable(Traits.UseMSBuildServerEnvVarName) == "1" && 330if (Environment.GetEnvironmentVariable("MSBUILDDUMPPROCESSCOUNTERS") == "1") 612switch (Environment.GetEnvironmentVariable("MSBUILDDEBUGONSTART")) 659Environment.SetEnvironmentVariable("MSBuildLoadMicrosoftTargetsReadOnly", "true"); 799Environment.SetEnvironmentVariable("MSBUILDLOADALLFILESASWRITEABLE", "1"); 902string timerOutputFilename = Environment.GetEnvironmentVariable("MSBUILDTIMEROUTPUTS"); 1071if (Environment.GetEnvironmentVariable("MSBUILDDONOTLAUNCHDEBUGGER") != "1") 1188Environment.Exit(1); // the process will now be terminated rudely 1243Environment.Exit(0); // the process can now be terminated as everything has already been gracefully cancelled. 1507if (!string.Equals(Environment.GetEnvironmentVariable("MSBUILDLOGASYNC"), "1", StringComparison.Ordinal)) 1552string memoryUseLimit = Environment.GetEnvironmentVariable("MSBUILDMEMORYUSELIMIT"); 1799Environment.CurrentDirectory), 1927(Environment.OSVersion.Platform != PlatformID.Win32NT || 1928Environment.OSVersion.Version.Major < 6 || 1929(Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor < 1))) // Windows 7 is minimum 2103Environment.SetEnvironmentVariable("_MSBUILDTLENABLED", useTerminalLogger ? "1" : "0"); 2472string dotnetCliEnvVar = Environment.GetEnvironmentVariable("DOTNET_CLI_CONFIGURE_MSBUILD_TERMINAL_LOGGER"); 2507string liveLoggerArg = Environment.GetEnvironmentVariable("MSBUILDLIVELOGGER"); 2508terminalLoggerArg = Environment.GetEnvironmentVariable("MSBUILDTERMINALLOGGER"); 2621return automatedEnvironmentVariables.Any(envVar => !string.IsNullOrEmpty(Environment.GetEnvironmentVariable(envVar))); 2767if (Environment.GetEnvironmentVariable("MSBUILDDISABLENODEREUSE") == "1") // For example to disable node reuse in a gated checkin, without using the flag
mscorlib (1)
src\runtime\src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
223[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Environment))]
MyFrontend (1)
Program.cs (1)
13var isHttps = Environment.GetEnvironmentVariable("DOTNET_LAUNCHPROFILE") == "https";
netstandard (1)
netstandard.cs (1)
781[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Environment))]
NuGet.Build.Tasks (3)
BuildTasksUtility.cs (1)
219DisableParallel = Environment.ProcessorCount == 1 ? true : disableParallel,
RestoreTaskEx.cs (1)
40public bool DisableParallel { get; set; } = Environment.ProcessorCount == 1;
StaticGraphRestoreTaskBase.cs (1)
134WorkingDirectory = Environment.CurrentDirectory,
NuGet.Build.Tasks.Console (9)
MSBuildFeatureFlags.cs (8)
28get => string.Equals(Environment.GetEnvironmentVariable("MSBuildCacheFileEnumerations"), "1", StringComparison.Ordinal); 29set => Environment.SetEnvironmentVariable("MSBuildCacheFileEnumerations", value ? "1" : null); 41get => string.Equals(Environment.GetEnvironmentVariable("MSBuildLoadAllFilesAsReadonly"), "1", StringComparison.Ordinal); 42set => Environment.SetEnvironmentVariable("MSBuildLoadAllFilesAsReadonly", value ? "1" : null); 55get => Environment.GetEnvironmentVariable("MSBUILD_EXE_PATH"); 56set => Environment.SetEnvironmentVariable("MSBUILD_EXE_PATH", value); 77get => !string.Equals(Environment.GetEnvironmentVariable("MSBuildSkipEagerWildCardEvaluationRegexes"), null, StringComparison.Ordinal); 78set => Environment.SetEnvironmentVariable("MSBuildSkipEagerWildCardEvaluationRegexes", SkipWildcardRegularExpression);
MSBuildStaticGraphRestore.cs (1)
978Parallel.ForEach(projects, new ParallelOptions { MaxDegreeOfParallelism = Environment.ProcessorCount }, project =>
NuGet.CommandLine.XPlat (14)
Commands\ConfigCommands\ConfigRunners.cs (2)
221logger.LogMinimal(Environment.NewLine); 230logger.LogMinimal(Environment.NewLine);
Commands\Package\Update\PackageUpdateCommand.cs (1)
60Project = project?.FullName ?? Environment.CurrentDirectory,
Commands\Package\Update\PackageUpdateCommandRunner.cs (1)
362MaxDegreeOfParallelism = Environment.ProcessorCount,
Commands\PackageReferenceCommands\AddPackageReferenceCommandRunner.cs (1)
129sources.Add(UriUtility.GetAbsolutePath(Environment.CurrentDirectory, source));
Commands\PackageReferenceCommands\ListPackage\ListPackageCommandRunner.cs (2)
430? Environment.ProcessorCount + 1 // Fallback when no package sources are configured 431: (Environment.ProcessorCount / listPackageArgs.PackageSources.Count) + 1;
Commands\Why\DotnetVersionChecker.cs (1)
20_cachedVersion = Environment.Version.Major;
UILanguageOverride.cs (1)
90Environment.SetEnvironmentVariable(environmentVariableName, value);
Utility\AddPackageCommandUtility.cs (1)
33var maxTasks = Environment.ProcessorCount;
Utility\HttpSourcesUtility.cs (2)
55Environment.NewLine + string.Join(Environment.NewLine, httpSources.Select(e => e.Name)));
Utility\MSBuildAPIUtility.cs (1)
677Environment.NewLine,
Utility\TableParser.cs (1)
137stringTable.Add(new FormattedCell(Environment.NewLine));
NuGet.Commands (26)
ListCommand\ListCommandRunner.cs (2)
100Environment.NewLine + string.Join(Environment.NewLine, httpPackageSources.Select(e => e.Name))));
RestoreCommand\CompatibilityIssue.cs (2)
218sb.Append(Environment.NewLine).Append(" - " + framework); 237sb.Append(Environment.NewLine).Append(" - " + framework);
RestoreCommand\Diagnostics\DiagnosticUtility.cs (1)
97sb.Append(Environment.NewLine);
RestoreCommand\RequestFactory\DependencyGraphSpecRequestProvider.cs (1)
91MaxDegreeOfParallelism = Environment.ProcessorCount
RestoreCommand\RestoreCommand.cs (8)
1439var invalidReasons = string.Join(Environment.NewLine, lockFileResult.InvalidReasons); 1642var text = Strings.Log_CycleDetected + $" {Environment.NewLine} {cycle.GetPath()}."; 1674+ $" {Environment.NewLine} {versionConflict.Selected.GetPathWithLastRange()} {Environment.NewLine} {versionConflict.Conflicting.GetPathWithLastRange()}."; 1684+ $" {Environment.NewLine} {versionConflict.Selected.GetPathWithLastRange()} {Environment.NewLine} {versionConflict.Conflicting.GetPathWithLastRange()}."; 1735+ $" {Environment.NewLine} {downgraded.GetPathWithLastRange()} {Environment.NewLine} {downgradedBy.GetPathWithLastRange()}";
RestoreCommand\RestoreRunner.cs (1)
230maxTasks = Environment.ProcessorCount;
SignCommand\SignCommandRunner.cs (1)
54signArgs.Logger.LogInformation(Environment.NewLine);
SourcesCommands\SourceRunners.cs (2)
230Environment.NewLine + string.Join(Environment.NewLine, httpPackageSources.Select(e => e.Name))));
src\nuget-client\build\Shared\TaskResultCache.cs (2)
46_cache = new(concurrencyLevel: Environment.ProcessorCount, capacity); 47_perTaskLock = new(concurrencyLevel: Environment.ProcessorCount, capacity);
TrustedSignersCommand\TrustedSignersCommandRunner.cs (1)
214await logger.LogAsync(LogLevel.Minimal, Environment.NewLine);
VerifyCommand\VerifyCommandRunner.cs (5)
121logger.LogMinimal(Environment.NewLine + string.Format(CultureInfo.CurrentCulture, 128logger.LogInformation($"{packagePath}{Environment.NewLine}"); 137logger.LogMinimal(Environment.NewLine); 154logger.LogInformation(Environment.NewLine + string.Format(CultureInfo.CurrentCulture, Strings.VerifyCommand_Success, packageIdentity.ToString())); 158logger.LogMinimal(Environment.NewLine + Strings.VerifyCommand_Failed);
NuGet.Common (15)
EnvironmentVariableWrapper.cs (1)
18return Environment.GetEnvironmentVariable(variable);
Migrations\Migration1.cs (6)
61var homePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); 106var home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); 117var home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
Migrations\MigrationRunner.cs (4)
92return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "NuGet", "Migrations"); 98? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".local", "share", "NuGet", "Migrations")
PathUtil\NuGetEnvironment.cs (4)
52RuntimeEnvironmentHelper.IsLinux ? "NuGetScratch" + Environment.UserName : "NuGetScratch"); 295return EnvironmentVariableReader.GetEnvironmentVariable(DotNetHome) ?? Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); 392/// Since <see cref="Environment.SpecialFolder"/> is not available on .NET Core, we have to
NuGet.Configuration (3)
Settings\Settings.cs (1)
677return Environment.ExpandEnvironmentVariables(value);
Utility\XElementUtility.cs (2)
31var parentIndent = leadingText != null ? leadingText.Value : Environment.NewLine; 79var indentString = textBeforeOrNull.Value.Trim(Environment.NewLine.ToCharArray());
NuGet.DependencyResolver.Core (2)
src\nuget-client\build\Shared\TaskResultCache.cs (2)
46_cache = new(concurrencyLevel: Environment.ProcessorCount, capacity); 47_perTaskLock = new(concurrencyLevel: Environment.ProcessorCount, capacity);
NuGet.PackageManagement (8)
NuGetPackageManager.cs (5)
1108nuGetProjectContext.Log(MessageLevel.Info, Environment.NewLine); 1842nuGetProjectContext.Log(NuGet.ProjectManagement.MessageLevel.Info, Environment.NewLine); 2372nuGetProjectContext.Log(NuGet.ProjectManagement.MessageLevel.Info, Environment.NewLine); 2716$"{Environment.NewLine}{string.Join(Environment.NewLine, errors.Select(e => e.FormatWithCode()))}");
PackageManagementConstants.cs (1)
13public static readonly int DefaultMaxDegreeOfParallelism = Environment.ProcessorCount;
Utility\XElementExtensions.cs (2)
267var parentIndent = leadingText != null ? leadingText.Value : Environment.NewLine; 350var indentString = textBeforeOrNull.Value.Trim(Environment.NewLine.ToCharArray());
NuGet.Packaging (10)
PackageCreation\Authoring\Manifest.cs (1)
287string message = String.Join(Environment.NewLine, results);
PackageCreation\Authoring\PackageBuilder.cs (2)
1002if (warningMessage.Length > Environment.NewLine.Length) 1004warningMessage.Length -= Environment.NewLine.Length;
Signing\Signatures\AuthorPrimarySignature.cs (1)
32issues.Add(SignatureLog.MinimalLog(Environment.NewLine +
Signing\Signatures\RepositoryCountersignature.cs (1)
98issues.Add(SignatureLog.MinimalLog(Environment.NewLine +
Signing\Signatures\RepositoryPrimarySignature.cs (1)
37issues.Add(SignatureLog.MinimalLog(Environment.NewLine +
Signing\Signatures\Signature.cs (1)
159$"{Environment.NewLine}")));
Signing\Timestamp\Timestamp.cs (2)
131issues.Add(SignatureLog.InformationLog(string.Format(CultureInfo.CurrentCulture, Strings.TimestampValue, GeneralizedTime.LocalDateTime.ToString(CultureInfo.CurrentCulture)) + Environment.NewLine)); 136$"{Environment.NewLine}{CertificateUtility.X509Certificate2ToString(timestamperCertificate, fingerprintAlgorithm)}")));
StringFormatter.cs (1)
42return Strings.ZipFileTimeStampModifiedWarning + Environment.NewLine + listOfFileTimeStampModifiedMessages;
NuGet.Protocol (15)
HttpSource\HttpRetryHandler.cs (1)
289+ Environment.NewLine
HttpSource\HttpSource.cs (1)
112+ Environment.NewLine
NuGetTestMode.cs (1)
24var testMode = Environment.GetEnvironmentVariable(_testModeEnvironmentVariableName);
Plugins\Logging\MachineLogMessage.cs (1)
16_logicalProcessorCount = Environment.ProcessorCount;
Plugins\Logging\PluginLogger.cs (1)
45_logDirectoryPath = Environment.CurrentDirectory;
Providers\RepositorySignatureResourceProvider.cs (1)
112+ Environment.NewLine
Providers\ServiceIndexResourceV3Provider.cs (1)
168+ Environment.NewLine
RemoteRepositories\HttpFileSystemBasedFindPackageByIdResource.cs (1)
550+ Environment.NewLine
RemoteRepositories\RemoteV2FindPackageByIdResource.cs (1)
549+ Environment.NewLine
Resources\PackageUpdateResource.cs (1)
498+ Environment.NewLine
src\nuget-client\build\Shared\TaskResultCache.cs (2)
46_cache = new(concurrencyLevel: Environment.ProcessorCount, capacity); 47_perTaskLock = new(concurrencyLevel: Environment.ProcessorCount, capacity);
Utility\FindPackagesByIdNupkgDownloader.cs (2)
299+ Environment.NewLine 323+ Environment.NewLine
Utility\GetDownloadResultUtility.cs (1)
117+ Environment.NewLine
PresentationBuildTasks (2)
MS\Internal\Tasks\TaskHelper.cs (2)
52log.LogMessage(MessageImportance.Low,Environment.NewLine); 55log.LogMessage(MessageImportance.Low, Environment.NewLine);
PresentationCore (92)
MS\Internal\AppModel\SiteOfOriginContainer.cs (2)
47Environment.CurrentManagedThreadId + 182Environment.CurrentManagedThreadId +
MS\Internal\AppModel\SiteOfOriginPart.cs (9)
51Environment.CurrentManagedThreadId + 63Environment.CurrentManagedThreadId + 91Environment.CurrentManagedThreadId + 107Environment.CurrentManagedThreadId + 121Environment.CurrentManagedThreadId + 134Environment.CurrentManagedThreadId + 160Environment.CurrentManagedThreadId + 184Environment.CurrentManagedThreadId + 194Environment.CurrentManagedThreadId +
MS\Internal\DpiUtil\DpiUtil+ProcessDpiAwarenessHelper.cs (1)
98windowThreadProcessId = Environment.ProcessId;
MS\Internal\FontCache\FamilyCollection.cs (1)
153OperatingSystem osInfo = Environment.OSVersion;
MS\Internal\FontCache\FontCacheUtil.cs (1)
302string s = Environment.GetEnvironmentVariable(WinDir) + @"\Fonts\";
System\IO\Packaging\PackWebRequest.cs (3)
82Environment.CurrentManagedThreadId + ": " + 154Environment.CurrentManagedThreadId + ": " + 170Environment.CurrentManagedThreadId + ": " +
System\IO\Packaging\PackWebRequestFactory.cs (3)
66Environment.CurrentManagedThreadId + ": " + 105Environment.CurrentManagedThreadId + ": " + 118Environment.CurrentManagedThreadId + ": " +
System\IO\Packaging\PackWebResponse.cs (22)
68Environment.CurrentManagedThreadId + ": " + 91Environment.CurrentManagedThreadId + ": " + 101Environment.CurrentManagedThreadId + ": " + 135Environment.CurrentManagedThreadId + ": " + 174Environment.CurrentManagedThreadId + ": " + 196Environment.CurrentManagedThreadId + ": " + 486Environment.CurrentManagedThreadId + ": " + 507Environment.CurrentManagedThreadId + ": " + 520Environment.CurrentManagedThreadId + ": " + 543Environment.CurrentManagedThreadId + ": " + 602Environment.CurrentManagedThreadId + ": " + 619Environment.CurrentManagedThreadId + ": " + 628Environment.CurrentManagedThreadId + ": " + 646Environment.CurrentManagedThreadId + ": " + 659Environment.CurrentManagedThreadId + ": " + 670Environment.CurrentManagedThreadId + ": " + 770Environment.CurrentManagedThreadId + ": " + 792Environment.CurrentManagedThreadId + ": " + 807Environment.CurrentManagedThreadId + ": " + 836Environment.CurrentManagedThreadId + ": " + 878Environment.CurrentManagedThreadId + ": " + 893Environment.CurrentManagedThreadId + ": " +
System\Windows\Automation\Peers\AutomationPeer.cs (2)
1456return new int [] { 7, Environment.ProcessId, this.GetHashCode() }; 2484private static object GetCurrentProcessId(AutomationPeer peer) { return Environment.ProcessId; }
System\Windows\Diagnostics\VisualDiagnostics.cs (1)
225value = Environment.GetEnvironmentVariable(environmentVariable);
System\Windows\Input\KeyboardDevice.cs (1)
264int timeStamp = Environment.TickCount ;
System\Windows\Input\ManipulationLogic.cs (1)
414ManipulationStartingEventArgs starting = new ManipulationStartingEventArgs(_manipulationDevice, Environment.TickCount)
System\Windows\Input\MouseDevice.cs (3)
277int timeStamp = Environment.TickCount; 881int timeStamp = Environment.TickCount; 932int timeStamp = Environment.TickCount;
System\Windows\Input\Stylus\Common\DynamicRenderer.cs (1)
262Environment.TickCount, GetCurrentHostVisual());
System\Windows\Input\Stylus\Common\DynamicRendererThreadManager.cs (1)
240if (__inkingDispatcher != null && !Environment.HasShutdownStarted)
System\Windows\Input\Stylus\Common\MultiTouchSystemGestureLogic.cs (3)
63_firstDownTime = Environment.TickCount; 86_firstUpTime = Environment.TickCount; 185int now = Environment.TickCount;
System\Windows\Input\Stylus\Pointer\PointerInteractionEngine.cs (3)
312Environment.TickCount, 349Environment.TickCount, 442Environment.TickCount,
System\Windows\Input\Stylus\Pointer\PointerStylusDevice.cs (4)
528int timeStamp = Environment.TickCount; 626int timeStamp = Environment.TickCount; 787_lastEventTimeTicks = Environment.TickCount; 839Environment.TickCount,
System\Windows\Input\Stylus\Wisp\PenThreadWorker.cs (8)
151Debug.WriteLine("WorkerOperationGetTabletsInfo.OnDoWork failed due to: {0}{1}", Environment.NewLine, e.ToString()); 198result.CommHandle = Environment.Is64BitProcess ? (nint)commHandle : (int)commHandle; 207Debug.WriteLine("WorkerOperationCreateContext.OnDoWork failed due to a {0}{1}", Environment.NewLine, e.ToString()); 314Debug.WriteLine("WorkerOperationRefreshCursorInfo.OnDoWork failed due to a {0}{1}", Environment.NewLine, e.ToString()); 356Debug.WriteLine("WorkerOperationGetTabletInfo.OnDoWork failed due to {0}{1}", Environment.NewLine, e.ToString()); 396Debug.WriteLine("WorkerOperationWorkerGetUpdatedSizes.OnDoWork failed due to a {0}{1}", Environment.NewLine, e.ToString()); 799int timestamp = Environment.TickCount; 1252penContext.FirePenOutOfRange(0, Environment.TickCount);
System\Windows\Input\Stylus\Wisp\WispLogic.cs (3)
917_lastInRangeTime = Environment.TickCount; 1007_lastInRangeTime = Environment.TickCount; 1012_lastInRangeTime = Environment.TickCount;
System\Windows\Input\Stylus\Wisp\WispStylusDevice.cs (2)
223int timeStamp = Environment.TickCount; 334int timeStamp = Environment.TickCount;
System\Windows\Input\Stylus\Wisp\WispTabletDeviceCollection.cs (1)
82bool runningOnVista = (Environment.OSVersion.Version.Major >= VistaMajorVersion);
System\Windows\Input\TextCompositionEventArgs.cs (1)
27public TextCompositionEventArgs(InputDevice inputDevice, TextComposition composition) : base(inputDevice, Environment.TickCount)
System\Windows\Input\TextServicesContext.cs (1)
110if (!appDomainShutdown || System.Environment.OSVersion.Version.Major >= 6)
System\Windows\Input\Touch.cs (1)
40TouchFrameEventArgs args = new TouchFrameEventArgs(Environment.TickCount);
System\Windows\Input\TouchDevice.cs (1)
939TouchEventArgs touchEventArgs = new TouchEventArgs(this, Environment.TickCount)
System\Windows\InterOp\HwndPointerInputProvider.cs (5)
410handled = ProcessMessage(GetPointerId(wParam), RawStylusActions.InRange, Environment.TickCount); 415handled = ProcessMessage(GetPointerId(wParam), RawStylusActions.Move, Environment.TickCount); 420handled = ProcessMessage(GetPointerId(wParam), RawStylusActions.Down, Environment.TickCount); 425handled = ProcessMessage(GetPointerId(wParam), RawStylusActions.Up, Environment.TickCount); 433handled = ProcessMessage(GetPointerId(wParam), RawStylusActions.OutOfRange, Environment.TickCount);
System\Windows\InterOp\HwndTarget.cs (3)
159/// identified by <see cref="Environment.UserInteractive"/>. 163/// <see cref="Environment.UserInteractive"/>, and (b) a registry override that requests 529else if (processId != Environment.ProcessId)
System\Windows\Interop\OperatingSystemVersionCheck.cs (1)
49OperatingSystem os = Environment.OSVersion;
System\Windows\Media\MediaContext.cs (1)
173!Environment.UserInteractive ? // IF DisplayDevicesNotAvailable && IsNonInteractiveWindowStation/IsService...
System\Windows\MouseOverProperty.cs (1)
46MouseEventArgs mouseEventArgs = new MouseEventArgs(Mouse.PrimaryDevice, Environment.TickCount, Mouse.PrimaryDevice.StylusDevice)
System\Windows\StylusOverProperty.cs (1)
38StylusEventArgs stylusEventArgs = new StylusEventArgs(Stylus.CurrentStylusDevice, Environment.TickCount)
PresentationFramework (23)
Microsoft\Win32\CommonDialog.cs (2)
57if (!Environment.UserInteractive) 128if (!Environment.UserInteractive)
System\Windows\Application.cs (1)
2189System.Environment.ExitCode = exitCode;
System\Windows\Controls\ScrollViewer.cs (2)
1766_panningInfo.InertiaBoundaryBeginTimestamp = Environment.TickCount; 1841if (Math.Abs(Environment.TickCount - _panningInfo.InertiaBoundaryBeginTimestamp) < PanningInfo.InertiaBoundryMinimumTicks)
System\Windows\Controls\VirtualizingStackPanel.cs (2)
9077int totalMilliseconds = Environment.TickCount - startTickCount; 9387int startMilliseconds = Environment.TickCount;
System\Windows\Controls\WebBrowser.cs (1)
751Version osver = Environment.OSVersion.Version;
System\windows\Documents\TextEditor.cs (1)
1225int endOfFirstLine = textData.IndexOf(Environment.NewLine, StringComparison.Ordinal);
System\windows\Documents\TextEditorTyping.cs (2)
1134string filteredText = This._FilterText(Environment.NewLine, This.Selection); 1138This.Selection.Text = Environment.NewLine;
System\Windows\Documents\TextFindEngine.cs (1)
473if (System.Environment.OSVersion.Version.Major >= 6)
System\Windows\Documents\TextRangeBase.cs (4)
694textBuffer.Append(Environment.NewLine); 715textBuffer.Append(Environment.NewLine); 781textBuffer.Append(Environment.NewLine); 787textBuffer.Append(Environment.NewLine);
System\Windows\Documents\TextServicesHost.cs (1)
372if (_thread == Thread.CurrentThread || System.Environment.OSVersion.Version.Major >= 6)
System\Windows\Documents\TextStore.cs (2)
1491if (!(nextChars[0] == Environment.NewLine[0] && nextChars[1] == Environment.NewLine[1]))
System\Windows\Interop\HwndHost.cs (1)
1043(idWindowProcess == Environment.ProcessId))
System\Windows\Standard\Utilities.cs (1)
22private static readonly Version _osVersion = Environment.OSVersion.Version;
System\Windows\StartupEventArgs.cs (1)
55string[] args = Environment.GetCommandLineArgs();
System\Windows\SystemParameters.cs (1)
1183if (System.Environment.OSVersion.Version.Major >= 6)
PresentationUI (2)
MS\Internal\Documents\RightsManagementManager.cs (2)
856string systemPath = Environment.GetFolderPath(Environment.SpecialFolder.System);
RepoTasks (19)
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (1)
1042return string.Join(Environment.NewLine, description);
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
26private static readonly string MacOSUserKeychain = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + "/Library/Keychains/login.keychain-db"; 34private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https");
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (14)
62if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable(OpenSslCertDirectoryOverrideVariableName))) 102var sslCertDirString = Environment.GetEnvironmentVariable(OpenSslCertificateDirectoryVariableName); 137var nssDbs = GetNssDbs(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)); 233var homeDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); 367var existingSslCertDir = Environment.GetEnvironmentVariable(OpenSslCertificateDirectoryVariableName); 464var homeDirectory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)!; 593var searchPath = Environment.GetEnvironmentVariable("PATH"); 653if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("WSL_INTEROP"))) 806var @override = Environment.GetEnvironmentVariable(OpenSslCertDirectoryOverrideVariableName); 832var nssDbOverride = Environment.GetEnvironmentVariable(NssDbOverrideVariableName); 879Log.UnixHomeDirectoryDoesNotExist(homeDirectory, Environment.UserName);
Roslyn.Diagnostics.Analyzers (29)
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (2)
99var parentPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
58if (Environment.OSVersion.Platform == PlatformID.Win32NT)
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringTable.cs (3)
67private int _localRandom = Environment.TickCount; 70private static int s_sharedRandom = Environment.TickCount; 90var pool = new ObjectPool<StringTable>(pool => new StringTable(pool), Environment.ProcessorCount * 2);
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
72: this(factory, Environment.ProcessorCount * 2, trimOnFree, trackLeaks, filePath, lineNumber)
src\roslyn\src\Dependencies\PooledObjects\PoolTracker.cs (1)
121_outstanding.TryAdd(obj, new AllocationInfo(obj.GetType(), poolName, _traceLeaks ? Environment.StackTrace : null));
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (5)
36/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 54/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 214/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 232/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 374private static int DefaultDegreeOfParallelism => Environment.ProcessorCount;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (1)
173foreach (var line in child.ToString().Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingOptions2.cs (1)
47_ => Environment.NewLine
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\LineFormattingOptions.cs (1)
19[DataMember] public string NewLine { get; init; } = Environment.NewLine;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Log\Logger.LogBlock.cs (3)
17private static readonly ObjectPool<RoslynLogBlock> s_pool = new(() => new RoslynLogBlock(s_pool!), Math.Min(Environment.ProcessorCount * 8, 256)); 49_tick = Environment.TickCount; 66var delta = Environment.TickCount - _tick;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
285: reason + Environment.NewLine + restString;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (3)
47/// The <see cref="Environment.CurrentManagedThreadId" /> of the thread that holds the lock. Zero if no thread is holding 193return _owningThreadId == Environment.CurrentManagedThreadId; 204_owningThreadId = Environment.CurrentManagedThreadId;
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
91var newLine = Environment.NewLine;
rzc (28)
ConnectionHost.cs (1)
63if (Environment.Is64BitProcess || Memory.IsMemoryAvailable())
DebugMode.cs (1)
16Console.WriteLine("Waiting for debugger in pid: {0}", Environment.ProcessId);
DefaultRequestDispatcher.cs (1)
341var response = new ShutdownServerResponse(Environment.ProcessId);
DiscoverCommand.cs (1)
60ProjectDirectory.Values.Add(Environment.CurrentDirectory);
GenerateCommand.cs (1)
132ProjectDirectory.Values.Add(Environment.CurrentDirectory);
Json\Assumed.cs (2)
151=> ThrowHelper.ThrowInvalidOperationException(message + Environment.NewLine + Strings.FormatFile_0_Line_1(path, line)); 156=> ThrowHelper.ThrowInvalidOperationException<T>(message + Environment.NewLine + Strings.FormatFile_0_Line_1(path, line));
PipeName.cs (1)
34var userName = Environment.UserName;
ServerCommand.cs (5)
147var processId = Environment.ProcessId; 159var content = $"{processId}{Environment.NewLine}rzc{Environment.NewLine}{rzcPath}{Environment.NewLine}{Pipe.Value()}"; 169var path = Environment.GetEnvironmentVariable("DOTNET_BUILD_PIDFILE_DIRECTORY");
ServerProtocol\ServerConnection.cs (8)
57var tmp = Environment.GetEnvironmentVariable("TMP"); 63var temp = Environment.GetEnvironmentVariable("TEMP"); 82var userProfile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); 88return Environment.GetEnvironmentVariable("SYSTEMROOT"); 281var expectedPath = Environment.GetEnvironmentVariable("DOTNET_HOST_PATH"); 288expectedPath = System.Environment.ProcessPath; 301var paths = Environment.GetEnvironmentVariable("PATH").Split(Path.PathSeparator);
ServerProtocol\ServerLogger.cs (4)
37var loggingFileName = Environment.GetEnvironmentVariable(EnvironmentVariable); 113GetCurrentProcessId(), Environment.CurrentManagedThreadId, Environment.TickCount); 128Environment.ProcessId;
src\sdk\src\Common\CliFolderPathCalculatorCore.cs (3)
17: this(Environment.GetEnvironmentVariable) 59home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
sdk-tasks (1)
EnvironmentVariableFilter.cs (1)
36var allEnvironmentVariableNames = Environment
Security.TransportSecurity.IntegrationTests (4)
Negotiate\NegotiateStream_Http_Tests.4.1.0.cs (1)
84if (Environment.Version.Major == 5 && !OSID.AnyWindows.MatchesCurrent() && !TestProperties.GetProperty(TestProperties.ServiceUri_PropertyName).Contains("/"))
Tcp\ClientCredentialTypeCertificateCanonicalNameTests.4.1.0.cs (3)
87errorBuilder.AppendFormat("Exception message: {0}{1}", Environment.NewLine, exception.Message); 164errorBuilder.AppendFormat("Exception message: {0}{1}", Environment.NewLine, exception.Message); 248errorBuilder.AppendFormat("Exception message: {0}{1}", Environment.NewLine, exception.Message);
Shared.Tests (1)
JsonSchemaExporter\SchemaTestHelpers.cs (1)
47{string.Join(Environment.NewLine, errors)}
Stress.ApiService (3)
Program.cs (3)
153var urls = Environment.GetEnvironmentVariable("ASPNETCORE_URLS")!.Split(';'); 227new KeyValuePair<string, object?>("Tid", Environment.CurrentManagedThreadId), 228new KeyValuePair<string, object?>("Pid", Environment.ProcessId),
Stress.AppHost (3)
Program.cs (3)
139builder.AddExecutable("executableWithSingleArg", "dotnet", Environment.CurrentDirectory, "--version"); 140builder.AddExecutable("executableWithSingleEscapedArg", "dotnet", Environment.CurrentDirectory, "one two"); 141builder.AddExecutable("executableWithMultipleArgs", "dotnet", Environment.CurrentDirectory, "--version", "one two");
SuperFileCheck (4)
Program.cs (4)
366return String.Join(Environment.NewLine, methodDecl.GetText().Lines.Select(x => TransformLine(x, checkPrefixes))); 552Console.Write(Environment.NewLine); 555Console.Write(Environment.NewLine); 557Console.Write(Environment.NewLine);
System.CodeDom (4)
Microsoft\CSharp\CSharpCodeGenerator.cs (1)
151b.Append(Environment.NewLine);
Microsoft\VisualBasic\VBCodeGenerator.cs (1)
364b.Append(Environment.NewLine);
System\CodeDom\Compiler\Executor.cs (2)
25ExecWaitWithCapture(userToken, cmd, Environment.CurrentDirectory, tempFiles, ref outputName, ref errorName); 31ExecWaitWithCapture(IntPtr.Zero, cmd, Environment.CurrentDirectory, tempFiles, ref outputName, ref errorName);
System.Collections.Concurrent (12)
System\Collections\Concurrent\BlockingCollection.cs (3)
954startTime = unchecked((uint)Environment.TickCount); 1099uint elapsedMilliseconds = unchecked((uint)Environment.TickCount - startTime); 1356startTime = unchecked((uint)Environment.TickCount);
System\Collections\Concurrent\ConcurrentBag.cs (6)
154int currentThreadId = Environment.CurrentManagedThreadId; 693_ownerThreadId = Environment.CurrentManagedThreadId; 718Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId); 838Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId); 855Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId); 930Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId);
System\Collections\Concurrent\PartitionerStatic.cs (3)
186long rangeSize = (long)(range / (Environment.ProcessorCount * CoreOversubscriptionRate)); 240int rangeSize = (int)(range / (Environment.ProcessorCount * CoreOversubscriptionRate)); 581int fillBufferMultiplier = (Environment.ProcessorCount > 4) ? 4 : 1;
System.CommandLine (7)
Completions\CompletionAction.cs (1)
37Environment.NewLine,
EnvironmentVariablesDirective.cs (1)
64Environment.SetEnvironmentVariable(variable.ToString(), value);
LocalizationResources.cs (4)
223value, commandAlias, expectedType, Environment.NewLine + string.Join(Environment.NewLine, completions)); 236value, optionAlias, expectedType, Environment.NewLine + string.Join(Environment.NewLine, completions));
RootCommand.cs (1)
77public static string ExecutablePath => _executablePath ??= Environment.GetCommandLineArgs()[0];
System.CommandLine.StaticCompletions (1)
ShellName.cs (1)
32var shellPath = Environment.GetEnvironmentVariable("SHELL") ?? throw new InvalidOperationException(Strings.ShellDiscovery_ShellEnvironmentNotSet);
System.Configuration.ConfigurationManager (4)
System\Configuration\ClientConfigPaths.cs (4)
155string roamingFolderPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); 162string localFolderPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
System.Console (7)
src\runtime\src\libraries\Common\src\System\Console\ConsoleUtils.cs (3)
46if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("FORCE_COLOR")) || 47!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION"))) 53if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("NO_COLOR")))
src\runtime\src\libraries\Common\src\System\Text\EncodingHelper.Unix.cs (1)
39locale = Environment.GetEnvironmentVariable(envVar);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (1)
54string? userHomeDirectory = Environment.GetEnvironmentVariable("HOME");
System\TermInfo.DatabaseFactory.cs (2)
36=> Environment.GetEnvironmentVariable("TERMINFO"); 42string? term = Environment.GetEnvironmentVariable("TERM");
System.Data.Common (1)
src\runtime\src\libraries\Common\src\System\LocalAppContextSwitches.Common.cs (1)
60if (Environment.GetEnvironmentVariable(envVariable) is string str)
System.Data.Odbc (4)
src\runtime\src\libraries\Common\src\System\Data\ProviderBase\DbConnectionFactory.cs (1)
26private static readonly Task<DbConnectionInternal?>[] s_pendingOpenNonPooled = new Task<DbConnectionInternal?>[Environment.ProcessorCount];
System\Data\Odbc\OdbcConnection.cs (1)
568throw new DllNotFoundException(SR.Odbc_UnixOdbcNotFound + Environment.NewLine + e.Message);
System\Data\Odbc\OdbcException.cs (1)
23builder.Append(Environment.NewLine);
System\Data\Odbc\OdbcInfoMessageEvent.cs (1)
31if (0 < builder.Length) { builder.Append(Environment.NewLine); }
System.Data.OleDb (28)
OleDb_Util.cs (18)
29builder.Append(Environment.NewLine); 34builder.Append(Environment.NewLine); 39builder.Append(Environment.NewLine); 44builder.Append(Environment.NewLine); 53builder.Append(Environment.NewLine); 74builder.Append(Environment.NewLine); 79builder.Append(Environment.NewLine); 117{ builder.Append(Environment.NewLine); } 122{ builder.Append(Environment.NewLine); } 127{ builder.Append(Environment.NewLine); } 132{ builder.Append(Environment.NewLine); } 137{ builder.Append(Environment.NewLine); } 142{ builder.Append(Environment.NewLine); } 147{ builder.Append(Environment.NewLine); } 152{ builder.Append(Environment.NewLine); } 157{ builder.Append(Environment.NewLine); } 162{ builder.Append(Environment.NewLine); } 342message = FailedGetDescription(hr) + Environment.NewLine + ODB.ELookup(hresult);
OleDbConnectionInternal.cs (1)
72if (constr.PossiblePrompt && !System.Environment.UserInteractive)
OleDbException.cs (3)
84builder.Append(Environment.NewLine); 91builder.Append(Environment.NewLine); 116builder.Append(Environment.NewLine);
OleDbStruct.cs (3)
49builder.Append("tagDBPARAMBINDINFO_x86").Append(Environment.NewLine); 52builder.Append("pwszDataSourceType =").Append(Marshal.PtrToStringUni(pwszDataSourceType)).Append(Environment.NewLine); 77builder.Append("tagDBPARAMBINDINFO").Append(Environment.NewLine);
System\Data\Common\AdapterUtil.cs (2)
926internal static readonly bool IsWindowsNT = (PlatformID.Win32NT == Environment.OSVersion.Platform); 927internal static readonly bool IsPlatformNT5 = (ADP.IsWindowsNT && (Environment.OSVersion.Version.Major >= 5));
System\Data\ProviderBase\DbConnectionFactory.cs (1)
26private static readonly Task<DbConnectionInternal?>[] s_pendingOpenNonPooled = new Task<DbConnectionInternal?>[Environment.ProcessorCount];
System.Diagnostics.DiagnosticSource (7)
src\runtime\src\libraries\Common\src\System\LocalAppContextSwitches.Common.cs (1)
60if (Environment.GetEnvironmentVariable(envVariable) is string str)
System\Diagnostics\LocalAppContextSwitches.cs (1)
18string? switchValue = Environment.GetEnvironmentVariable("DOTNET_SYSTEM_DIAGNOSTICS_DEFAULTACTIVITYIDFORMATISHIERARCHIAL");
System\Diagnostics\Metrics\CounterAggregator.cs (1)
21private readonly PaddedDouble[] _deltas = new PaddedDouble[Math.Min(Environment.ProcessorCount, 8)];
System\Diagnostics\Metrics\RuntimeMetrics.cs (4)
40() => Environment.WorkingSet, 145() => (long)Environment.ProcessorCount, 179Environment.ProcessCpuUsage processCpuUsage = Environment.CpuUsage;
System.Diagnostics.EventLog (4)
src\runtime\src\libraries\Common\src\System\Diagnostics\NetFrameworkUtils.cs (2)
146string versionPrefix = "v" + Environment.Version.Major + "." + Environment.Version.Minor;
System\Diagnostics\Reader\EventLogWatcher.cs (2)
109if (_callbackThreadId != Environment.CurrentManagedThreadId) 211_callbackThreadId = Environment.CurrentManagedThreadId;
System.Diagnostics.PerformanceCounter (8)
misc\EnvironmentHelpers.cs (3)
21if (Environment.OSVersion.Version.Major < 6 || (Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor <= 1))
src\runtime\src\libraries\Common\src\System\Diagnostics\NetFrameworkUtils.cs (2)
146string versionPrefix = "v" + Environment.Version.Major + "." + Environment.Version.Minor;
System\Diagnostics\PerformanceCounterLib.cs (3)
1201processStartInfo.WorkingDirectory = Environment.SystemDirectory; 1204processStartInfo.FileName = Environment.SystemDirectory + "\\unlodctr.exe"; 1206processStartInfo.FileName = Environment.SystemDirectory + "\\lodctr.exe";
System.Diagnostics.Process (17)
System\Diagnostics\Process.cs (2)
1023private bool IsCurrentProcess => _processId == Environment.ProcessId; 1033return new Process(".", false, Environment.ProcessId, null);
System\Diagnostics\Process.Linux.cs (4)
22get => IsCurrentProcess ? Environment.CpuUsage.PrivilegedTime : TicksToTimeSpan(GetStat().stime); 100return Environment.CpuUsage.TotalTime; 117get => IsCurrentProcess ? Environment.CpuUsage.UserTime : TicksToTimeSpan(GetStat().utime); 227return procPid == Interop.procfs.ProcPid.Self ? Environment.ProcessPath :
System\Diagnostics\Process.Multiplexing.cs (1)
689long remaining = deadline - Environment.TickCount64;
System\Diagnostics\Process.Multiplexing.Unix.cs (2)
54long deadline = timeoutMs >= 0 ? Environment.TickCount64 + timeoutMs : long.MaxValue; 284? Environment.TickCount64 + timeoutMs
System\Diagnostics\ProcessManager.Linux.cs (3)
191yield return Environment.ProcessId; 265if (pid == Environment.ProcessId) 298_procMatchesPidNamespace = !procSelfPid.HasValue || procSelfPid == Environment.ProcessId ? NullableBool.True : NullableBool.False;
System\Diagnostics\ProcessStartInfo.cs (1)
100IDictionary envVars = System.Environment.GetEnvironmentVariables();
System\Diagnostics\ProcessUtils.cs (1)
23string? pathEnvVar = System.Environment.GetEnvironmentVariable("PATH");
System\Diagnostics\ProcessUtils.Unix.cs (1)
348string? path = Environment.ProcessPath;
System\Diagnostics\ProcessWaitState.Unix.cs (2)
603Environment.FailFast("Error while reaping child. errno = " + errorCode); 649Environment.FailFast("Error while checking for terminated children. errno = " + errorCode);
System.Diagnostics.TextWriterTraceListener (3)
System\Diagnostics\XmlWriterTraceListener.cs (3)
20private readonly string _machineName = Environment.MachineName; 271InternalWrite((uint)Environment.ProcessId); 273InternalWrite((uint)Environment.CurrentManagedThreadId);
System.Diagnostics.TraceSource (9)
System\Diagnostics\DefaultTraceListener.cs (6)
106WriteLine(SR.DebugAssertBanner + Environment.NewLine 107+ SR.DebugAssertShortMessage + Environment.NewLine 108+ message + Environment.NewLine 109+ SR.DebugAssertLongMessage + Environment.NewLine 110+ detailMessage + Environment.NewLine 140Write(message + Environment.NewLine, useLogFile);
System\Diagnostics\TraceEventCache.cs (3)
31return Environment.ProcessId; 39return Environment.CurrentManagedThreadId.ToString(CultureInfo.InvariantCulture); 53public string Callstack => field ??= Environment.StackTrace;
System.DirectoryServices (5)
System\DirectoryServices\ActiveDirectory\DirectoryContext.cs (1)
685string systemPath = Environment.SystemDirectory;
System\DirectoryServices\ActiveDirectory\Exception.cs (2)
167return s + Environment.NewLine + SR.Format(SR.Name, Name) + Environment.NewLine;
System\DirectoryServices\ActiveDirectory\ReplicationCursor.cs (2)
74if ((Environment.OSVersion.Version.Major == 5) && (Environment.OSVersion.Version.Minor == 0))
System.DirectoryServices.AccountManagement (2)
System\DirectoryServices\AccountManagement\Context.cs (1)
75_serverName = Environment.MachineName;
System\DirectoryServices\AccountManagement\Utils.cs (1)
548string s = Environment.MachineName;
System.DirectoryServices.Protocols (1)
src\runtime\src\libraries\Common\src\System\LocalAppContextSwitches.Common.cs (1)
60if (Environment.GetEnvironmentVariable(envVariable) is string str)
System.Formats.Tar (3)
System\Formats\Tar\TarHeader.Write.cs (3)
1172$"{dirName}/PaxHeaders.{Environment.ProcessId}/{fileName}{Path.DirectorySeparatorChar}" : 1173$"{dirName}/PaxHeaders.{Environment.ProcessId}/{fileName}"; 1189string result = $"{tmp}/GlobalHead.{Environment.ProcessId}.{globalExtendedAttributesEntryNumber}";
System.IO.Compression (1)
System\IO\Compression\Zstandard\ZstandardUtils.cs (1)
18internal static int WindowLog_Max => Environment.Is64BitProcess ? 31 : 30; // 1GB or 2GB window, depending on platform
System.IO.IsolatedStorage (7)
System\IO\IsolatedStorage\Helper.cs (1)
129location = Environment.ProcessPath;
System\IO\IsolatedStorage\Helper.NonMobile.cs (6)
20Environment.SpecialFolder specialFolder = 21IsMachine(scope) ? Environment.SpecialFolder.CommonApplicationData : // e.g. C:\ProgramData 22IsRoaming(scope) ? Environment.SpecialFolder.ApplicationData : // e.g. C:\Users\Joe\AppData\Roaming 23Environment.SpecialFolder.LocalApplicationData; // e.g. C:\Users\Joe\AppData\Local 25string dataDirectory = Environment.GetFolderPath(specialFolder, Environment.SpecialFolderOption.Create);
System.IO.Pipes (3)
System\IO\Pipes\NamedPipeClientStream.cs (3)
130ConnectInternal(timeout, CancellationToken.None, Environment.TickCount); 163while (timeout == Timeout.Infinite || (elapsed = unchecked(Environment.TickCount - startTime)) < timeout); 196int startTime = Environment.TickCount; // We need to measure time here, not in the lambda
System.IO.Ports (8)
System\IO\Ports\SerialPort.cs (6)
771int startTicks = Environment.TickCount; 779timeUsed = Environment.TickCount - startTicks; 826int startTicks = Environment.TickCount; 876} while (timeout == InfiniteTimeout || (timeout - GetElapsedTime(Environment.TickCount, startTicks) > 0)); 1091timeNow = Environment.TickCount; 1093timeUsed += Environment.TickCount - timeNow;
System\IO\Ports\SerialStream.Unix.cs (2)
920ticksWhenIdleStarted = Environment.TickCount; 922else if (Environment.TickCount - ticksWhenIdleStarted > IOLoopIdleTimeout)
System.Linq (2)
System\Linq\Iterator.cs (2)
33private readonly int _threadId = Environment.CurrentManagedThreadId; 74Iterator<TSource> enumerator = _state == 0 && _threadId == Environment.CurrentManagedThreadId ? this : Clone();
System.Linq.AsyncEnumerable (2)
System\Linq\AsyncIterator.cs (2)
34private readonly int _threadId = Environment.CurrentManagedThreadId; 77AsyncIterator<TSource> enumerator = _state == 0 && _threadId == Environment.CurrentManagedThreadId ? this : Clone();
System.Linq.Parallel (3)
System\Linq\Parallel\Channels\AsynchronousChannel.cs (2)
207Environment.CurrentManagedThreadId); 221Environment.CurrentManagedThreadId);
System\Linq\Parallel\Scheduling\Scheduling.cs (1)
34internal static readonly int DefaultDegreeOfParallelism = Math.Min(Environment.ProcessorCount, MAX_SUPPORTED_DOP);
System.Management (8)
System\Management\InteropClasses\WMIInterop.cs (1)
1371OperatingSystem os = Environment.OSVersion;
System\Management\ManagementEventWatcher.cs (1)
626(string.Equals(eventWatcher.Scope.Path.Server, System.Environment.MachineName, StringComparison.OrdinalIgnoreCase)))
System\Management\ManagementScope.cs (4)
986if (Environment.OSVersion.Platform == PlatformID.Win32NT) 989if (((Environment.OSVersion.Version.Major == 5) && (Environment.OSVersion.Version.Minor >= 1)) || (Environment.OSVersion.Version.Major >= 6))
System\Management\WmiEventSink.cs (2)
79(string.Equals(this.path.Server, System.Environment.MachineName, StringComparison.OrdinalIgnoreCase))) 91(string.Equals(this.scope.Path.Server, System.Environment.MachineName, StringComparison.OrdinalIgnoreCase)))
System.Net.Http (36)
src\runtime\src\libraries\Common\src\System\LocalAppContextSwitches.Common.cs (1)
60if (Environment.GetEnvironmentVariable(envVariable) is string str)
src\runtime\src\libraries\Common\src\System\Net\Http\UriRedactionHelper.cs (1)
20string? envVar = Environment.GetEnvironmentVariable("DOTNET_SYSTEM_NET_HTTP_DISABLEURIREDACTION");
System\Net\Http\Headers\HeaderUtilities.cs (1)
336sb.Append(Environment.NewLine);
System\Net\Http\Headers\HttpHeaders.cs (1)
362builder.Append(Environment.NewLine);
System\Net\Http\HttpRequestMessage.cs (1)
167sb.Append(Environment.NewLine);
System\Net\Http\HttpResponseMessage.cs (2)
195sb.Append(Environment.NewLine); 201sb.Append(Environment.NewLine);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (3)
893return connection.GetLifetimeTicks(Environment.TickCount64) > pooledConnectionLifetime.TotalMilliseconds; 904return lifetime == TimeSpan.Zero || connection.GetLifetimeTicks(Environment.TickCount64) > lifetime.TotalMilliseconds; 982long nowTicks = Environment.TickCount64;
System\Net\Http\SocketsHttpHandler\FailedProxyCache.cs (7)
34private long _nextFlushTicks = Environment.TickCount64 + FlushFailuresTimerInMilliseconds; 44/// <returns>If the proxy can be used, <see cref="Immediate"/>. Otherwise, the next <see cref="Environment.TickCount64"/> that it should be used.</returns> 56if (Environment.TickCount64 < renewTicks) 78_failedProxies[uri] = Environment.TickCount64 + FailureTimeoutInMilliseconds; 96if (_failedProxies.Count > LargeProxyConfigBoundary && Environment.TickCount64 >= Interlocked.Read(ref _nextFlushTicks)) 122long curTicks = Environment.TickCount64; 136Interlocked.Exchange(ref _nextFlushTicks, Environment.TickCount64 + FlushFailuresTimerInMilliseconds);
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (3)
162_nextPingRequestTimestamp = Environment.TickCount64 + _keepAlivePingDelay; 2130_nextPingRequestTimestamp = Environment.TickCount64 + _keepAlivePingDelay; 2164long now = Environment.TickCount64;
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (1)
292GetIdleTicks(Environment.TickCount64) >= _keepAliveTimeoutSeconds * 1000;
System\Net\Http\SocketsHttpHandler\HttpConnectionBase.cs (3)
31private readonly long _creationTickCount = Environment.TickCount64; 102if (GlobalHttpSettings.MetricsHandler.IsGloballyEnabled) _connectionMetrics?.ConnectionClosed(durationMs: Environment.TickCount64 - _creationTickCount); 118_idleSinceTickCount = Environment.TickCount64;
System\Net\Http\SocketsHttpHandler\HttpEnvironmentProxy.Unix.cs (9)
21Uri? httpProxy = GetUriFromString(Environment.GetEnvironmentVariable(EnvHttpProxyLC)); 22if (httpProxy == null && Environment.GetEnvironmentVariable(EnvCGI) == null) 24httpProxy = GetUriFromString(Environment.GetEnvironmentVariable(EnvHttpProxyUC)); 27Uri? httpsProxy = GetUriFromString(Environment.GetEnvironmentVariable(EnvHttpsProxyLC)) ?? 28GetUriFromString(Environment.GetEnvironmentVariable(EnvHttpsProxyUC)); 32Uri? allProxy = GetUriFromString(Environment.GetEnvironmentVariable(EnvAllProxyLC)) ?? 33GetUriFromString(Environment.GetEnvironmentVariable(EnvAllProxyUC)); 47string? noProxy = Environment.GetEnvironmentVariable(EnvNoProxyLC) ?? 48Environment.GetEnvironmentVariable(EnvNoProxyUC);
System\Net\Http\SocketsHttpHandler\RuntimeSettingParser.cs (3)
25string? envVar = Environment.GetEnvironmentVariable(environmentVariableSettingName); 80string? envVar = Environment.GetEnvironmentVariable(environmentVariableSettingName); 94string? envVar = Environment.GetEnvironmentVariable(environmentVariableSettingName);
System.Net.Http.WinHttpHandler (4)
src\runtime\src\libraries\Common\src\System\Runtime\ExceptionServices\ExceptionStackTrace.cs (3)
24Environment.StackTrace + Environment.NewLine + 25"--- End of stack trace from AddCurrentStack ---" + Environment.NewLine;
System\Net\Http\WinHttpRequestCallback.cs (1)
39if (Environment.HasShutdownStarted)
System.Net.HttpListener (1)
src\runtime\src\libraries\Common\src\System\LocalAppContextSwitches.Common.cs (1)
60if (Environment.GetEnvironmentVariable(envVariable) is string str)
System.Net.NameResolution (1)
src\runtime\src\libraries\Common\src\System\LocalAppContextSwitches.Common.cs (1)
60if (Environment.GetEnvironmentVariable(envVariable) is string str)
System.Net.NetworkInformation (21)
src\runtime\src\libraries\Common\src\System\IO\RowConfigReader.cs (5)
88int endOfLine = _buffer.IndexOf(Environment.NewLine, afterKey, _comparisonKind); 135|| (keyIndex >= Environment.NewLine.Length && _buffer.AsSpan(keyIndex - Environment.NewLine.Length, Environment.NewLine.Length).SequenceEqual(Environment.NewLine)))
System\Net\NetworkInformation\StringParsingHelpers.Addresses.cs (3)
140int labelLineStart = fileContents.LastIndexOf(Environment.NewLine, labelIndex, StringComparison.Ordinal); 157labelLineStart = fileContents.LastIndexOf(Environment.NewLine, labelIndex, StringComparison.Ordinal); 159int endOfLine = fileContents.IndexOf(Environment.NewLine, labelIndex, StringComparison.Ordinal);
System\Net\NetworkInformation\StringParsingHelpers.Connections.cs (7)
17int endOfTcpLine = sockstatFile.IndexOf(Environment.NewLine, indexOfTcp + 1, StringComparison.Ordinal); 33v4connections = tcp4FileContents.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries); 43v6connections = tcp6FileContents.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries); 113v4connections = tcp4FileContents.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries); 123v6connections = tcp6FileContents.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries); 193v4connections = udp4FileContents.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries); 203v6connections = udp6FileContents.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries);
System\Net\NetworkInformation\StringParsingHelpers.Misc.cs (2)
66return routeFile.AsSpan().Count(Environment.NewLine) - 1; // File includes one-line header 92int endOfSecondLine = snmp4FileContents.IndexOf(Environment.NewLine, secondIpHeader, StringComparison.Ordinal);
System\Net\NetworkInformation\StringParsingHelpers.Statistics.cs (4)
182int endOfSecondLine = fileContents.IndexOf(Environment.NewLine, secondIpHeader, StringComparison.Ordinal); 269int endOfSecondLine = fileContents.IndexOf(Environment.NewLine, secondIpHeader, StringComparison.Ordinal); 336int endOfSecondLine = fileContents.IndexOf(Environment.NewLine, secondTcpHeader, StringComparison.Ordinal); 368int endOfSecondLine = fileContents.IndexOf(Environment.NewLine, secondUdpHeader, StringComparison.Ordinal);
System.Net.Ping (3)
src\runtime\src\libraries\Common\src\System\LocalAppContextSwitches.Common.cs (1)
60if (Environment.GetEnvironmentVariable(envVariable) is string str)
src\runtime\src\libraries\Common\src\System\Net\NetworkInformation\UnixCommandLinePing.cs (2)
104if (ipv4 || Environment.OSVersion.Version.Major > 12) 150if (ipv4 || (OperatingSystem.IsFreeBSD() && Environment.OSVersion.Version.Major > 12))
System.Net.Quic (4)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeX509Handles.Unix.cs (1)
14Environment.GetEnvironmentVariable("DEBUG_SAFEX509HANDLE_FINALIZATION") != null;
src\runtime\src\libraries\Common\src\System\LocalAppContextSwitches.Common.cs (1)
60if (Environment.GetEnvironmentVariable(envVariable) is string str)
src\runtime\src\libraries\Common\src\System\Net\Security\SslKeyLogger.cs (1)
11private static readonly string? s_keyLogFile = Environment.GetEnvironmentVariable("SSLKEYLOGFILE");
System\Net\Quic\Internal\MsQuicApi.cs (1)
204NotSupportedReason = $"Current Windows version ({Environment.OSVersion}) is not supported by QUIC. Minimal supported version is {s_minWindowsVersion}.";
System.Net.Requests (4)
System\Net\TimerThread.cs (4)
51_startTimeMilliseconds = Environment.TickCount; 387int nowMilliseconds = Environment.TickCount; 517int now = Environment.TickCount; 546int newNow = Environment.TickCount;
System.Net.Security (6)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (2)
43Environment.GetEnvironmentVariable("DOTNET_OPENSSL_FORCE_BIO_SPILL") == "1"; 133string? value = AppContext.GetData(TlsCacheSizeCtxName) as string ?? Environment.GetEnvironmentVariable(TlsCacheSizeEnvironmentVariable);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeX509Handles.Unix.cs (1)
14Environment.GetEnvironmentVariable("DEBUG_SAFEX509HANDLE_FINALIZATION") != null;
src\runtime\src\libraries\Common\src\System\LocalAppContextSwitches.Common.cs (1)
60if (Environment.GetEnvironmentVariable(envVariable) is string str)
src\runtime\src\libraries\Common\src\System\Net\Security\SslKeyLogger.cs (1)
11private static readonly string? s_keyLogFile = Environment.GetEnvironmentVariable("SSLKEYLOGFILE");
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (1)
57private static readonly byte[] s_workstation = Encoding.Unicode.GetBytes(Environment.MachineName);
System.Net.Sockets (15)
src\runtime\src\libraries\Common\src\System\LocalAppContextSwitches.Common.cs (1)
60if (Environment.GetEnvironmentVariable(envVariable) is string str)
System\Net\Sockets\SafeSocketHandle.cs (2)
164_closeSocketThread = Environment.CurrentManagedThreadId; 165_closeSocketTick = Environment.TickCount;
System\Net\Sockets\SocketAsyncContext.Unix.cs (2)
903Environment.FailFast("unexpected queue state"); 991Environment.FailFast("unexpected queue state");
System\Net\Sockets\SocketAsyncEngine.Unix.cs (7)
26internal static readonly bool InlineSocketCompletionsEnabled = Environment.GetEnvironmentVariable("DOTNET_SYSTEM_NET_SOCKETS_INLINE_COMPLETIONS") == "1"; 42if (uint.TryParse(Environment.GetEnvironmentVariable("DOTNET_SYSTEM_NET_SOCKETS_THREAD_COUNT"), out uint count)) 50return Environment.ProcessorCount; 58return Math.Max(1, (int)Math.Round(Environment.ProcessorCount / (double)coresPerEngine)); 237Environment.FailFast("Exception thrown from SocketAsyncEngine event loop: " + e.ToString(), e); 276int startTimeMs = Environment.TickCount; 293} while (Environment.TickCount - startTimeMs < 15 && eventQueue.TryDequeue(out ev));
System\Net\Sockets\SocketAsyncEventArgs.cs (1)
525if (!Environment.HasShutdownStarted)
System\Net\Sockets\SocketPal.Unix.cs (2)
970long start = socket.IsUnderlyingHandleBlocking && socket.SendTimeout > 0 ? Environment.TickCount64 : 0; // Get ticks only if timeout is set and socket is blocking. 1023if (socket.IsUnderlyingHandleBlocking && socket.SendTimeout > 0 && (Environment.TickCount64 - start) >= socket.SendTimeout)
System.Net.WebSockets (4)
System\Net\WebSockets\ManagedWebSocket.KeepAlive.cs (4)
70long now = Environment.TickCount64; 147NextPingRequestTimestamp = Environment.TickCount64 + DelayMs; 158NextPingRequestTimestamp = Environment.TickCount64 + DelayMs; 193PingTimeoutTimestamp = Environment.TickCount64 + TimeoutMs;
System.Private.CoreLib (216)
Internal\IntrinsicSupport\ComparerHelpers.cs (1)
88Environment.FailFast("Unable to create comparer");
Internal\IntrinsicSupport\EqualityComparerHelpers.cs (1)
101Environment.FailFast("Unable to create comparer");
Internal\Runtime\CompilerHelpers\StartupCode\StartupCodeHelpers.Extensions.cs (6)
30Environment.s_commandLineArgs = args; 40Environment.s_commandLineArgs = args; 46string[]? args = Environment.s_commandLineArgs; 60Environment.ExitCode = exitCode; 68Environment.ShutdownCore(); 70int exitCode = Environment.ExitCode;
src\runtime\src\libraries\Common\src\System\LocalAppContextSwitches.Common.cs (1)
60if (Environment.GetEnvironmentVariable(envVariable) is string str)
src\runtime\src\libraries\System.Private.CoreLib\src\Internal\Console.cs (3)
18Write(s + Environment.NewLineConst); 22Write(Environment.NewLineConst); 28Write(Environment.NewLineConst);
src\runtime\src\libraries\System.Private.CoreLib\src\System\AggregateException.cs (1)
376text.Append(Environment.NewLineConst + InnerExceptionPrefix);
src\runtime\src\libraries\System.Private.CoreLib\src\System\AppContext.AnyOS.cs (1)
22string? path = Environment.ProcessPath;
src\runtime\src\libraries\System.Private.CoreLib\src\System\AppContextConfigHelper.cs (9)
15string? str = Environment.GetEnvironmentVariable(envVariable); 33string? str = Environment.GetEnvironmentVariable("DOTNET_" + envVariable) 34?? Environment.GetEnvironmentVariable("COMPlus_" + envVariable); 96string? str = Environment.GetEnvironmentVariable(envVariable); 136string? str = Environment.GetEnvironmentVariable("DOTNET_" + envVariable) 137?? Environment.GetEnvironmentVariable("COMPlus_" + envVariable); 206string? str = Environment.GetEnvironmentVariable(envVariable); 246string? str = Environment.GetEnvironmentVariable("DOTNET_" + envVariable) 247?? Environment.GetEnvironmentVariable("COMPlus_" + envVariable);
src\runtime\src\libraries\System.Private.CoreLib\src\System\AppDomain.cs (2)
181SR.AppDomain_Name + FriendlyName + Environment.NewLineConst + SR.AppDomain_NoContextPolicies; 229public static int GetCurrentThreadId() => Environment.CurrentManagedThreadId;
src\runtime\src\libraries\System.Private.CoreLib\src\System\ArgumentOutOfRangeException.cs (1)
81return s + Environment.NewLineConst + valueMessage;
src\runtime\src\libraries\System.Private.CoreLib\src\System\BadImageFormatException.cs (5)
101s += Environment.NewLineConst + SR.Format(SR.IO_FileName_Name, _fileName); 104s += Environment.NewLineConst + SR.Format(SR.IO_FileLoad_RequestedBy, _requestingAssemblyChain); 110s += Environment.NewLineConst + StackTrace; 115s += Environment.NewLineConst + Environment.NewLineConst + _fusionLog;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\SharedArrayPool.cs (4)
191int currentMilliseconds = Environment.TickCount; 508/// <remarks>Defaults to int.MaxValue. Whatever value is returned will end up being clamped to <see cref="Environment.ProcessorCount"/>.</remarks> 514return Math.Min(partitionCount, Environment.ProcessorCount); 532if (Environment.GetEnvironmentVariableCore_NoArrayPool(variable) is string envVar &&
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentDictionary.cs (1)
2054private static int DefaultConcurrencyLevel => Environment.ProcessorCount;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\DebugProvider.cs (8)
36WriteLine(SR.DebugAssertBanner + Environment.NewLineConst 37+ SR.DebugAssertShortMessage + Environment.NewLineConst 38+ message + Environment.NewLineConst 39+ SR.DebugAssertLongMessage + Environment.NewLineConst 40+ detailMessage + Environment.NewLineConst 59if (message.EndsWith(Environment.NewLineConst, StringComparison.Ordinal)) 68Write(message + Environment.NewLineConst); 91s += Environment.NewLineConst;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\DebugProvider.Unix.cs (2)
8private static readonly bool s_shouldWriteToStdErr = Environment.GetEnvironmentVariable("DOTNET_DebugWriteToStdErr") == "1"; 28Environment.FailFast(ex.Message, ex, errorSource);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\ActivityTracker.cs (1)
492sumPtr[3] = (sumPtr[0] + sumPtr[1] + sumPtr[2] + 0x599D99AD) ^ (uint)Environment.ProcessId;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (2)
3344msg += Environment.NewLine; 3841Debugger.Log(0, null, $"EventSource Error: {msg}{Environment.NewLine}");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\RuntimeEventSource.cs (2)
80_workingSetCounter ??= new PollingCounter("working-set", this, () => ((double)Environment.WorkingSet / 1_000_000)) { DisplayName = "Working Set", DisplayUnits = "MB" }; 113ProcessorCount(Environment.ProcessorCount);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\RuntimeEventSourceHelper.Unix.cs (1)
11Interop.Sys.GetCpuUtilization(ref s_cpuInfo) / Environment.ProcessorCount;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Exception.cs (8)
142length += Environment.NewLineConst.Length + InnerExceptionPrefix.Length + innerExceptionString.Length + Environment.NewLineConst.Length + 3 + endOfInnerExceptionResource.Length; 146length += Environment.NewLineConst.Length + stackTrace.Length; 163Write(Environment.NewLineConst, ref resultSpan); 166Write(Environment.NewLineConst, ref resultSpan); 172Write(Environment.NewLineConst, ref resultSpan); 261_remoteStackTraceString = stackTrace + Environment.NewLineConst + SR.Exception_EndStackTraceFromPreviousThrow + Environment.NewLineConst;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CultureNotFoundException.cs (1)
103return s + Environment.NewLineConst + valueMessage;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\GlobalizationMode.cs (2)
53value = Environment.GetEnvironmentVariable(envVariable); 93Environment.FailFast($"Failed to load app-local ICU: {library}");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\GlobalizationMode.Unix.cs (1)
31Environment.FailFast(GetIcuLoadFailureMessage());
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Directory.cs (2)
260public static string GetCurrentDirectory() => Environment.CurrentDirectory; 266Environment.CurrentDirectory = Path.GetFullPath(path);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\DirectoryNotFoundException.cs (3)
59s += Environment.NewLineConst + SR.Format(SR.IO_DirectoryName_Name, DirectoryPath); 62s += Environment.NewLineConst + InnerExceptionPrefix + InnerException.ToString(); 65s += Environment.NewLineConst + StackTrace;
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\FileLoadException.cs (6)
56s += Environment.NewLineConst + SR.Format(SR.IO_FileName_Name, FileName); 59s += Environment.NewLineConst + SR.Format(SR.IO_FileLoad_RequestedBy, _requestingAssemblyChain); 62s += Environment.NewLineConst + InnerExceptionPrefix + InnerException.ToString(); 65s += Environment.NewLineConst + StackTrace; 70s += Environment.NewLineConst + Environment.NewLineConst + FusionLog;
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\FileNotFoundException.cs (6)
79s += Environment.NewLineConst + SR.Format(SR.IO_FileName_Name, FileName); 82s += Environment.NewLineConst + SR.Format(SR.IO_FileLoad_RequestedBy, _requestingAssemblyChain); 85s += Environment.NewLineConst + InnerExceptionPrefix + InnerException.ToString(); 88s += Environment.NewLineConst + StackTrace; 93s += Environment.NewLineConst + Environment.NewLineConst + FusionLog;
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Iterator.cs (2)
21_threadId = Environment.CurrentManagedThreadId; 42if (state == 0 && _threadId == Environment.CurrentManagedThreadId)
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Path.Unix.cs (1)
88string? path = Environment.GetEnvironmentVariable(TempEnvVar);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (1)
54string? userHomeDirectory = Environment.GetEnvironmentVariable("HOME");
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\SharedMemoryManager.Unix.cs (3)
24private static int SessionId { get; } = Interop.Sys.GetSid(Environment.ProcessId); 167nuint sharedDataTotalByteCount = AlignUp(sharedDataUsedByteCount, (nuint)Environment.SystemPageSize); 397string? applicationGroupId = Environment.GetEnvironmentVariable("DOTNET_SHARED_MEMORY_APPLICATION_GROUP_ID");
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\TextWriter.cs (6)
27private static readonly char[] s_coreNewLine = Environment.NewLineConst.ToCharArray(); 40private string CoreNewLineStr = Environment.NewLineConst; 117value ??= Environment.NewLineConst; 123value == Environment.NewLineConst ? s_coreNewLine : // current OS default 124Environment.NewLineConst == "\r\n" && value == "\n" ? (s_otherCoreNewLine ??= ['\n']) : // other OS default 125Environment.NewLineConst == "\n" && value == "\r\n" ? (s_otherCoreNewLine ??= ['\r', '\n']) : // other OS default
src\runtime\src\libraries\System.Private.CoreLib\src\System\ObjectDisposedException.cs (1)
100return base.Message + Environment.NewLineConst + objectDisposed;
src\runtime\src\libraries\System.Private.CoreLib\src\System\OperatingSystem.cs (1)
354Version current = Environment.OSVersion.Version;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\FileBasedResourceGroveler.cs (1)
44throw new MissingManifestResourceException($"{SR.MissingManifestResource_NoNeutralDisk}{Environment.NewLineConst}baseName: {_mediator.BaseNameField} fileName: {_mediator.GetResourceFileName(culture)}");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ManifestBasedResourceGroveler.cs (3)
467Debug.Fail("Couldn't get " + CoreLib.Name + ResourceManager.ResFileExtension + " from " + CoreLib.Name + "'s assembly" + Environment.NewLineConst + Environment.NewLineConst + "Are you building the runtime on your machine? Chances are the BCL directory didn't build correctly. Type 'build -c' in the BCL directory. If you get build errors, look at buildd.log. If you then can't figure out what's wrong (and you aren't changing the assembly-related metadata code), ask a BCL dev.\n\nIf you did NOT build the runtime, you shouldn't be seeing this and you've found a bug."); 471System.Environment.FailFast(MesgFailFast);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncProfiler.cs (1)
75string? eventBufferSizeEnv = System.Environment.GetEnvironmentVariable("DOTNET_AsyncProfilerEventSource_EventBufferSize");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\PoolingAsyncValueTaskMethodBuilderT.cs (4)
289private static readonly PaddedReference[] s_perCoreCache = new PaddedReference[Environment.ProcessorCount]; 358Debug.Assert(s_perCoreCache.Length == Environment.ProcessorCount, $"{s_perCoreCache.Length} != {Environment.ProcessorCount}"); 359int i = (int)((uint)Thread.GetCurrentProcessorId() % (uint)Environment.ProcessorCount);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\SwitchExpressionException.cs (1)
63return base.Message + Environment.NewLine + valueMessage;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\COMException.cs (1)
65s.Append(Environment.NewLineConst + InnerExceptionPrefix).Append(innerException.ToString());
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ExternalException.cs (2)
64s += Environment.NewLineConst + InnerExceptionPrefix + innerException.ToString(); 68s += Environment.NewLineConst + StackTrace;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NativeLibrary.Unix.cs (2)
51_errorMessage ??= Environment.NewLine; 54_errorMessage += message + Environment.NewLine;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\MemoryFailPoint.cs (2)
194long now = Environment.TickCount; // Handle wraparound. 370_stackTrace = Environment.StackTrace;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Versioning\VersioningHelper.cs (1)
53safeName.Append(Environment.ProcessId);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Security\SecurityElement.cs (4)
431write(obj, Environment.NewLineConst); 440write(obj, Environment.NewLineConst); 453write(obj, Environment.NewLineConst); 465write(obj, Environment.NewLineConst);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SR.cs (1)
71Environment.FailFast(message);
src\runtime\src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (4)
1472/// Replaces all newline sequences in the current string with <see cref="Environment.NewLine"/>. 1476/// with <see cref="Environment.NewLine"/>. 1492/// <see cref="Environment.NewLine"/> as the <em>replacementText</em> parameter. 1496public string ReplaceLineEndings() => ReplaceLineEndings(Environment.NewLineConst);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (2)
910public StringBuilder AppendLine() => Append(Environment.NewLine); 915return Append(Environment.NewLine);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenRegistration.cs (2)
52node.Registrations.ThreadIDExecutingCallbacks != Environment.CurrentManagedThreadId) // The executing thread ID is not this thread's ID. 82node.Registrations.ThreadIDExecutingCallbacks != Environment.CurrentManagedThreadId) // The executing thread ID is not this thread's ID.
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (3)
743registrations.ThreadIDExecutingCallbacks = Environment.CurrentManagedThreadId; 798n.Registrations.ThreadIDExecutingCallbacks = Environment.CurrentManagedThreadId; 801registrations.ThreadIDExecutingCallbacks = Environment.CurrentManagedThreadId; // above may have altered ThreadIDExecutingCallbacks, so reset it
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs (1)
452Environment.FailFast(
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Lock.cs (5)
541int waitStartTimeMs = timeoutMs < 0 ? 0 : Environment.TickCount; 586uint waitDurationMs = (uint)(Environment.TickCount - waitStartTimeMs); 629ushort currentTimeMs = (ushort)Environment.TickCount; 647(ushort)(Environment.TickCount - waiterStartTimeMs) >= MaxDurationMsForPreemptingWaiters; 838s_isSingleProcessor = Environment.GetProcessorCount() == 1;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelLifoSemaphore.cs (1)
109int spinsRemaining = Environment.IsSingleProcessor ? 0 : _maxSpinCount;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelLock.cs (1)
130uint spinCount = Environment.IsSingleProcessor ? 0 : SpinCount;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelSpinWaiter.cs (1)
23int processorCount = Environment.ProcessorCount;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelThreadBlocker.cs (2)
152long deadline = Environment.TickCount64 + timeoutMs; 163timeoutMs = (int)(deadline - Environment.TickCount64);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ManualResetEventSlim.cs (2)
199SpinCount = Environment.IsSingleProcessor ? DEFAULT_SPIN_SP : spinCount; 516startTime = Environment.TickCount64;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\NamedMutex.Unix.cs (6)
302return ownerProcessId == (uint)Environment.ProcessId && 310(uint)Environment.ProcessId, 428return _sharedData->LockOwnerProcessId == (uint)Environment.ProcessId && 434_sharedData->LockOwnerProcessId = (uint)Environment.ProcessId; 481startTime = Environment.TickCount; 552int elapsedMilliseconds = Environment.TickCount - startTime;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.Blocking.cs (1)
320int processorCount = Environment.ProcessorCount;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.cs (2)
137_minThreads = HasForcedMinThreads ? ForcedMinWorkerThreads : (short)Environment.ProcessorCount; 402int currentTicks = Environment.TickCount;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.GateThread.cs (5)
47lastCpuUtilizationRefreshTimeMs = Environment.TickCount; 65int currentTimeMs = Environment.TickCount; 71currentTimeMs = Environment.TickCount; 211uint delay = (uint)(Environment.TickCount - threadPoolInstance._separated.lastDispatchTime); 273Environment.FailFast("Failed to create the thread pool Gate thread.", e);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.HillClimbing.cs (1)
410entry.tickCount = Environment.TickCount;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.Unix.cs (1)
18Interop.Sys.GetCpuUtilization(ref _cpuInfo) / Environment.ProcessorCount;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WaitThread.cs (2)
207int currentTimeMs = Environment.TickCount; 272currentTimeMs = Environment.TickCount;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WorkerThread.cs (1)
136threadPoolInstance.NotifyDispatchProgress(Environment.TickCount);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ProcessorIdCache.cs (1)
38currentProcessorId = Environment.CurrentManagedThreadId;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ReaderWriterLockSlim.cs (13)
247_start = Environment.TickCount; 257_start = Environment.TickCount; 268int elapsed = Environment.TickCount - _start; 300int id = Environment.CurrentManagedThreadId; 445int id = Environment.CurrentManagedThreadId; 652int id = Environment.CurrentManagedThreadId; 789if (Environment.CurrentManagedThreadId == _upgradeLockOwnerId) 810if (Environment.CurrentManagedThreadId != _writeLockOwnerId) 857if (Environment.CurrentManagedThreadId != _upgradeLockOwnerId) 1229if ((spinCount < 5) && (Environment.ProcessorCount > 1)) 1379if (Environment.CurrentManagedThreadId == _upgradeLockOwnerId) 1403if (Environment.CurrentManagedThreadId == _writeLockOwnerId) 1568!Environment.IsSingleProcessor)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\RegisteredWaitHandle.Portable.cs (1)
90TimeoutTimeMs = Environment.TickCount + TimeoutDurationMs;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\SemaphoreSlim.cs (1)
328startTime = Environment.TickCount64;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\SpinLock.cs (4)
293startTime = Environment.TickCount64; 351if (turn > Environment.ProcessorCount) 414int newOwner = Environment.CurrentManagedThreadId; 576return (_owner & (~LOCK_ID_DISABLE_MASK)) == Environment.CurrentManagedThreadId;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\SpinWait.cs (5)
88internal static readonly int SpinCountForSpinBeforeWait = Environment.IsSingleProcessor ? 1 : 35; 116public bool NextSpinWillYield => _count >= YieldThreshold || Environment.IsSingleProcessor; 174Environment.IsSingleProcessor) 314startTime = (uint)Environment.TickCount; 328if (millisecondsTimeout <= (uint)Environment.TickCount - startTime)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (1)
64private static int DefaultMaxConcurrencyLevel => Environment.ProcessorCount;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (2)
3205uint startTimeTicks = infiniteWait ? 0 : (uint)Environment.TickCount; 3249uint elapsedTimeTicks = ((uint)Environment.TickCount) - startTimeTicks;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TplEventSource.cs (1)
572int pid = Environment.ProcessId;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (4)
423Environment.ProcessorCount <= 32 ? 0 : 424(Environment.ProcessorCount + (ProcessorsPerAssignableWorkItemQueue - 1)) / ProcessorsPerAssignableWorkItemQueue; 903int startTickCount = Environment.TickCount; 978int currentTickCount = Environment.TickCount;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\TimeoutHelper.cs (1)
24ulong elapsedMilliseconds = (ulong)(Environment.TickCount64 - startTime);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Timer.cs (7)
45internal static readonly (long TickCount, DateTime Time) s_tickCountToTimeMap = (Environment.TickCount64, DateTime.UtcNow); 51var queues = new TimerQueue[Environment.ProcessorCount]; 129long elapsed = Environment.TickCount64 - _currentTimerStartTicks; 141_currentTimerStartTicks = Environment.TickCount64; 164private long _currentAbsoluteThreshold = Environment.TickCount64 + ShortTimersThresholdMilliseconds; 194long nowTicks = Environment.TickCount64; 345long nowTicks = Environment.TickCount64;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\TimerQueue.Portable.cs (2)
53long dueTimeMs = Environment.TickCount64 + (int)actualDuration; 95long currentTimeMs = Environment.TickCount64;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\WaitSubsystem.ThreadWaitInfo.Unix.cs (2)
341int startTimeMilliseconds = Environment.TickCount; 357elapsedMilliseconds = Environment.TickCount - startTimeMilliseconds;
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.NonAndroid.cs (2)
226string? result = Environment.GetEnvironmentVariable(TimeZoneEnvironmentVariable); 507string? tzDirectory = Environment.GetEnvironmentVariable(TimeZoneDirectoryEnvironmentVariable);
System\Diagnostics\StackTrace.NativeAot.cs (2)
91if (traceFormat == TraceFormat.Normal && builder.Length >= Environment.NewLine.Length) 92builder.Length -= Environment.NewLine.Length;
System\Exception.NativeAot.cs (1)
104Environment.FailFast("Exceptions must derive from the System.Exception class");
System\Runtime\InteropServices\PInvokeMarshal.cs (2)
222Environment.FailFast(SR.Delegate_GarbageCollected); 297Environment.FailFast(SR.Delegate_GarbageCollected);
System\StartupHookProvider.NativeAot.cs (1)
16ProcessStartupHooks(Environment.GetEnvironmentVariable("DOTNET_STARTUP_HOOKS"));
System\Threading\ObjectHeader.cs (1)
343currentThreadID = Environment.CurrentManagedThreadId;
System.Private.DataContractSerialization (1)
System\Runtime\Serialization\DataContractSet.cs (1)
594errorMessage.AppendFormat("{0}\"{1}\" ", Environment.NewLine, conflictingType.AssemblyQualifiedName);
System.Private.TypeLoader (20)
Internal\Runtime\TypeLoader\GenericDictionaryCell.cs (12)
49Environment.FailFast("Canonical types do not have EETypes"); 67Environment.FailFast("Canonical types do not have EETypes"); 95Environment.FailFast("Unable to compute call information for a canonical interface"); 124Environment.FailFast("Unable to compute call information for a canonical type/method."); 161Environment.FailFast("Unable to compute call information for a canonical type/method."); 207Environment.FailFast("Unable to find exact method pointer for a resolved GVM."); 221Environment.FailFast("Unable to compute static field locations for a canonical type."); 257Environment.FailFast("Unable to compute static field locations for a canonical type."); 275Environment.FailFast("Method dictionaries of canonical methods do not exist"); 295Environment.FailFast("Ldtoken is not permitted for a canonical field"); 317Environment.FailFast("Ldtoken is not permitted for a canonical method"); 351Environment.FailFast("Canonical types cannot be allocated");
Internal\Runtime\TypeLoader\ModuleList.cs (2)
189Environment.FailFast("Invalid module requested in enumeration: " + preferredModuleHandle.LowLevelToString()); 230Environment.FailFast("Current module queried in wrong enumerator state");
Internal\Runtime\TypeLoader\TypeBuilder.cs (1)
1274Environment.FailFast("MissingTemplateException thrown during lazy generic lookup", e);
Internal\Runtime\TypeLoader\TypeLoaderEnvironment.ConstructedGenericsRegistration.cs (1)
120Environment.FailFast("Exception during registration rollback", e);
Internal\Runtime\TypeLoader\TypeLoaderEnvironment.cs (2)
126Environment.FailFast("TypeLoaderLock not held"); 138Environment.FailFast("Reentrant lazy generic lookup");
Internal\Runtime\TypeLoader\TypeLoaderEnvironment.GVMResolution.cs (2)
116Environment.FailFast(sb.ToString()); 143Environment.FailFast(sb.ToString());
System.Private.Windows.Core (17)
_generated\123\Windows.Win32.IAdviseSink.g.cs (5)
80 global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex); 110 global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex); 140 global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex); 166 global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex); 191 global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex);
_generated\156\Windows.Win32.IRecordInfo.g.cs (2)
575 global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex); 607 global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex);
_generated\163\Windows.Win32.ITypeInfo.g.cs (3)
803 global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex); 840 global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex); 877 global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex);
_generated\164\Windows.Win32.ITypeLib.g.cs (2)
67 global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex); 458 global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex);
Windows\Win32\Graphics\GdiPlus\GdiplusStartupInputEx.cs (1)
10OperatingSystem os = Environment.OSVersion;
Windows\Win32\PInvokeCore.GetClassLong.cs (1)
18=> Environment.Is64BitProcess
Windows\Win32\PInvokeCore.GetWindowLong.cs (1)
28nint result = Environment.Is64BitProcess
Windows\Win32\PInvokeCore.SetClassLong.cs (1)
16=> Environment.Is64BitProcess
Windows\Win32\PInvokeCore.SetWindowLong.cs (1)
17nint result = Environment.Is64BitProcess
System.Private.Windows.Core.TestUtilities (7)
NoAssertContext.cs (6)
43s_suppressedThreads.AddOrUpdate(Environment.CurrentManagedThreadId, 1, (key, oldValue) => oldValue + 1); 74int currentThread = Environment.CurrentManagedThreadId; 138if (!s_suppressedThreads.TryGetValue(Environment.CurrentManagedThreadId, out _)) 146if (!s_suppressedThreads.TryGetValue(Environment.CurrentManagedThreadId, out _)) 156if (!s_suppressedThreads.TryGetValue(Environment.CurrentManagedThreadId, out _)) 164if (!s_suppressedThreads.TryGetValue(Environment.CurrentManagedThreadId, out _))
ThrowingTraceListener.cs (1)
15: $"{Environment.NewLine}{detailMessage}")}");
System.Private.Xml (14)
src\runtime\src\libraries\Common\src\System\LocalAppContextSwitches.Common.cs (1)
60if (Environment.GetEnvironmentVariable(envVariable) is string str)
System\Xml\Core\XmlWriterSettings.cs (1)
506_newLineChars = Environment.NewLine; // "\r\n" on Windows, "\n" on Unix
System\Xml\Serialization\SchemaObjectWriter.cs (1)
194_w.Append(Environment.NewLine);
System\Xml\Serialization\XmlSchemas.cs (2)
591err += $"{Environment.NewLine}{Dump(src)}{Environment.NewLine}{Dump(dest)}";
System\Xml\Serialization\XmlSerializationWriter.cs (4)
2455if (methodName == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorMethod, mapping.TypeDesc!.Name) + Environment.StackTrace); 3034if (methodName == null) throw new InvalidOperationException("derived from " + mapping.TypeDesc!.FullName + ", " + SR.Format(SR.XmlInternalErrorMethod, derived.TypeDesc.Name) + Environment.StackTrace); 3073if (methodName == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorMethod, mapping.TypeDesc.Name) + Environment.StackTrace); 4160if (methodName == null) throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorMethod, structMapping.TypeDesc!.Name) + Environment.StackTrace);
System\Xml\Xsl\IlGen\XmlILTrace.cs (1)
44s_dirName = Environment.GetEnvironmentVariable("XmlILTrace");
System\Xml\Xsl\QIL\QilValidationVisitor.cs (1)
182message = $"{s}{Environment.NewLine}{message}";
System\Xml\Xsl\XPath\XPathCompileException.cs (1)
118message += Environment.NewLine;
System\Xml\Xsl\XslException.cs (2)
91result += $" ---> {InnerException}{Environment.NewLine} {CreateMessage(SR.Xml_EndOfInnerExceptionStack)}"; 95result += Environment.NewLine + StackTrace;
System.Reflection.Metadata (1)
System\Reflection\Internal\Utilities\ObjectPool`1.cs (1)
42: this(factory, Environment.ProcessorCount * 2)
System.Runtime (1)
src\runtime\artifacts\obj\System.Runtime\Release\net11.0\System.Runtime.Forwards.cs (1)
180[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Environment))]
System.Runtime.Caching (6)
System\Runtime\Caching\Dbg.cs (5)
14private static readonly bool s_tracingEnabled = Environment.GetEnvironmentVariable("DOTNET_SYSTEM_RUNTIME_CACHING_TRACING") == "true"; 28e is ExternalException ee ? "Exception " + e + Environment.NewLine + "_hr=0x" + ee.ErrorCode.ToString("x", CultureInfo.InvariantCulture) : 39Environment.CurrentManagedThreadId, 42Environment.NewLine, 43exceptionMessage != null ? exceptionMessage + Environment.NewLine : "");
System\Runtime\Caching\MemoryCache.cs (1)
359_storeCount = Environment.ProcessorCount;
System.Runtime.Extensions (1)
System.Runtime.Extensions.cs (1)
17[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Environment))]
System.Runtime.InteropServices (1)
System\Runtime\InteropServices\RuntimeEnvironment.cs (1)
37public static string GetSystemVersion() => $"v{Environment.Version}";
System.Runtime.InteropServices.JavaScript (20)
System\Runtime\InteropServices\JavaScript\Interop\JavaScriptExports.CoreCLR.cs (4)
34Environment.FailFast($"ReleaseJSOwnedObjectByGCHandle: Unexpected synchronous failure (ManagedThreadId {Environment.CurrentManagedThreadId}): " + ex); 93Environment.FailFast($"CompleteTask: Unexpected synchronous failure (ManagedThreadId {Environment.CurrentManagedThreadId}): " + ex);
System\Runtime\InteropServices\JavaScript\JSException.cs (1)
80? bs + Environment.NewLine + jsStackTrace
System\Runtime\InteropServices\JavaScript\JSHostImplementation.CoreCLR.cs (2)
54Environment.FailFast($"Can't find {nameSpace}{shortClassName} in {assemblyName} assembly"); 59Environment.FailFast($"Can't find method wrapper {wrapperName} in {nameSpace}.{shortClassName} in {assemblyName} assembly");
System\Runtime\InteropServices\JavaScript\JSProxyContext.cs (4)
495Environment.FailFast($"ReleaseCSOwnedObject expected to find registration for JSHandle: {jsHandle}, ManagedThreadId: {Environment.CurrentManagedThreadId}. {Environment.NewLine} {Environment.StackTrace}");
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Task.cs (9)
62Environment.FailFast("Failed to set exception to TaskCompletionSource (arguments buffer is null)"); 73Environment.FailFast("Failed to set exception to TaskCompletionSource (exception raised)"); 80Environment.FailFast("Failed to set result to TaskCompletionSource (marshaler type is none)"); 122Environment.FailFast("Failed to set exception to TaskCompletionSource (arguments buffer is null)"); 135Environment.FailFast("Failed to set exception to TaskCompletionSource (exception raised)"); 143Environment.FailFast("Failed to set result to TaskCompletionSource (marshaler type is none)"); 169Environment.FailFast("Marshalling null return Task to JS is not supported in MT"); 265Environment.FailFast("Marshalling null return Task to JS is not supported in MT"); 341Environment.FailFast("Marshalling null return Task to JS is not supported in MT");
System.Runtime.Numerics (5)
System\Numerics\BigInteger.cs (5)
2193public static explicit operator nint(BigInteger value) => Environment.Is64BitProcess ? (nint)(long)value : (int)value; 2287public static explicit operator nuint(BigInteger value) => Environment.Is64BitProcess ? (nuint)(ulong)value : (uint)value; 3248if (Environment.Is64BitProcess && (uint)(value._bits[^1] >> BitsPerUInt32) == 0) 3304if (!Environment.Is64BitProcess) 3513Debug.Assert(!Environment.Is64BitProcess);
System.Security.Cryptography (2)
src\runtime\src\libraries\Common\src\System\IO\MemoryMappedFiles\MemoryMappedFileMemoryManager.cs (1)
32Environment.FailFast("MemoryMappedFileMemoryManager was finalized.");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\DSACng.cs (1)
66Version version = Environment.OSVersion.Version;
System.Security.Cryptography.Xml (1)
System\Security\Cryptography\Xml\Reference.cs (1)
364string baseUri = (document == null ? System.Environment.CurrentDirectory + "\\" : document.BaseURI);
System.Security.Permissions (3)
System\Security\HostProtectionException.cs (3)
71sb.Append(Environment.NewLine); 72sb.Append(Environment.NewLine); 74sb.Append(Environment.NewLine);
System.Security.Principal.Windows (3)
System\Security\Principal\WindowsIdentity.cs (3)
780Environment.FailFast(Marshal.GetLastPInvokeErrorMessage()); 800Environment.FailFast(Marshal.GetLastPInvokeErrorMessage()); 805Environment.FailFast(Marshal.GetLastPInvokeErrorMessage());
System.ServiceModel.Primitives (11)
Internals\System\Runtime\Fx.cs (1)
172Environment.FailFast(failFastMessage);
Internals\System\Runtime\IOThreadScheduler.cs (1)
240if (!Environment.HasShutdownStarted)
Internals\System\Runtime\SynchronizedPool.cs (3)
212int thisThreadID = Environment.CurrentManagedThreadId; 265int thisThreadID = Environment.CurrentManagedThreadId; 340return Environment.ProcessorCount;
Internals\System\Runtime\TimeoutHelper.cs (1)
295uint currentTime = (uint)Environment.TickCount;
Internals\WcfEventSource.cs (1)
27if (Environment.Version.Major >= 5)
System\IdentityModel\Claims\X509CertificateClaimSet.cs (1)
449Environment.NewLine,
System\ServiceModel\Security\TimeBoundedCache.cs (3)
295Environment.FailFast("Cache write lock is not held."); 357Environment.FailFast("Cache write lock is not held."); 374Environment.FailFast("Cache write lock is not held.");
System.ServiceModel.Primitives.Tests (2)
ServiceModel\MessageContractTest.4.4.0.cs (2)
175string headerValue = header.ToString().Replace(Environment.NewLine, String.Empty).Replace(" ", String.Empty); 321name, Environment.NewLine, value, errorBuilder.ToString()));
System.Speech (1)
Recognition\RecognizerBase.cs (1)
880OperatingSystem OS = Environment.OSVersion;
System.Text.Json (6)
System\Text\Json\Serialization\JsonSerializerOptions.cs (2)
775/// The default is the value of <see cref="Environment.NewLine"/>. 790return _newLine ??= Environment.NewLine;
System\Text\Json\Writer\JsonWriterOptions.cs (4)
16private static readonly string s_alternateNewLine = Environment.NewLine.Length == 2 ? JsonConstants.NewLineLineFeed : JsonConstants.NewLineCarriageReturnLineFeed; 142/// The default is the value of <see cref="Environment.NewLine"/>. 152get => (_optionsMask & NewLineBit) != 0 ? s_alternateNewLine : Environment.NewLine; 156if (value != Environment.NewLine)
System.Text.RegularExpressions (7)
System\Text\RegularExpressions\RegexLWCGCompiler.cs (1)
26private static readonly bool s_includePatternInName = Environment.GetEnvironmentVariable(IncludePatternInNamesEnvVar) == "1";
System\Text\RegularExpressions\RegexRunner.cs (2)
353_timeoutOccursAt = Environment.TickCount64 + _timeout; 362if (_checkTimeout && Environment.TickCount64 >= _timeoutOccursAt)
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Automata.cs (1)
367if ((timeoutOccursAt != 0 && Environment.TickCount64 > timeoutOccursAt) || // if there's an active timer
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.cs (2)
341if (Environment.TickCount64 >= timeoutOccursAt) 364timeoutOccursAt = Environment.TickCount64 + _timeout;
System\Text\RegularExpressions\Symbolic\UnicodeCategoryRangesGenerator.cs (1)
33// It provides serialized BDD Unicode category definitions for System.Environment.Version = {Environment.Version}
System.Threading (7)
System\Threading\Barrier.cs (5)
329if (_actionCallerID != 0 && Environment.CurrentManagedThreadId == _actionCallerID) 428if (_actionCallerID != 0 && Environment.CurrentManagedThreadId == _actionCallerID) 653if (_actionCallerID != 0 && Environment.CurrentManagedThreadId == _actionCallerID) 789_actionCallerID = Environment.CurrentManagedThreadId; 927if (_actionCallerID != 0 && Environment.CurrentManagedThreadId == _actionCallerID)
System\Threading\ReaderWriterLock.cs (2)
30private static readonly int DefaultSpinCount = Environment.ProcessorCount != 1 ? 500 : 0; 1002int threadID = Environment.CurrentManagedThreadId;
System.Threading.Tasks.Dataflow (2)
Base\DataflowBlock.cs (1)
425if (!Environment.HasShutdownStarted)
Internal\DataflowEtwProvider.cs (1)
140try { exceptionData = string.Join(Environment.NewLine, completionTask.Exception!.InnerExceptions.Select(static e => e.ToString())); }
System.Threading.Tasks.Parallel (12)
System\Threading\Tasks\Parallel.cs (3)
884timeoutOccursAt - Environment.TickCount64 <= 0; 887Environment.TickCount64 + timeoutLength; 945Environment.ProcessorCount :
System\Threading\Tasks\Parallel.ForEachAsync.cs (8)
19/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 37/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 55/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 197/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 213/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 352/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 368/// <remarks>The operation will execute at most <see cref="Environment.ProcessorCount"/> operations in parallel.</remarks> 502private static int DefaultDegreeOfParallelism => Environment.ProcessorCount;
System\Threading\Tasks\TaskReplicator.cs (1)
166return 100 + Random.Shared.Next(0, 50 * Environment.ProcessorCount);
System.Transactions.Local (11)
System\Transactions\DtcProxyShim\DtcProxyShimFactory.cs (1)
38private static readonly int s_maxCachedInterfaces = Environment.ProcessorCount * 2;
System\Transactions\Oletx\OletxTransactionManager.cs (10)
152Environment.FailFast(SR.InternalError); 167Environment.FailFast(SR.InternalError); 187Environment.FailFast(SR.InternalError); 237Environment.FailFast(SR.InternalError); 254Environment.FailFast(SR.InternalError); 268Environment.FailFast(SR.InternalError); 282Environment.FailFast(SR.InternalError); 296Environment.FailFast(SR.InternalError); 315Environment.FailFast(SR.InternalError); 324Environment.FailFast(SR.InternalError);
System.Windows.Forms (32)
System\Resources\AssemblyNamesTypeResolutionService.cs (2)
17Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles),
System\Windows\Forms\Accessibility\LabelEditAccessibleObject.cs (1)
35UIA_PROPERTY_ID.UIA_ProcessIdPropertyId => (VARIANT)Environment.ProcessId,
System\Windows\Forms\Accessibility\LabelEditNativeWindow.cs (2)
53(uint)Environment.ProcessId, 62(uint)Environment.ProcessId,
System\Windows\Forms\Application.cs (7)
155=> GetDataPath(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)); 467=> GetDataPath(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)); 666=> GetDataPath(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)); 1309string[] arguments = Environment.GetCommandLineArgs();
System\Windows\Forms\Application.ThreadContext.cs (3)
112Debug.WriteLine(CoreSwitches.PerfTrack.Enabled, Environment.StackTrace); 187Debug.WriteLine(CoreSwitches.PerfTrack.Enabled, Environment.StackTrace); 621Environment.Exit(0);
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObject.cs (1)
126UIA_PROPERTY_ID.UIA_ProcessIdPropertyId => (VARIANT)Environment.ProcessId,
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.MouseHook.cs (1)
31_callingStack = Environment.StackTrace;
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (1)
618Text = string.Join(Environment.NewLine, value);
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.HostedWindowsFormsMessageHook.cs (1)
22_callingStack = Environment.StackTrace;
System\Windows\Forms\Controls\ToolStrips\ToolStripRenderer.cs (1)
1128if (Environment.OSVersion.Version >= new Version(10, 0, 22000)
System\Windows\Forms\Controls\WebBrowser\WebBrowser.cs (2)
612string mshtmlPath = Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.System), "mshtml.dll");
System\Windows\Forms\Dialogs\CommonDialogs\FolderBrowserDialog.cs (4)
24private Environment.SpecialFolder _rootFolder; 198[DefaultValue(Environment.SpecialFolder.Desktop)] 203public Environment.SpecialFolder RootFolder 260_rootFolder = Environment.SpecialFolder.Desktop;
System\Windows\Forms\Dialogs\CommonDialogs\SpecialFolderEnumConverter.cs (2)
29if (currentItem is Environment.SpecialFolder specialFolder && 30specialFolder.Equals(Environment.SpecialFolder.Personal))
System\Windows\Forms\Internal\WinFormsUtils.cs (1)
179nameOfControl += $"{Environment.NewLine}\tOwnerItem: {dd.OwnerItem}";
System\Windows\Forms\SystemInformation.cs (3)
480public static string ComputerName => Environment.MachineName; 485public static string UserDomainName => Environment.UserDomainName; 524public static string UserName => Environment.UserName;
System.Windows.Forms.Design (11)
System\ComponentModel\Design\DesignerActionPanel.MethodLine.cs (1)
76ActionPanel.ShowError(string.Format(SR.DesignerActionPanel_ErrorInvokingAction, _methodItem!.DisplayName, Environment.NewLine + ex.Message));
System\ComponentModel\Design\Serialization\CodeDomDesignerLoader.cs (2)
350StringBuilder builder = new(Environment.NewLine); 351builder.AppendJoin(Environment.NewLine, failures);
System\Windows\Forms\Design\Behavior\BehaviorService.AdornerWindow.MouseHook.cs (1)
39_callingStack = Environment.StackTrace;
System\Windows\Forms\Design\Behavior\BehaviorService.cs (2)
751snapLineInfo = string.Join(Environment.NewLine, _testHook_RecentSnapLines) + Environment.NewLine;
System\Windows\Forms\Design\ControlDesigner.cs (1)
2500stack = string.Join(Environment.NewLine, exceptionLines.Where(l => l.Contains(typeName)));
System\Windows\Forms\Design\FolderNameEditor.FolderBrowserFolder.cs (3)
10/// <see cref="Environment.SpecialFolder"/> is also a list of CSIDL values. Unfortunately CSIDL_CONNECTIONS, 12/// <see cref="Environment.GetFolderPath(Environment.SpecialFolder)"/>.
System\Windows\Forms\Design\StringCollectionEditor.StringCollectionForm.cs (1)
187=> _textEntry.Text = string.Join(Environment.NewLine, Items);
System.Windows.Forms.Primitives (14)
_generated\108\Windows.Win32.IAdviseSinkEx.g.cs (6)
80 global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex); 103 global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex); 126 global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex); 149 global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex); 172 global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex); 195 global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex);
_generated\186\Windows.Win32.IMessageFilter.g.cs (3)
76 global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex); 112 global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex); 147 global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex);
_generated\235\Windows.Win32.IRichEditOle.g.cs (2)
104 global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex); 134 global::System.Environment.FailFast("COM object threw an exception from a non-HRESULT returning method.", ex);
System\Windows\Forms\Automation\UiaTextRange.cs (1)
791&& (text.Substring(lineStartIndex, lineTextLength) == Environment.NewLine
System\Windows\Forms\ObjectCache.cs (1)
19cacheSpace = Environment.Is64BitProcess ? 64 : 32;
Windows\Win32\UI\Shell\FolderBrowserHelper.cs (1)
27PInvoke.SHGetSpecialFolderLocation((int)Environment.SpecialFolder.Desktop, out rootFolderId);
System.Xaml (1)
System\Xaml\XamlSchemaContext.cs (1)
77if (_assemblyLoadHandler is not null && !Environment.HasShutdownStarted)
testhost (9)
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (8)
36var debugEnabled = Environment.GetEnvironmentVariable(environmentVariable); 55Environment.ProcessId; 76var vsAttachPath = Environment.GetEnvironmentVariable(env) ?? FindAttachVs(); 79Environment.SetEnvironmentVariable(env, vsAttachPath); 104var paths = Environment.GetEnvironmentVariable("PATH")!.Split(';'); 127var debugEnabled = Environment.GetEnvironmentVariable(environmentVariable); 154var nativeDebugEnabled = Environment.GetEnvironmentVariable(environmentVariable); 180return Environment.GetEnvironmentVariable("VSTEST_DEBUG_NOBP")?.Equals("1") ?? false;
src\vstest\src\testhost.x86\TestHostTraceListener.cs (1)
43throw GetException((message + Environment.NewLine + detailMessage));
testhost.arm64 (9)
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (8)
36var debugEnabled = Environment.GetEnvironmentVariable(environmentVariable); 55Environment.ProcessId; 76var vsAttachPath = Environment.GetEnvironmentVariable(env) ?? FindAttachVs(); 79Environment.SetEnvironmentVariable(env, vsAttachPath); 104var paths = Environment.GetEnvironmentVariable("PATH")!.Split(';'); 127var debugEnabled = Environment.GetEnvironmentVariable(environmentVariable); 154var nativeDebugEnabled = Environment.GetEnvironmentVariable(environmentVariable); 180return Environment.GetEnvironmentVariable("VSTEST_DEBUG_NOBP")?.Equals("1") ?? false;
src\vstest\src\testhost.x86\TestHostTraceListener.cs (1)
43throw GetException((message + Environment.NewLine + detailMessage));
testhost.x86 (9)
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (8)
36var debugEnabled = Environment.GetEnvironmentVariable(environmentVariable); 55Environment.ProcessId; 76var vsAttachPath = Environment.GetEnvironmentVariable(env) ?? FindAttachVs(); 79Environment.SetEnvironmentVariable(env, vsAttachPath); 104var paths = Environment.GetEnvironmentVariable("PATH")!.Split(';'); 127var debugEnabled = Environment.GetEnvironmentVariable(environmentVariable); 154var nativeDebugEnabled = Environment.GetEnvironmentVariable(environmentVariable); 180return Environment.GetEnvironmentVariable("VSTEST_DEBUG_NOBP")?.Equals("1") ?? false;
TestHostTraceListener.cs (1)
43throw GetException((message + Environment.NewLine + detailMessage));
TestProject.IntegrationServiceA (2)
Program.cs (2)
7string? skipResourcesValue = Environment.GetEnvironmentVariable("SKIP_RESOURCES"); 35app.MapGet("/pid", () => Environment.ProcessId);
TestProject.ServiceA (1)
Program.cs (1)
13app.MapGet("/pid", () => Environment.ProcessId);
TestProject.ServiceB (1)
Program.cs (1)
8app.MapGet("/pid", () => Environment.ProcessId);
TestProject.ServiceC (1)
Program.cs (1)
8app.MapGet("/pid", () => Environment.ProcessId);
UIAutomationClient (5)
MS\Internal\Automation\HwndProxyElementProvider.cs (3)
1614long dwTicks = (long)Environment.TickCount; 1617while (InMenuMode() && ((long)Environment.TickCount - dwTicks) < MenuTimeOut) 1747if (Environment.OSVersion.Version.Major >= 6)
MS\Internal\Automation\Misc.cs (1)
519&& System.Environment.OSVersion.Version.Major >= 6)
MS\Win32\UnsafeNativeMethods.cs (1)
175if (System.Environment.OSVersion.Version.Major >= 6)
UIAutomationClientSideProviders (32)
MS\Internal\AutomationProxies\Accessible.cs (2)
158if(Environment.OSVersion.Version.Major >= 6) 159wParam = new IntPtr(Environment.ProcessId);
MS\Internal\AutomationProxies\CommonGetThemePartSize.cs (1)
22if (Environment.OSVersion.Version.Major >= 5)
MS\Internal\AutomationProxies\CommonXSendMessage.cs (7)
625if (Environment.OSVersion.Version.Major == 5) 637if (Environment.OSVersion.Version.Major == 5) 649if (Environment.OSVersion.Version.Major == 5) 1486if (Environment.OSVersion.Version.Major > 5 || (Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor == 1)) 1508else if (Environment.OSVersion.Version.Major == 5)
MS\Internal\AutomationProxies\Misc.cs (8)
105long dwTicks = (long)Environment.TickCount; 108while (InMenuMode() && ((long)Environment.TickCount - dwTicks) < MenuTimeOut) 285bool result = (System.Environment.OSVersion.Version.Major >= 6) ? UnsafeNativeMethods.GetPhysicalCursorPos(ref pt) 1020&& System.Environment.OSVersion.Version.Major >= 6) 1210if (System.Environment.OSVersion.Version.Major >= 6) 1856if (Environment.OSVersion.Version.Major >= 6 && commonControlVersion >= 6) 1970Debug.Assert(System.Environment.OSVersion.Version.Major < 6); 2041Debug.Assert(System.Environment.OSVersion.Version.Major >= 6);
MS\Internal\AutomationProxies\SafeProcessHandle.cs (1)
23processId = (uint)Environment.ProcessId;
MS\Internal\AutomationProxies\WindowsButton.cs (3)
188if (Environment.OSVersion.Version.Major < 6) 288if (idEvent == InvokePattern.InvokedEvent && Environment.OSVersion.Version.Major >= 6) 555if (Environment.OSVersion.Version.Major >= 6)
MS\Internal\AutomationProxies\WindowsListView.cs (1)
907if (Environment.OSVersion.Version.Major < 6)
MS\Internal\AutomationProxies\WindowsMenu.cs (2)
812if ((Environment.OSVersion.Version.Major < 6) && (Misc.IsLayoutRTL(_hwnd))) 1256if ((Environment.OSVersion.Version.Major < 6) && (Misc.IsLayoutRTL(_hwnd)))
MS\Internal\AutomationProxies\WindowsScrollBar.cs (2)
159if ((Environment.OSVersion.Version.Major < 6) && (Misc.IsLayoutRTL(_parent._hwnd))) 585if ((Environment.OSVersion.Version.Major < 6) && (_sbFlag == NativeMethods.SB_HORZ) && (Misc.IsControlRTL(_parent._hwnd)))
MS\Internal\AutomationProxies\WindowsScrollBarBits.cs (2)
235if ((Environment.OSVersion.Version.Major < 6) && (Misc.IsLayoutRTL(parent._parent._hwnd))) 416if ((Environment.OSVersion.Version.Major < 6) && (Misc.IsLayoutRTL(hwnd)))
MS\Internal\AutomationProxies\WindowsTooltip.cs (1)
205if (System.Environment.OSVersion.Version.Major >= 6)
MS\Internal\AutomationProxies\WindowsTreeView.cs (1)
812if (_nativeAcc == null && System.Environment.OSVersion.Version.Major >= 6 && Misc.IsWindowInGivenProcess(_hwnd, "explorer"))
MS\Win32\UnsafeNativeMethods.cs (1)
314if (System.Environment.OSVersion.Version.Major >= 6)
vbc (13)
src\roslyn\src\Compilers\Shared\BuildClient.cs (1)
151var libDirectory = Environment.GetEnvironmentVariable("LIB");
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (4)
221var originalThreadId = Environment.CurrentManagedThreadId; 282var releaseThreadId = Environment.CurrentManagedThreadId; 563var environmentVariables = GetServerEnvironmentVariables(Environment.GetEnvironmentVariables(), logger); 683var userName = Environment.UserName;
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (3)
120loggingFilePath = Environment.GetEnvironmentVariable(EnvironmentVariableName); 153var threadId = Environment.CurrentManagedThreadId; 155string output = prefix + message + Environment.NewLine;
src\roslyn\src\Compilers\Shared\ExitingTraceListener.cs (1)
58Environment.FailFast(message);
src\roslyn\src\Compilers\Shared\RuntimeHostInfo.cs (3)
78if (Environment.GetEnvironmentVariable(DotNetHostPathEnvironmentName) is { Length: > 0 } pathToDotNet) 83if (Environment.GetEnvironmentVariable(DotNetExperimentalHostPathEnvironmentName) is { Length: > 0 } pathToDotNetExperimental) 92var path = Environment.GetEnvironmentVariable("PATH") ?? "";
src\roslyn\src\Compilers\Shared\Vbc.cs (1)
18: base(VisualBasicCommandLineParser.Default, responseFile, args, buildPaths, Environment.GetEnvironmentVariable("LIB"), analyzerLoader)
VBCSCompiler (15)
src\roslyn\src\Compilers\Server\VBCSCompiler\ClientConnectionHandler.cs (1)
85if (!Environment.Is64BitProcess && !MemoryHelper.IsMemoryAvailable(Logger))
src\roslyn\src\Compilers\Server\VBCSCompiler\CompilationCache.cs (1)
278logger.Log($"Cache miss {dllName} [{hashKey}] diff vs entry [{entryName}]:{Environment.NewLine}{diff}");
src\roslyn\src\Compilers\Server\VBCSCompiler\NamedPipeClientConnectionHost.cs (1)
69var listenCount = Math.Min(4, Environment.ProcessorCount);
src\roslyn\src\Compilers\Shared\BuildClient.cs (1)
151var libDirectory = Environment.GetEnvironmentVariable("LIB");
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (4)
221var originalThreadId = Environment.CurrentManagedThreadId; 282var releaseThreadId = Environment.CurrentManagedThreadId; 563var environmentVariables = GetServerEnvironmentVariables(Environment.GetEnvironmentVariables(), logger); 683var userName = Environment.UserName;
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (3)
120loggingFilePath = Environment.GetEnvironmentVariable(EnvironmentVariableName); 153var threadId = Environment.CurrentManagedThreadId; 155string output = prefix + message + Environment.NewLine;
src\roslyn\src\Compilers\Shared\ExitingTraceListener.cs (1)
58Environment.FailFast(message);
src\roslyn\src\Compilers\Shared\RuntimeHostInfo.cs (3)
78if (Environment.GetEnvironmentVariable(DotNetHostPathEnvironmentName) is { Length: > 0 } pathToDotNet) 83if (Environment.GetEnvironmentVariable(DotNetExperimentalHostPathEnvironmentName) is { Length: > 0 } pathToDotNetExperimental) 92var path = Environment.GetEnvironmentVariable("PATH") ?? "";
vstest.console (96)
CommandLine\Executor.cs (3)
85var additionalThreadsCount = Environment.ProcessorCount * 4; 152var diag = Environment.GetEnvironmentVariable("VSTEST_DIAG"); 154var diagVerbosity = Environment.GetEnvironmentVariable("VSTEST_DIAG_VERBOSITY");
InProcessVsTestConsoleWrapper.cs (1)
97Environment.ProcessId;
Internal\ConsoleLogger.cs (2)
269var prefix = string.Format(CultureInfo.CurrentCulture, "{0}{1}", Environment.NewLine, TestMessageFormattingPrefix); 270var messageText = message.Text?.Replace(Environment.NewLine, prefix).TrimEnd(TestMessageFormattingPrefix.ToCharArray());
Internal\MSBuildLogger.cs (5)
191var stackFrames = Regex.Split(result.ErrorStackTrace, Environment.NewLine); 322var prefix = string.Format(CultureInfo.CurrentCulture, "{0}{1}", Environment.NewLine, testMessageFormattingPrefix); 323var messageText = message.Text?.Replace(Environment.NewLine, prefix).TrimEnd(testMessageFormattingPrefix.ToCharArray()); 394string[] stackFrames = Regex.Split(errorStackTrace, Environment.NewLine); 452MethodInfo? getResourceStringMethod = typeof(Environment).GetMethod("GetResourceString", BindingFlags.Static | BindingFlags.NonPublic, null, [typeof(string)], null);
Processors\EnableCodeCoverageArgumentProcessor.cs (71)
86@" <DataCollector uri=""datacollector://microsoft/CodeCoverage/2.0"" assemblyQualifiedName=""Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=16.0.0.0 " + @", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" friendlyName=""Code Coverage"">" + Environment.NewLine + 87@" <Configuration>" + Environment.NewLine + 88@" <CodeCoverage>" + Environment.NewLine + 89@" <ModulePaths>" + Environment.NewLine + 90@" <Exclude>" + Environment.NewLine + 91@" <ModulePath>.*CPPUnitTestFramework.*</ModulePath>" + Environment.NewLine + 92@" <ModulePath>.*vstest.console.*</ModulePath>" + Environment.NewLine + 93@" <ModulePath>.*microsoft.intellitrace.*</ModulePath>" + Environment.NewLine + 94@" <ModulePath>.*testhost.*</ModulePath>" + Environment.NewLine + 95@" <ModulePath>.*datacollector.*</ModulePath>" + Environment.NewLine + 96@" <ModulePath>.*microsoft.teamfoundation.testplatform.*</ModulePath>" + Environment.NewLine + 97@" <ModulePath>.*microsoft.visualstudio.testplatform.*</ModulePath>" + Environment.NewLine + 98@" <ModulePath>.*microsoft.visualstudio.testwindow.*</ModulePath>" + Environment.NewLine + 99@" <ModulePath>.*microsoft.visualstudio.mstest.*</ModulePath>" + Environment.NewLine + 100@" <ModulePath>.*microsoft.visualstudio.qualitytools.*</ModulePath>" + Environment.NewLine + 101@" <ModulePath>.*microsoft.vssdk.testhostadapter.*</ModulePath>" + Environment.NewLine + 102@" <ModulePath>.*microsoft.vssdk.testhostframework.*</ModulePath>" + Environment.NewLine + 103@" <ModulePath>.*qtagent32.*</ModulePath>" + Environment.NewLine + 104@" <ModulePath>.*msvcr.*dll$</ModulePath>" + Environment.NewLine + 105@" <ModulePath>.*msvcp.*dll$</ModulePath>" + Environment.NewLine + 106@" <ModulePath>.*clr.dll$</ModulePath>" + Environment.NewLine + 107@" <ModulePath>.*clr.ni.dll$</ModulePath>" + Environment.NewLine + 108@" <ModulePath>.*clrjit.dll$</ModulePath>" + Environment.NewLine + 109@" <ModulePath>.*clrjit.ni.dll$</ModulePath>" + Environment.NewLine + 110@" <ModulePath>.*mscoree.dll$</ModulePath>" + Environment.NewLine + 111@" <ModulePath>.*mscoreei.dll$</ModulePath>" + Environment.NewLine + 112@" <ModulePath>.*mscoreei.ni.dll$</ModulePath>" + Environment.NewLine + 113@" <ModulePath>.*mscorlib.dll$</ModulePath>" + Environment.NewLine + 114@" <ModulePath>.*mscorlib.ni.dll$</ModulePath>" + Environment.NewLine + 115@" </Exclude>" + Environment.NewLine + 116@" </ModulePaths>" + Environment.NewLine + 117@" <UseVerifiableInstrumentation>True</UseVerifiableInstrumentation>" + Environment.NewLine + 118@" <AllowLowIntegrityProcesses>True</AllowLowIntegrityProcesses>" + Environment.NewLine + 119@" <CollectFromChildProcesses>True</CollectFromChildProcesses>" + Environment.NewLine + 120@" <CollectAspDotNet>false</CollectAspDotNet>" + Environment.NewLine + 121@" <SymbolSearchPaths />" + Environment.NewLine + 122@" <Functions>" + Environment.NewLine + 123@" <Exclude>" + Environment.NewLine + 124@" <Function>^std::.*</Function>" + Environment.NewLine + 125@" <Function>^ATL::.*</Function>" + Environment.NewLine + 126@" <Function>.*::__GetTestMethodInfo.*</Function>" + Environment.NewLine + 127@" <Function>.*__CxxPureMSILEntry.*</Function>" + Environment.NewLine + 128@" <Function>^Microsoft::VisualStudio::CppCodeCoverageFramework::.*</Function>" + Environment.NewLine + 129@" <Function>^Microsoft::VisualStudio::CppUnitTestFramework::.*</Function>" + Environment.NewLine + 130@" <Function>^__empty_global_delete.*</Function>" + Environment.NewLine + 131@" </Exclude>" + Environment.NewLine + 132@" </Functions>" + Environment.NewLine + 133@" <Attributes>" + Environment.NewLine + 134@" <Exclude>" + Environment.NewLine + 135@" <Attribute>^System\.Diagnostics\.DebuggerHiddenAttribute$</Attribute>" + Environment.NewLine + 136@" <Attribute>^System\.Diagnostics\.DebuggerNonUserCodeAttribute$</Attribute>" + Environment.NewLine + 137@" <Attribute>^System\.Diagnostics\.CodeAnalysis\.ExcludeFromCodeCoverageAttribute$</Attribute>" + Environment.NewLine + 138@" <Attribute>^Microsoft\.VisualStudio\.TestPlatform\.TestSDKAutoGeneratedCode$</Attribute>" + Environment.NewLine + 139@" </Exclude>" + Environment.NewLine + 140@" </Attributes>" + Environment.NewLine + 141@" <Sources>" + Environment.NewLine + 142@" <Exclude>" + Environment.NewLine + 143@" <Source>.*\\atlmfc\\.*</Source>" + Environment.NewLine + 144@" <Source>.*\\vctools\\.*</Source>" + Environment.NewLine + 145@" <Source>.*\\public\\sdk\\.*</Source>" + Environment.NewLine + 146@" <Source>.*\\externalapis\\.*</Source>" + Environment.NewLine + 147@" <Source>.*\\microsoft sdks\\.*</Source>" + Environment.NewLine + 148@" <Source>.*\\vc\\include\\.*</Source>" + Environment.NewLine + 149@" <Source>.*\\msclr\\.*</Source>" + Environment.NewLine + 150@" <Source>.*\\ucrt\\.*</Source>" + Environment.NewLine + 151@" </Exclude>" + Environment.NewLine + 152@" </Sources>" + Environment.NewLine + 153@" <CompanyNames/>" + Environment.NewLine + 154@" <PublicKeyTokens/>" + Environment.NewLine + 155@" </CodeCoverage>" + Environment.NewLine + 156@" </Configuration>" + Environment.NewLine +
Processors\RunSpecificTestsArgumentProcessor.cs (1)
212if (Environment.GetEnvironmentVariable("VSTEST_MSBUILD_NOLOGO") != "1")
Processors\RunTestsArgumentProcessor.cs (1)
144if (Environment.GetEnvironmentVariable("VSTEST_MSBUILD_NOLOGO") != "1")
Processors\TestAdapterLoadingStrategyArgumentProcessor.cs (1)
209var testAdapterPath = _fileHelper.GetFullPath(Environment.ExpandEnvironmentVariables(adapterPath));
Publisher\MetricsPublisherFactory.cs (1)
22var logEnabled = Environment.GetEnvironmentVariable("VSTEST_LOGTELEMETRY");
Publisher\TextFileTelemetryPublisher.cs (1)
60string resultDirectory = Environment.GetEnvironmentVariable("VSTEST_LOGTELEMETRY_PATH")
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (8)
36var debugEnabled = Environment.GetEnvironmentVariable(environmentVariable); 55Environment.ProcessId; 76var vsAttachPath = Environment.GetEnvironmentVariable(env) ?? FindAttachVs(); 79Environment.SetEnvironmentVariable(env, vsAttachPath); 104var paths = Environment.GetEnvironmentVariable("PATH")!.Split(';'); 127var debugEnabled = Environment.GetEnvironmentVariable(environmentVariable); 154var nativeDebugEnabled = Environment.GetEnvironmentVariable(environmentVariable); 180return Environment.GetEnvironmentVariable("VSTEST_DEBUG_NOBP")?.Equals("1") ?? false;
TestPlatformHelpers\TestRequestManager.cs (1)
1455=> Environment.GetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN")?.Equals("1", StringComparison.Ordinal) == true;
vstest.console.arm64 (96)
src\vstest\src\Microsoft.TestPlatform.Execution.Shared\DebuggerBreakpoint.cs (8)
36var debugEnabled = Environment.GetEnvironmentVariable(environmentVariable); 55Environment.ProcessId; 76var vsAttachPath = Environment.GetEnvironmentVariable(env) ?? FindAttachVs(); 79Environment.SetEnvironmentVariable(env, vsAttachPath); 104var paths = Environment.GetEnvironmentVariable("PATH")!.Split(';'); 127var debugEnabled = Environment.GetEnvironmentVariable(environmentVariable); 154var nativeDebugEnabled = Environment.GetEnvironmentVariable(environmentVariable); 180return Environment.GetEnvironmentVariable("VSTEST_DEBUG_NOBP")?.Equals("1") ?? false;
src\vstest\src\vstest.console\CommandLine\Executor.cs (3)
85var additionalThreadsCount = Environment.ProcessorCount * 4; 152var diag = Environment.GetEnvironmentVariable("VSTEST_DIAG"); 154var diagVerbosity = Environment.GetEnvironmentVariable("VSTEST_DIAG_VERBOSITY");
src\vstest\src\vstest.console\InProcessVsTestConsoleWrapper.cs (1)
97Environment.ProcessId;
src\vstest\src\vstest.console\Internal\ConsoleLogger.cs (2)
269var prefix = string.Format(CultureInfo.CurrentCulture, "{0}{1}", Environment.NewLine, TestMessageFormattingPrefix); 270var messageText = message.Text?.Replace(Environment.NewLine, prefix).TrimEnd(TestMessageFormattingPrefix.ToCharArray());
src\vstest\src\vstest.console\Internal\MSBuildLogger.cs (5)
191var stackFrames = Regex.Split(result.ErrorStackTrace, Environment.NewLine); 322var prefix = string.Format(CultureInfo.CurrentCulture, "{0}{1}", Environment.NewLine, testMessageFormattingPrefix); 323var messageText = message.Text?.Replace(Environment.NewLine, prefix).TrimEnd(testMessageFormattingPrefix.ToCharArray()); 394string[] stackFrames = Regex.Split(errorStackTrace, Environment.NewLine); 452MethodInfo? getResourceStringMethod = typeof(Environment).GetMethod("GetResourceString", BindingFlags.Static | BindingFlags.NonPublic, null, [typeof(string)], null);
src\vstest\src\vstest.console\Processors\EnableCodeCoverageArgumentProcessor.cs (71)
86@" <DataCollector uri=""datacollector://microsoft/CodeCoverage/2.0"" assemblyQualifiedName=""Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=16.0.0.0 " + @", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"" friendlyName=""Code Coverage"">" + Environment.NewLine + 87@" <Configuration>" + Environment.NewLine + 88@" <CodeCoverage>" + Environment.NewLine + 89@" <ModulePaths>" + Environment.NewLine + 90@" <Exclude>" + Environment.NewLine + 91@" <ModulePath>.*CPPUnitTestFramework.*</ModulePath>" + Environment.NewLine + 92@" <ModulePath>.*vstest.console.*</ModulePath>" + Environment.NewLine + 93@" <ModulePath>.*microsoft.intellitrace.*</ModulePath>" + Environment.NewLine + 94@" <ModulePath>.*testhost.*</ModulePath>" + Environment.NewLine + 95@" <ModulePath>.*datacollector.*</ModulePath>" + Environment.NewLine + 96@" <ModulePath>.*microsoft.teamfoundation.testplatform.*</ModulePath>" + Environment.NewLine + 97@" <ModulePath>.*microsoft.visualstudio.testplatform.*</ModulePath>" + Environment.NewLine + 98@" <ModulePath>.*microsoft.visualstudio.testwindow.*</ModulePath>" + Environment.NewLine + 99@" <ModulePath>.*microsoft.visualstudio.mstest.*</ModulePath>" + Environment.NewLine + 100@" <ModulePath>.*microsoft.visualstudio.qualitytools.*</ModulePath>" + Environment.NewLine + 101@" <ModulePath>.*microsoft.vssdk.testhostadapter.*</ModulePath>" + Environment.NewLine + 102@" <ModulePath>.*microsoft.vssdk.testhostframework.*</ModulePath>" + Environment.NewLine + 103@" <ModulePath>.*qtagent32.*</ModulePath>" + Environment.NewLine + 104@" <ModulePath>.*msvcr.*dll$</ModulePath>" + Environment.NewLine + 105@" <ModulePath>.*msvcp.*dll$</ModulePath>" + Environment.NewLine + 106@" <ModulePath>.*clr.dll$</ModulePath>" + Environment.NewLine + 107@" <ModulePath>.*clr.ni.dll$</ModulePath>" + Environment.NewLine + 108@" <ModulePath>.*clrjit.dll$</ModulePath>" + Environment.NewLine + 109@" <ModulePath>.*clrjit.ni.dll$</ModulePath>" + Environment.NewLine + 110@" <ModulePath>.*mscoree.dll$</ModulePath>" + Environment.NewLine + 111@" <ModulePath>.*mscoreei.dll$</ModulePath>" + Environment.NewLine + 112@" <ModulePath>.*mscoreei.ni.dll$</ModulePath>" + Environment.NewLine + 113@" <ModulePath>.*mscorlib.dll$</ModulePath>" + Environment.NewLine + 114@" <ModulePath>.*mscorlib.ni.dll$</ModulePath>" + Environment.NewLine + 115@" </Exclude>" + Environment.NewLine + 116@" </ModulePaths>" + Environment.NewLine + 117@" <UseVerifiableInstrumentation>True</UseVerifiableInstrumentation>" + Environment.NewLine + 118@" <AllowLowIntegrityProcesses>True</AllowLowIntegrityProcesses>" + Environment.NewLine + 119@" <CollectFromChildProcesses>True</CollectFromChildProcesses>" + Environment.NewLine + 120@" <CollectAspDotNet>false</CollectAspDotNet>" + Environment.NewLine + 121@" <SymbolSearchPaths />" + Environment.NewLine + 122@" <Functions>" + Environment.NewLine + 123@" <Exclude>" + Environment.NewLine + 124@" <Function>^std::.*</Function>" + Environment.NewLine + 125@" <Function>^ATL::.*</Function>" + Environment.NewLine + 126@" <Function>.*::__GetTestMethodInfo.*</Function>" + Environment.NewLine + 127@" <Function>.*__CxxPureMSILEntry.*</Function>" + Environment.NewLine + 128@" <Function>^Microsoft::VisualStudio::CppCodeCoverageFramework::.*</Function>" + Environment.NewLine + 129@" <Function>^Microsoft::VisualStudio::CppUnitTestFramework::.*</Function>" + Environment.NewLine + 130@" <Function>^__empty_global_delete.*</Function>" + Environment.NewLine + 131@" </Exclude>" + Environment.NewLine + 132@" </Functions>" + Environment.NewLine + 133@" <Attributes>" + Environment.NewLine + 134@" <Exclude>" + Environment.NewLine + 135@" <Attribute>^System\.Diagnostics\.DebuggerHiddenAttribute$</Attribute>" + Environment.NewLine + 136@" <Attribute>^System\.Diagnostics\.DebuggerNonUserCodeAttribute$</Attribute>" + Environment.NewLine + 137@" <Attribute>^System\.Diagnostics\.CodeAnalysis\.ExcludeFromCodeCoverageAttribute$</Attribute>" + Environment.NewLine + 138@" <Attribute>^Microsoft\.VisualStudio\.TestPlatform\.TestSDKAutoGeneratedCode$</Attribute>" + Environment.NewLine + 139@" </Exclude>" + Environment.NewLine + 140@" </Attributes>" + Environment.NewLine + 141@" <Sources>" + Environment.NewLine + 142@" <Exclude>" + Environment.NewLine + 143@" <Source>.*\\atlmfc\\.*</Source>" + Environment.NewLine + 144@" <Source>.*\\vctools\\.*</Source>" + Environment.NewLine + 145@" <Source>.*\\public\\sdk\\.*</Source>" + Environment.NewLine + 146@" <Source>.*\\externalapis\\.*</Source>" + Environment.NewLine + 147@" <Source>.*\\microsoft sdks\\.*</Source>" + Environment.NewLine + 148@" <Source>.*\\vc\\include\\.*</Source>" + Environment.NewLine + 149@" <Source>.*\\msclr\\.*</Source>" + Environment.NewLine + 150@" <Source>.*\\ucrt\\.*</Source>" + Environment.NewLine + 151@" </Exclude>" + Environment.NewLine + 152@" </Sources>" + Environment.NewLine + 153@" <CompanyNames/>" + Environment.NewLine + 154@" <PublicKeyTokens/>" + Environment.NewLine + 155@" </CodeCoverage>" + Environment.NewLine + 156@" </Configuration>" + Environment.NewLine +
src\vstest\src\vstest.console\Processors\RunSpecificTestsArgumentProcessor.cs (1)
212if (Environment.GetEnvironmentVariable("VSTEST_MSBUILD_NOLOGO") != "1")
src\vstest\src\vstest.console\Processors\RunTestsArgumentProcessor.cs (1)
144if (Environment.GetEnvironmentVariable("VSTEST_MSBUILD_NOLOGO") != "1")
src\vstest\src\vstest.console\Processors\TestAdapterLoadingStrategyArgumentProcessor.cs (1)
209var testAdapterPath = _fileHelper.GetFullPath(Environment.ExpandEnvironmentVariables(adapterPath));
src\vstest\src\vstest.console\Publisher\MetricsPublisherFactory.cs (1)
22var logEnabled = Environment.GetEnvironmentVariable("VSTEST_LOGTELEMETRY");
src\vstest\src\vstest.console\Publisher\TextFileTelemetryPublisher.cs (1)
60string resultDirectory = Environment.GetEnvironmentVariable("VSTEST_LOGTELEMETRY_PATH")
src\vstest\src\vstest.console\TestPlatformHelpers\TestRequestManager.cs (1)
1455=> Environment.GetEnvironmentVariable("VSTEST_TELEMETRY_OPTEDIN")?.Equals("1", StringComparison.Ordinal) == true;
WithDockerfile.AppHost (1)
Program.cs (1)
44var baseImage = Environment.GetEnvironmentVariable("BASE_IMAGE") ?? "mcr.microsoft.com/oss/go/microsoft/golang:1.23";