6091 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,
AutobahnTestApp (1)
Program.cs (1)
33else if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("ASPNETCORE_PORT")))
AzureAppServicesHostingStartupSample (25)
Startup.cs (25)
17await context.Response.WriteAsync("Hello World - " + DateTimeOffset.Now + Environment.NewLine); 18await context.Response.WriteAsync(Environment.NewLine); 20await context.Response.WriteAsync("Address:" + Environment.NewLine); 21await context.Response.WriteAsync("Scheme: " + context.Request.Scheme + Environment.NewLine); 22await context.Response.WriteAsync("Host: " + context.Request.Headers.Host + Environment.NewLine); 23await context.Response.WriteAsync("PathBase: " + context.Request.PathBase.Value + Environment.NewLine); 24await context.Response.WriteAsync("Path: " + context.Request.Path.Value + Environment.NewLine); 25await context.Response.WriteAsync("Query: " + context.Request.QueryString.Value + Environment.NewLine); 26await context.Response.WriteAsync(Environment.NewLine); 28await context.Response.WriteAsync("Connection:" + Environment.NewLine); 29await context.Response.WriteAsync("RemoteIp: " + context.Connection.RemoteIpAddress + Environment.NewLine); 30await context.Response.WriteAsync("RemotePort: " + context.Connection.RemotePort + Environment.NewLine); 31await context.Response.WriteAsync("LocalIp: " + context.Connection.LocalIpAddress + Environment.NewLine); 32await context.Response.WriteAsync("LocalPort: " + context.Connection.LocalPort + Environment.NewLine); 33await context.Response.WriteAsync("ClientCert: " + context.Connection.ClientCertificate + Environment.NewLine); 34await context.Response.WriteAsync(Environment.NewLine); 36await context.Response.WriteAsync("User: " + context.User.Identity.Name + Environment.NewLine); 37await context.Response.WriteAsync(Environment.NewLine); 39await context.Response.WriteAsync("Headers:" + Environment.NewLine); 42await context.Response.WriteAsync(header.Key + ": " + header.Value + Environment.NewLine); 44await context.Response.WriteAsync(Environment.NewLine); 46await context.Response.WriteAsync("Environment Variables:" + Environment.NewLine); 47var vars = Environment.GetEnvironmentVariables(); 51await context.Response.WriteAsync(key + ": " + value + Environment.NewLine); 53await context.Response.WriteAsync(Environment.NewLine);
AzureAppServicesSample (25)
Startup.cs (25)
28await context.Response.WriteAsync("Hello World - " + DateTimeOffset.Now + Environment.NewLine); 29await context.Response.WriteAsync(Environment.NewLine); 31await context.Response.WriteAsync("Address:" + Environment.NewLine); 32await context.Response.WriteAsync("Scheme: " + context.Request.Scheme + Environment.NewLine); 33await context.Response.WriteAsync("Host: " + context.Request.Headers.Host + Environment.NewLine); 34await context.Response.WriteAsync("PathBase: " + context.Request.PathBase.Value + Environment.NewLine); 35await context.Response.WriteAsync("Path: " + context.Request.Path.Value + Environment.NewLine); 36await context.Response.WriteAsync("Query: " + context.Request.QueryString.Value + Environment.NewLine); 37await context.Response.WriteAsync(Environment.NewLine); 39await context.Response.WriteAsync("Connection:" + Environment.NewLine); 40await context.Response.WriteAsync("RemoteIp: " + context.Connection.RemoteIpAddress + Environment.NewLine); 41await context.Response.WriteAsync("RemotePort: " + context.Connection.RemotePort + Environment.NewLine); 42await context.Response.WriteAsync("LocalIp: " + context.Connection.LocalIpAddress + Environment.NewLine); 43await context.Response.WriteAsync("LocalPort: " + context.Connection.LocalPort + Environment.NewLine); 44await context.Response.WriteAsync("ClientCert: " + context.Connection.ClientCertificate + Environment.NewLine); 45await context.Response.WriteAsync(Environment.NewLine); 47await context.Response.WriteAsync("User: " + context.User.Identity.Name + Environment.NewLine); 48await context.Response.WriteAsync(Environment.NewLine); 50await context.Response.WriteAsync("Headers:" + Environment.NewLine); 53await context.Response.WriteAsync(header.Key + ": " + header.Value + Environment.NewLine); 55await context.Response.WriteAsync(Environment.NewLine); 57await context.Response.WriteAsync("Environment Variables:" + Environment.NewLine); 58var vars = Environment.GetEnvironmentVariables(); 62await context.Response.WriteAsync(key + ": " + value + Environment.NewLine); 64await context.Response.WriteAsync(Environment.NewLine);
BuildActionTelemetryTable (6)
Program.cs (3)
94var currentDirectory = new Uri(Environment.CurrentDirectory + "\\"); 164Console.WriteLine($"The following Actions are new and need their description reviewed:{Environment.NewLine}{string.Join(Environment.NewLine, missingDescriptions)}");
src\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
BuildValidator (3)
LocalReferenceResolver.cs (3)
90var nugetPackageDirectory = Environment.GetEnvironmentVariable("NUGET_PACKAGES"); 91nugetPackageDirectory ??= Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget");
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));
ClientSample (1)
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
48if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
CodeStyleConfigFileGenerator (3)
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;
CreateDefaultBuilderApp (1)
Program.cs (1)
46var contentRoot = Environment.GetEnvironmentVariable("ASPNETCORE_CONTENTROOT");
CreateDefaultBuilderOfTApp (1)
Program.cs (1)
57var contentRoot = Environment.GetEnvironmentVariable("ASPNETCORE_CONTENTROOT");
Crossgen2Tasks (4)
CommonFilePulledFromSdkRepo\TaskBase.cs (4)
70Environment.NewLine, 74Environment.NewLine); 95s = s + " ---> " + ExceptionToStringWithoutMessage(e.InnerException) + Environment.NewLine + 104s += Environment.NewLine + stackTrace;
csc (13)
src\Compilers\Shared\BuildClient.cs (1)
151var libDirectory = Environment.GetEnvironmentVariable("LIB");
src\Compilers\Shared\BuildServerConnection.cs (4)
212var originalThreadId = Environment.CurrentManagedThreadId; 273var releaseThreadId = Environment.CurrentManagedThreadId; 554var environmentVariables = GetServerEnvironmentVariables(Environment.GetEnvironmentVariables(), logger); 674var userName = Environment.UserName;
src\Compilers\Shared\CompilerServerLogger.cs (3)
120loggingFilePath = Environment.GetEnvironmentVariable(EnvironmentVariableName); 153var threadId = Environment.CurrentManagedThreadId; 155string output = prefix + message + Environment.NewLine;
src\Compilers\Shared\Csc.cs (1)
18: base(CSharpCommandLineParser.Default, responseFile, args, buildPaths, Environment.GetEnvironmentVariable("LIB"), analyzerLoader)
src\Compilers\Shared\ExitingTraceListener.cs (1)
58Environment.FailFast(message);
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}");
DefaultBuilder.SampleApp (1)
Startup.cs (1)
38var vars = Environment.GetEnvironmentVariables();
DelegationSite (1)
Program.cs (1)
15options.RequestQueueName = Environment.GetEnvironmentVariable("queue");
DeveloperExceptionPageSample (1)
Startup.cs (1)
43"New Line 2", Environment.NewLine,
dotnet-dev-certs (25)
Program.cs (3)
406"already trusted we will run the following command:" + Environment.NewLine + 408Environment.NewLine + "This command might prompt you for your password to install the certificate " + 409"on the keychain. To undo these changes: 'security remove-trusted-cert <<certificate>>'" + Environment.NewLine);
src\Shared\CertificateGeneration\CertificateManager.cs (1)
1042return string.Join(Environment.NewLine, description);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
25private static readonly string MacOSUserKeychain = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + "/Library/Keychains/login.keychain-db"; 33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https");
src\Shared\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);
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
48if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
src\Tools\Shared\CommandLine\CliContext.cs (1)
20bool.TryParse(Environment.GetEnvironmentVariable("DOTNET_CLI_CONTEXT_VERBOSE"), out bool globalVerbose);
src\Tools\Shared\CommandLine\DebugHelper.cs (1)
24Console.WriteLine($"Process ID: {Environment.ProcessId}");
dotnet-getdocument (5)
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
48if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
src\Tools\GetDocumentInsider\src\ReporterExtensions.cs (2)
31Environment.NewLine, 33.Split(new[] { Environment.NewLine }, StringSplitOptions.None)
src\Tools\Shared\CommandLine\CliContext.cs (1)
20bool.TryParse(Environment.GetEnvironmentVariable("DOTNET_CLI_CONTEXT_VERBOSE"), out bool globalVerbose);
src\Tools\Shared\CommandLine\DebugHelper.cs (1)
24Console.WriteLine($"Process ID: {Environment.ProcessId}");
dotnet-openapi (4)
DebugMode.cs (1)
19Console.WriteLine("Waiting for debugger in pid: {0}", Environment.ProcessId);
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
48if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
src\Tools\Shared\CommandLine\CliContext.cs (1)
20bool.TryParse(Environment.GetEnvironmentVariable("DOTNET_CLI_CONTEXT_VERBOSE"), out bool globalVerbose);
src\Tools\Shared\CommandLine\DebugHelper.cs (1)
24Console.WriteLine($"Process ID: {Environment.ProcessId}");
dotnet-razorpagegenerator (2)
Program.cs (2)
130var diagnostics = string.Join(Environment.NewLine, cSharpDocument.Diagnostics); 131Console.WriteLine($"One or more parse errors encountered. This will not prevent the generator from continuing: {Environment.NewLine}{diagnostics}.");
dotnet-sql-cache (3)
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
48if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
src\Tools\Shared\CommandLine\CliContext.cs (1)
20bool.TryParse(Environment.GetEnvironmentVariable("DOTNET_CLI_CONTEXT_VERBOSE"), out bool globalVerbose);
src\Tools\Shared\CommandLine\DebugHelper.cs (1)
24Console.WriteLine($"Process ID: {Environment.ProcessId}");
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)
136var optionsString = schemeNameOption.HasValue() ? $"{Resources.JwtPrint_Scheme}: {scheme}{Environment.NewLine}" : string.Empty; 138var name = nameOption.HasValue() ? nameOption.Value() : Environment.UserName; 139optionsString += $"{Resources.JwtPrint_Name}: {name}{Environment.NewLine}"; 142optionsString += audienceOption.HasValue() ? $"{Resources.JwtPrint_Audiences}: {string.Join(", ", audience)}{Environment.NewLine}" : string.Empty; 149optionsString += issuerOption.HasValue() ? $"{Resources.JwtPrint_Issuer}: {issuer}{Environment.NewLine}" : string.Empty; 159optionsString += $"{Resources.JwtPrint_NotBefore}: {notBefore:O}{Environment.NewLine}"; 178optionsString += $"{Resources.JwtPrint_ExpiresOn}: {expiresOn:O}{Environment.NewLine}"; 198optionsString += $"{Resources.JwtPrint_ExpiresOn}: {expiresOn:O}{Environment.NewLine}"; 203optionsString += rolesOption.HasValue() ? $"{Resources.JwtPrint_Roles}: [{string.Join(", ", roles)}]{Environment.NewLine}" : string.Empty; 206optionsString += scopesOption.HasValue() ? $"{Resources.JwtPrint_Scopes}: {string.Join(", ", scopes)}{Environment.NewLine}" : string.Empty; 216optionsString += $"{Resources.JwtPrint_CustomClaims}: [{string.Join(", ", claims.Select(kvp => $"{kvp.Key}={kvp.Value}"))}]{Environment.NewLine}"; 224optionsString += appsettingsFileOption.HasValue() ? $"{Resources.JwtPrint_appsettingsFile}: {appsettingsFile}{Environment.NewLine}" : string.Empty;
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
48if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
src\Tools\Shared\CommandLine\CliContext.cs (1)
20bool.TryParse(Environment.GetEnvironmentVariable("DOTNET_CLI_CONTEXT_VERBOSE"), out bool globalVerbose);
src\Tools\Shared\CommandLine\DebugHelper.cs (1)
24Console.WriteLine($"Process ID: {Environment.ProcessId}");
src\Tools\Shared\SecretsHelpers\UserSecretsCreator.cs (1)
64propertyGroup.Add($"{Environment.NewLine} ");
dotnet-user-secrets (4)
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
48if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
src\Tools\Shared\CommandLine\CliContext.cs (1)
20bool.TryParse(Environment.GetEnvironmentVariable("DOTNET_CLI_CONTEXT_VERBOSE"), out bool globalVerbose);
src\Tools\Shared\CommandLine\DebugHelper.cs (1)
24Console.WriteLine($"Process ID: {Environment.ProcessId}");
src\Tools\Shared\SecretsHelpers\UserSecretsCreator.cs (1)
64propertyGroup.Add($"{Environment.NewLine} ");
EventHubsConsumer (1)
Program.cs (1)
9bool useConsumer = Environment.GetEnvironmentVariable("USE_EVENTHUBCONSUMERCLIENT") == "yes";
ExampleTask (1)
ExampleTask.cs (1)
26string[] args = Environment.GetCommandLineArgs();
GenerateDocumentationAndConfigFiles (22)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (2)
99var parentPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
58if (Environment.OSVersion.Platform == PlatformID.Win32NT)
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\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
112: this(factory, Environment.ProcessorCount * 2, trimOnFree)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingOptions2.cs (1)
47_ => Environment.NewLine
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\LineFormattingOptions.cs (1)
19[DataMember] public string NewLine { get; init; } = Environment.NewLine;
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
285: reason + Environment.NewLine + restString;
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;
GetDocument.Insider (7)
.packages\microsoft.extensions.hostfactoryresolver.sources\11.0.0-preview.5.26256.105\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (1)
33if (uint.TryParse(Environment.GetEnvironmentVariable(TimeoutEnvironmentKey), out uint timeoutInSeconds))
Commands\GetDocumentCommandWorker.cs (1)
311writer.WriteLine(string.Join(Environment.NewLine, filePathList));
ReporterExtensions.cs (2)
31Environment.NewLine, 33.Split(new[] { Environment.NewLine }, StringSplitOptions.None)
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
48if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
src\Tools\Shared\CommandLine\CliContext.cs (1)
20bool.TryParse(Environment.GetEnvironmentVariable("DOTNET_CLI_CONTEXT_VERBOSE"), out bool globalVerbose);
src\Tools\Shared\CommandLine\DebugHelper.cs (1)
24Console.WriteLine($"Process ID: {Environment.ProcessId}");
HealthChecksSample (1)
LivenessProbeStartup.cs (1)
60await context.Response.WriteAsync(Environment.NewLine);
HelixTestRunner (20)
HelixTestRunnerOptions.cs (3)
77DotnetRoot = Environment.GetEnvironmentVariable("DOTNET_ROOT"), 78HELIX_WORKITEM_ROOT = Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT"), 79Path = Environment.GetEnvironmentVariable("PATH"),
ProcessUtil.cs (6)
25var dumpDirectoryPath = Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"); 40var dumpDirectoryPath = Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"); 62if (!File.Exists($"{Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT")}/dotnet-dump") && 63!File.Exists($"{Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT")}/dotnet-dump.exe")) 68return RunAsync($"{Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT")}/dotnet-dump", $"collect -p {pid} -o \"{dumpFilePath}\""); 103dumpDirectoryPath ??= Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER");
Program.cs (4)
43Environment.Exit(1); 56Environment.Exit(exitCode); 60Environment.Exit(1); 65Environment.Exit(1);
TestRunner.cs (7)
41var dumpPath = Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"); 49var playwrightBrowsers = Environment.GetEnvironmentVariable("PLAYWRIGHT_BROWSERS_PATH"); 107ProcessUtil.PrintMessage($"Installing Playwright Browsers to {Environment.GetEnvironmentVariable("PLAYWRIGHT_BROWSERS_PATH")}"); 111DisplayContents(Environment.GetEnvironmentVariable("PLAYWRIGHT_BROWSERS_PATH")); 125var correlationPayload = Environment.GetEnvironmentVariable("HELIX_CORRELATION_PAYLOAD"); 248var diagLog = Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_UPLOAD_ROOT"), "vstest.log"); 319var HELIX_WORKITEM_UPLOAD_ROOT = Environment.GetEnvironmentVariable("HELIX_WORKITEM_UPLOAD_ROOT");
HotAddSample (1)
Startup.cs (1)
52await context.Response.WriteAsync(ex.ToString().Replace(Environment.NewLine, "<br>"));
Http2SampleApp (1)
Program.cs (1)
79Console.WriteLine($"Process ID: {Environment.ProcessId}");
IdeBenchmarks (5)
InheritanceMargin\InheritanceMarginGlyphBenchmarks.cs (3)
197builder.Append(Environment.NewLine); 207builder.Append(Environment.NewLine); 219builder.Append(Environment.NewLine);
InheritanceMargin\InheritanceMarginServiceBenchmarks.cs (1)
35var roslynRoot = Environment.GetEnvironmentVariable(Program.RoslynRootPathEnvVariableName);
Program.cs (1)
34Environment.SetEnvironmentVariable(RoslynRootPathEnvVariableName, GetRoslynRootLocation());
IdeCoreBenchmarks (22)
ClassificationBenchmarks.cs (2)
44var roslynRoot = Environment.GetEnvironmentVariable(Program.RoslynRootPathEnvVariableName); 54var roslynRoot = Environment.GetEnvironmentVariable(Program.RoslynRootPathEnvVariableName);
CSharpIdeAnalyzerBenchmarks.cs (1)
36var roslynRoot = Environment.GetEnvironmentVariable(Program.RoslynRootPathEnvVariableName);
FindReferencesBenchmarks.cs (2)
43var roslynRoot = Environment.GetEnvironmentVariable(Program.RoslynRootPathEnvVariableName); 53var roslynRoot = Environment.GetEnvironmentVariable(Program.RoslynRootPathEnvVariableName);
FormatterBenchmarks.cs (8)
29var roslynRoot = Environment.GetEnvironmentVariable(Program.RoslynRootPathEnvVariableName); 39.Replace($"{{{Environment.NewLine}{Environment.NewLine}", "{") 40.Replace($"}}{Environment.NewLine}{Environment.NewLine}", "}") 41.Replace($"{{{Environment.NewLine}", "{") 42.Replace($"}}{Environment.NewLine}", "}") 43.Replace($";{Environment.NewLine}", ";");
IncrementalAnalyzerBenchmarks.cs (1)
35var roslynRoot = Environment.GetEnvironmentVariable(Program.RoslynRootPathEnvVariableName);
IncrementalSourceGeneratorBenchmarks.cs (3)
46var roslynRoot = Environment.GetEnvironmentVariable(Program.RoslynRootPathEnvVariableName); 56var roslynRoot = Environment.GetEnvironmentVariable(Program.RoslynRootPathEnvVariableName); 176Environment.Exit(0);
NavigateToBenchmarks.cs (2)
47var roslynRoot = Environment.GetEnvironmentVariable(Program.RoslynRootPathEnvVariableName); 57var roslynRoot = Environment.GetEnvironmentVariable(Program.RoslynRootPathEnvVariableName);
Program.cs (1)
42Environment.SetEnvironmentVariable(RoslynRootPathEnvVariableName, GetRoslynRootLocation());
RenameBenchmarks.cs (1)
27var roslynRoot = Environment.GetEnvironmentVariable(Program.RoslynRootPathEnvVariableName);
SyntacticChangeRangeBenchmark.cs (1)
32var roslynRoot = Environment.GetEnvironmentVariable(Program.RoslynRootPathEnvVariableName);
IIS.Common.TestLib (7)
TestConnections.cs (7)
149$"Did not receive a complete response within {Timeout}.{Environment.NewLine}{Environment.NewLine}" + 150$"Expected:{Environment.NewLine}{length} bytes of data{Environment.NewLine}{Environment.NewLine}" + 151$"Actual:{Environment.NewLine}{Encoding.ASCII.GetString(actual, 0, offset)}{Environment.NewLine}",
IIS.FunctionalTests (19)
src\Servers\IIS\IIS\test\Common.FunctionalTests\BasicAuthTests.cs (2)
49var username = Environment.GetEnvironmentVariable("ASPNETCORE_MODULE_TEST_USER"); 50var password = Environment.GetEnvironmentVariable("ASPNETCORE_MODULE_TEST_PASSWORD");
src\Servers\IIS\IIS\test\Common.FunctionalTests\CompressionTests.cs (2)
48var message = i + Environment.NewLine; 90var message = i + Environment.NewLine;
src\Servers\IIS\IIS\test\Common.FunctionalTests\Http2Tests.cs (2)
164if (Environment.OSVersion.Version < new Version(10, 0, 19041, 0)) 233if (Environment.OSVersion.Version < new Version(10, 0, 19041, 0))
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\AppVerifier.cs (2)
18var enabledCodes = (Environment.GetEnvironmentVariable("APPVERIFIER_ENABLED_CODES") ?? "").Split(' '); 80RunProcessAndWaitForExit("appverif.exe", $"-configure {_codes} -for {_processName} -with ErrorReport={Environment.GetEnvironmentVariable("APPVERIFIER_LEVEL")}", AppVerifierCommandTimeout);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
227"Running test allowed log file to be empty." + Environment.NewLine);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresEnvironmentVariableAttribute.cs (1)
20public bool IsMet => !string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable(_name));
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (5)
35if (Environment.GetEnvironmentVariable("ASPNETCORE_TEST_SKIP_IIS") == "true") 55if (!File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", "w3wp.exe")) && !SkipInVSTSAttribute.RunningInVSTS) 61var ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema.xml"); 65ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema_v2.xml"); 95if (File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", module.DllName)) || SkipInVSTSAttribute.RunningInVSTS)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\SkipVSTSAttribute.cs (1)
13public static bool RunningInVSTS = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("SYSTEM_TASKDEFINITIONSURI"));
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (1)
259var message = i + Environment.NewLine;
src\Servers\IIS\IIS\test\Common.FunctionalTests\WindowsAuthTests.cs (2)
60Assert.Contains(Environment.UserName, responseText); 101Assert.Contains(Environment.UserName, responseText);
IIS.LongTests (10)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\AppVerifier.cs (2)
18var enabledCodes = (Environment.GetEnvironmentVariable("APPVERIFIER_ENABLED_CODES") ?? "").Split(' '); 80RunProcessAndWaitForExit("appverif.exe", $"-configure {_codes} -for {_processName} -with ErrorReport={Environment.GetEnvironmentVariable("APPVERIFIER_LEVEL")}", AppVerifierCommandTimeout);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
227"Running test allowed log file to be empty." + Environment.NewLine);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresEnvironmentVariableAttribute.cs (1)
20public bool IsMet => !string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable(_name));
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (5)
35if (Environment.GetEnvironmentVariable("ASPNETCORE_TEST_SKIP_IIS") == "true") 55if (!File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", "w3wp.exe")) && !SkipInVSTSAttribute.RunningInVSTS) 61var ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema.xml"); 65ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema_v2.xml"); 95if (File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", module.DllName)) || SkipInVSTSAttribute.RunningInVSTS)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\SkipVSTSAttribute.cs (1)
13public static bool RunningInVSTS = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("SYSTEM_TASKDEFINITIONSURI"));
IIS.NewHandler.FunctionalTests (10)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\AppVerifier.cs (2)
18var enabledCodes = (Environment.GetEnvironmentVariable("APPVERIFIER_ENABLED_CODES") ?? "").Split(' '); 80RunProcessAndWaitForExit("appverif.exe", $"-configure {_codes} -for {_processName} -with ErrorReport={Environment.GetEnvironmentVariable("APPVERIFIER_LEVEL")}", AppVerifierCommandTimeout);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
227"Running test allowed log file to be empty." + Environment.NewLine);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresEnvironmentVariableAttribute.cs (1)
20public bool IsMet => !string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable(_name));
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (5)
35if (Environment.GetEnvironmentVariable("ASPNETCORE_TEST_SKIP_IIS") == "true") 55if (!File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", "w3wp.exe")) && !SkipInVSTSAttribute.RunningInVSTS) 61var ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema.xml"); 65ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema_v2.xml"); 95if (File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", module.DllName)) || SkipInVSTSAttribute.RunningInVSTS)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\SkipVSTSAttribute.cs (1)
13public static bool RunningInVSTS = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("SYSTEM_TASKDEFINITIONSURI"));
IIS.ShadowCopy.Tests (10)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\AppVerifier.cs (2)
18var enabledCodes = (Environment.GetEnvironmentVariable("APPVERIFIER_ENABLED_CODES") ?? "").Split(' '); 80RunProcessAndWaitForExit("appverif.exe", $"-configure {_codes} -for {_processName} -with ErrorReport={Environment.GetEnvironmentVariable("APPVERIFIER_LEVEL")}", AppVerifierCommandTimeout);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
227"Running test allowed log file to be empty." + Environment.NewLine);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresEnvironmentVariableAttribute.cs (1)
20public bool IsMet => !string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable(_name));
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresIISAttribute.cs (5)
35if (Environment.GetEnvironmentVariable("ASPNETCORE_TEST_SKIP_IIS") == "true") 55if (!File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", "w3wp.exe")) && !SkipInVSTSAttribute.RunningInVSTS) 61var ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema.xml"); 65ancmConfigPath = Path.Combine(Environment.SystemDirectory, "inetsrv", "config", "schema", "aspnetcore_schema_v2.xml"); 95if (File.Exists(Path.Combine(Environment.SystemDirectory, "inetsrv", module.DllName)) || SkipInVSTSAttribute.RunningInVSTS)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\SkipVSTSAttribute.cs (1)
13public static bool RunningInVSTS = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("SYSTEM_TASKDEFINITIONSURI"));
IIS.Tests (3)
TlsHandshakeFeatureTests.cs (1)
55if (Environment.OSVersion.Version > new Version(10, 0, 19043, 0))
Utilities\TestServer.cs (2)
32internal static string HostableWebCoreLocation => Environment.ExpandEnvironmentVariables($@"%windir%\system32\inetsrv\{HWebCoreDll}"); 35Environment.Is64BitProcess ? "x64" : "x86");
IISExpress.FunctionalTests (15)
src\Servers\IIS\IIS\test\Common.FunctionalTests\BasicAuthTests.cs (2)
49var username = Environment.GetEnvironmentVariable("ASPNETCORE_MODULE_TEST_USER"); 50var password = Environment.GetEnvironmentVariable("ASPNETCORE_MODULE_TEST_PASSWORD");
src\Servers\IIS\IIS\test\Common.FunctionalTests\CompressionTests.cs (2)
48var message = i + Environment.NewLine; 90var message = i + Environment.NewLine;
src\Servers\IIS\IIS\test\Common.FunctionalTests\Http2Tests.cs (2)
164if (Environment.OSVersion.Version < new Version(10, 0, 19041, 0)) 233if (Environment.OSVersion.Version < new Version(10, 0, 19041, 0))
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\AppVerifier.cs (2)
18var enabledCodes = (Environment.GetEnvironmentVariable("APPVERIFIER_ENABLED_CODES") ?? "").Split(' '); 80RunProcessAndWaitForExit("appverif.exe", $"-configure {_codes} -for {_processName} -with ErrorReport={Environment.GetEnvironmentVariable("APPVERIFIER_LEVEL")}", AppVerifierCommandTimeout);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\Helpers.cs (1)
227"Running test allowed log file to be empty." + Environment.NewLine);
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\RequiresEnvironmentVariableAttribute.cs (1)
20public bool IsMet => !string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable(_name));
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\SkipVSTSAttribute.cs (1)
13public static bool RunningInVSTS = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("SYSTEM_TASKDEFINITIONSURI"));
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (1)
259var message = i + Environment.NewLine;
src\Servers\IIS\IIS\test\Common.FunctionalTests\WindowsAuthTests.cs (2)
60Assert.Contains(Environment.UserName, responseText); 101Assert.Contains(Environment.UserName, responseText);
UpgradeFeatureDetectionTests.cs (1)
19private readonly string _isWebsocketsSupported = Environment.OSVersion.Version >= new Version(6, 2) ? "Enabled" : "Disabled";
IISSample (26)
Startup.cs (26)
42await context.Response.WriteAsync("Hello World - " + DateTimeOffset.Now + Environment.NewLine); 43await context.Response.WriteAsync(Environment.NewLine); 45await context.Response.WriteAsync("Address:" + Environment.NewLine); 46await context.Response.WriteAsync("Scheme: " + context.Request.Scheme + Environment.NewLine); 47await context.Response.WriteAsync("Host: " + context.Request.Headers["Host"] + Environment.NewLine); 48await context.Response.WriteAsync("PathBase: " + context.Request.PathBase.Value + Environment.NewLine); 49await context.Response.WriteAsync("Path: " + context.Request.Path.Value + Environment.NewLine); 50await context.Response.WriteAsync("Query: " + context.Request.QueryString.Value + Environment.NewLine); 51await context.Response.WriteAsync(Environment.NewLine); 53await context.Response.WriteAsync("Connection:" + Environment.NewLine); 54await context.Response.WriteAsync("RemoteIp: " + context.Connection.RemoteIpAddress + Environment.NewLine); 55await context.Response.WriteAsync("RemotePort: " + context.Connection.RemotePort + Environment.NewLine); 56await context.Response.WriteAsync("LocalIp: " + context.Connection.LocalIpAddress + Environment.NewLine); 57await context.Response.WriteAsync("LocalPort: " + context.Connection.LocalPort + Environment.NewLine); 58await context.Response.WriteAsync("ClientCert: " + context.Connection.ClientCertificate + Environment.NewLine); 59await context.Response.WriteAsync(Environment.NewLine); 61await context.Response.WriteAsync("User: " + context.User.Identity.Name + Environment.NewLine); 63await context.Response.WriteAsync("DisplayName: " + scheme?.DisplayName + Environment.NewLine); 64await context.Response.WriteAsync(Environment.NewLine); 66await context.Response.WriteAsync("Headers:" + Environment.NewLine); 69await context.Response.WriteAsync(header.Key + ": " + header.Value + Environment.NewLine); 71await context.Response.WriteAsync(Environment.NewLine); 73await context.Response.WriteAsync("Environment Variables:" + Environment.NewLine); 74var vars = Environment.GetEnvironmentVariables(); 78await context.Response.WriteAsync(key + ": " + value + Environment.NewLine); 81await context.Response.WriteAsync(Environment.NewLine);
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);
InMemory.FunctionalTests (10)
HttpsTests.cs (2)
193userMessage: string.Join(Environment.NewLine, loggerProvider.ErrorLogger.ErrorMessages)); 222userMessage: string.Join(Environment.NewLine, loggerProvider.ErrorLogger.ErrorMessages));
src\Servers\Kestrel\shared\test\RevocationResponder.cs (1)
15Environment.GetEnvironmentVariable("TRACE_REVOCATION_RESPONSE") != null;
src\Servers\Kestrel\shared\test\StreamBackedTestConnection.cs (7)
119throw new TimeoutException($"Did not receive a complete response within {Timeout}.{Environment.NewLine}{Environment.NewLine}" + 120$"Expected:{Environment.NewLine}{expected}{Environment.NewLine}{Environment.NewLine}" + 121$"Actual:{Environment.NewLine}{new string(actual, 0, offset)}{Environment.NewLine}",
InProcessWebSite (24)
Startup.cs (24)
39if (Environment.GetEnvironmentVariable("ENABLE_HTTPS_REDIRECTION") != null) 67private async Task CurrentDirectory(HttpContext ctx) => await ctx.Response.WriteAsync(Environment.CurrentDirectory); 75await ctx.Response.WriteAsync("IIS Version: " + config["IIS_VERSION"] + Environment.NewLine); 76await ctx.Response.WriteAsync("ApplicationId: " + config["IIS_APPLICATION_ID"] + Environment.NewLine); 77await ctx.Response.WriteAsync("Application Path: " + config["IIS_PHYSICAL_PATH"] + Environment.NewLine); 78await ctx.Response.WriteAsync("Application Virtual Path: " + config["IIS_APPLICATION_VIRTUAL_PATH"] + Environment.NewLine); 79await ctx.Response.WriteAsync("Application Config Path: " + config["IIS_APP_CONFIG_PATH"] + Environment.NewLine); 80await ctx.Response.WriteAsync("AppPool ID: " + config["IIS_APP_POOL_ID"] + Environment.NewLine); 81await ctx.Response.WriteAsync("AppPool Config File: " + config["IIS_APP_POOL_CONFIG_FILE"] + Environment.NewLine); 82await ctx.Response.WriteAsync("Site ID: " + config["IIS_SITE_ID"] + Environment.NewLine); 91await ctx.Response.WriteAsync("IIS Version: " + envFeature.IISVersion + Environment.NewLine); 92await ctx.Response.WriteAsync("ApplicationId: " + envFeature.ApplicationId + Environment.NewLine); 93await ctx.Response.WriteAsync("Application Path: " + envFeature.ApplicationPhysicalPath + Environment.NewLine); 94await ctx.Response.WriteAsync("Application Virtual Path: " + envFeature.ApplicationVirtualPath + Environment.NewLine); 95await ctx.Response.WriteAsync("Application Config Path: " + envFeature.AppConfigPath + Environment.NewLine); 96await ctx.Response.WriteAsync("AppPool ID: " + envFeature.AppPoolId + Environment.NewLine); 97await ctx.Response.WriteAsync("AppPool Config File: " + envFeature.AppPoolConfigFile + Environment.NewLine); 98await ctx.Response.WriteAsync("Site ID: " + envFeature.SiteId + Environment.NewLine); 103private async Task ASPNETCORE_IIS_PHYSICAL_PATH(HttpContext ctx) => await ctx.Response.WriteAsync(Environment.GetEnvironmentVariable("ASPNETCORE_IIS_PHYSICAL_PATH")); 218await ctx.Response.WriteAsync(Environment.GetEnvironmentVariable(ctx.Request.Query["name"].ToString())); 675await ctx.Response.WriteAsync(line + Environment.NewLine); 707await ctx.Response.WriteAsync(line + Environment.NewLine); 1064await ctx.Response.WriteAsync(string.Join("|", Environment.GetCommandLineArgs().Skip(1))); 1128await context.Response.WriteAsync(Environment.ProcessId.ToString(CultureInfo.InvariantCulture));
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),
InteractiveHost.UnitTests (2)
AbstractInteractiveHostTests.cs (2)
45if (Environment.GetEnvironmentVariable("DOTNET_ROOT") == null) 58Environment.SetEnvironmentVariable("DOTNET_ROOT", dir);
Interop.FunctionalTests (6)
H2SpecCommands.cs (2)
29var root = Path.Combine(Environment.CurrentDirectory, "h2spec"); 276throw new Exception(string.Join(Environment.NewLine, failures));
Http3\Http3RequestTests.cs (2)
1210Assert.Fail("Bad log write: " + badLogWrite + Environment.NewLine + badLogWrite.Exception); 1296Assert.Fail("Bad log write: " + badLogWrite + Environment.NewLine + badLogWrite.Exception);
Http3\Http3TlsTests.cs (2)
517var appData = Environment.GetEnvironmentVariable("APPDATA"); 518var home = Environment.GetEnvironmentVariable("HOME");
InteropClient (2)
InteropClient.cs (2)
120.WithNotParsed(errors => Environment.Exit(1)) 857string keyFile = Environment.GetEnvironmentVariable("GOOGLE_APPLICATION_CREDENTIALS")!;
InteropTests (4)
src\Shared\Process\ProcessEx.cs (4)
124if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 126startInfo.EnvironmentVariables["NUGET_FALLBACK_PACKAGES"] = Environment.GetEnvironmentVariable("NUGET_FALLBACK_PACKAGES"); 228private static string GetNugetPackagesRestorePath() => (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("NUGET_RESTORE"))) 233: Environment.GetEnvironmentVariable("NUGET_RESTORE");
Kestrel.SampleApp (3)
Startup.cs (3)
55+ $"{Environment.NewLine}" 57+ $"{Environment.NewLine}" 60var response = $"hello, world{Environment.NewLine}";
Metrics (30)
Program.cs (2)
246await metricFile.WriteStringAsync(Environment.NewLine + Environment.NewLine).ConfigureAwait(false);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (2)
99var parentPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
58if (Environment.OSVersion.Platform == PlatformID.Win32NT)
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\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
112: this(factory, Environment.ProcessorCount * 2, trimOnFree)
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\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (1)
173foreach (var line in child.ToString().Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingOptions2.cs (1)
47_ => Environment.NewLine
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\LineFormattingOptions.cs (1)
19[DataMember] public string NewLine { get; init; } = Environment.NewLine;
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
285: reason + Environment.NewLine + restString;
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;
Metrics.Legacy (30)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (2)
99var parentPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
58if (Environment.OSVersion.Platform == PlatformID.Win32NT)
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\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
112: this(factory, Environment.ProcessorCount * 2, trimOnFree)
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\RoslynAnalyzers\Tools\Metrics\Program.cs (2)
246await metricFile.WriteStringAsync(Environment.NewLine + Environment.NewLine).ConfigureAwait(false);
src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (1)
173foreach (var line in child.ToString().Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingOptions2.cs (1)
47_ => Environment.NewLine
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\LineFormattingOptions.cs (1)
19[DataMember] public string NewLine { get; init; } = Environment.NewLine;
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
285: reason + Environment.NewLine + restString;
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.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.Arcade.Test.Common (1)
AssertEx.cs (1)
497itemSeparator: Environment.NewLine);
Microsoft.AspNetCore (2)
WebApplicationBuilder.cs (2)
258string cwd = System.Environment.CurrentDirectory; 259if (!OperatingSystem.IsWindows() || !string.Equals(cwd, System.Environment.SystemDirectory, StringComparison.OrdinalIgnoreCase))
Microsoft.AspNetCore.Analyzer.Testing (4)
CodeFixRunner.cs (2)
55Environment.NewLine, 57throw new InvalidOperationException($"Compilation failed:{Environment.NewLine}{message}");
DiagnosticVerifier.cs (1)
178_testOutputHelper?.WriteLine("Adding file: " + newFileName + Environment.NewLine + source);
TestSource.cs (1)
52testInput.Source = string.Join(Environment.NewLine, lines);
Microsoft.AspNetCore.App.Analyzers.Test (6)
Authorization\AddAuthorizationBuilderTests.cs (3)
730var fullSource = string.Join(Environment.NewLine, source, _testAuthorizationPolicyClassDeclaration); 731var fullFixedSource = string.Join(Environment.NewLine, fixedSource, _testAuthorizationPolicyClassDeclaration); 738var fullSource = string.Join(Environment.NewLine, source, _testAuthorizationPolicyClassDeclaration);
RouteEmbeddedLanguage\RoutePatternParserTests.cs (2)
186$"Parsing '{token.ValueText}' throws RoutePattern error '{ex.Message}'. Error not found in diagnostics: " + Environment.NewLine + 187string.Join(Environment.NewLine, tree.Diagnostics.Select(d => d.Message)));
Verifiers\CSharpAnalyzerVerifier.cs (1)
53Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT"),
Microsoft.AspNetCore.App.CodeFixes (1)
Authorization\AddAuthorizationBuilderFixer.cs (1)
122SyntaxFactory.EndOfLine(Environment.NewLine),
Microsoft.AspNetCore.App.UnitTests (6)
PackageTests.cs (2)
36Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT"), 40Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT") :
SharedFxTests.cs (2)
28Environment.GetEnvironmentVariable("DOTNET_ROOT"), 325Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT") :
TargetingPackTests.cs (2)
29Environment.GetEnvironmentVariable("DOTNET_ROOT"), 383Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT") :
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (9)
UserJwtsTests.cs (9)
99Assert.Equal($"Hello {Environment.UserName}!", await client.GetStringAsync("/secret")); 328Assert.Contains($"Name: {Environment.UserName}", output); 342Assert.Contains($"Name: {Environment.UserName}", output); 357Assert.Contains($"Name: {Environment.UserName}", output); 389Assert.Contains($"Name: {Environment.UserName}", output); 409Assert.Equal(Environment.UserName, deserialized.Name); 428Assert.Contains($"Name: {Environment.UserName}", output); 449Assert.Contains($"Name: {Environment.UserName}", output); 469Assert.Equal(Environment.UserName, deserialized.Name);
Microsoft.AspNetCore.Authentication.Test (1)
TwitterTests.cs (1)
307var expectedErrorMessage = "An error has occurred while calling the Twitter API, error's returned:" + Environment.NewLine
Microsoft.AspNetCore.Authentication.Twitter (1)
TwitterHandler.cs (1)
393errorMessageStringBuilder.Append(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.Authorization.Test (2)
DefaultAuthorizationServiceTests.cs (2)
1195Assert.Equal("Authorization failed. These requirements were not met:" + Environment.NewLine + "LogRequirement" + Environment.NewLine + "LogRequirement", message);
Microsoft.AspNetCore.BrowserTesting (7)
BrowserTestBase.cs (2)
21!string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("ContinuousIntegrationBuild")) || 22!string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("Helix"));
ContextInformation.cs (1)
54var uploadDir = Environment.GetEnvironmentVariable("HELIX_WORKITEM_UPLOAD_ROOT");
PageInformation.cs (4)
93var messageText = message.Text.Replace(Environment.NewLine, $"{Environment.NewLine} "); 96var logMessage = $"[{_page.Url}]{Environment.NewLine} {messageText}{Environment.NewLine} ({location})";
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.Analyzers.Tests (2)
ComponentParameterCaptureUnmatchedValuesMustBeUniqueTest.cs (2)
45var message = @"Component type 'ConsoleApplication1.TypeName' defines properties multiple parameters with CaptureUnmatchedValues. Properties: " + Environment.NewLine + 46"ConsoleApplication1.TypeName.MyOtherProperty" + Environment.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.SdkAnalyzers.Tests (2)
ComponentParameterCaptureUnmatchedValuesMustBeUniqueTest.cs (2)
45var message = @"Component type 'ConsoleApplication1.TypeName' defines properties multiple parameters with CaptureUnmatchedValues. Properties: " + Environment.NewLine + 46"ConsoleApplication1.TypeName.MyOtherProperty" + Environment.NewLine +
Microsoft.AspNetCore.Components.Server (1)
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.Server.Tests (4)
src\SignalR\common\SignalR.Common\test\Internal\Protocol\MessagePackHubProtocolTestBase.cs (4)
280Assert.True(string.Equals(actual, testData.Binary, StringComparison.Ordinal), $"Binary encoding changed from{Environment.NewLine} [{testData.Binary}]{Environment.NewLine} to{Environment.NewLine} [{actual}]{Environment.NewLine}Please verify the MsgPack output and update the baseline");
Microsoft.AspNetCore.Components.Testing (9)
Infrastructure\ParentProcessWatcher.cs (1)
20var pidStr = Environment.GetEnvironmentVariable("TEST_PARENT_PID");
Infrastructure\PlaywrightExtensions.cs (2)
29Environment.GetEnvironmentVariable("PLAYWRIGHT_RECORD_VIDEO"), 36Environment.GetEnvironmentVariable("E2E_ARTIFACTS_DIR")
Infrastructure\ReadinessNotificationService.cs (1)
24var readyUrl = Environment.GetEnvironmentVariable("E2E_READY_URL");
Infrastructure\ServerInstance.cs (2)
93environment["TEST_PARENT_PID"] = Environment.ProcessId.ToString(CultureInfo.InvariantCulture); 99var dotnetRoot = Environment.GetEnvironmentVariable("DOTNET_ROOT");
Infrastructure\TestReadinessHostingStartup.cs (3)
47var overrideTypeName = Environment.GetEnvironmentVariable("E2E_TEST_SERVICES_TYPE"); 48var overrideMethodName = Environment.GetEnvironmentVariable("E2E_TEST_SERVICES_METHOD"); 87var assemblyName = Environment.GetEnvironmentVariable("ASPNETCORE_HOSTINGSTARTUPASSEMBLIES");
Microsoft.AspNetCore.Components.Tests (6)
ParameterViewTest.Assignment.cs (6)
386$"also used to capture unmatched values. Unmatched values:" + Environment.NewLine + 387$"test1" + Environment.NewLine + 410$"also used to capture unmatched values. Unmatched values:" + Environment.NewLine + 411$"test2" + Environment.NewLine + 431$"Properties:" + Environment.NewLine + 432$"{nameof(HasDuplicateCaptureUnmatchedValuesProperty.CaptureUnmatchedValuesProp1)}" + Environment.NewLine +
Microsoft.AspNetCore.Components.WebAssembly (5)
Hosting\WebAssemblyCultureProvider.cs (1)
46if (Environment.GetEnvironmentVariable("__BLAZOR_SHARDED_ICU") == "1" &&
Hosting\WebAssemblyHost.cs (1)
170if (Environment.GetEnvironmentVariable("__BLAZOR_WEBASSEMBLY_WAIT_FOR_ROOT_COMPONENTS") == "true")
Rendering\WebAssemblyDispatcher.cs (1)
16public override bool CheckAccess() => _mainManagedThreadId == Environment.CurrentManagedThreadId;
Services\WebAssemblyConsoleLogger.cs (2)
17private static readonly string _newLineWithMessagePadding = Environment.NewLine + _messagePadding; 124logBuilder.Replace(Environment.NewLine, _newLineWithMessagePadding, len, message.Length);
Microsoft.AspNetCore.Components.WebAssembly.Server (4)
ComponentsWebAssemblyApplicationBuilderExtensions.cs (1)
26=> Environment.GetEnvironmentVariable(name) is { Length: > 0 } value ? value : null;
DebugProxyLauncher.cs (2)
43var noProxyEnvVar = Environment.GetEnvironmentVariable("NO_PROXY"); 63var ownerPid = Environment.ProcessId;
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
48if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
Microsoft.AspNetCore.Components.WebAssembly.Tests (4)
Hosting\WebAssemblyCultureProviderTest.cs (2)
46Environment.SetEnvironmentVariable("__BLAZOR_SHARDED_ICU", "1"); 62Environment.SetEnvironmentVariable("__BLAZOR_SHARDED_ICU", null);
Hosting\WebAssemblyHostBuilderTest.cs (2)
325Environment.SetEnvironmentVariable(testEnvVarKey, testEnvVarValue); 342Environment.SetEnvironmentVariable(testEnvVarKey, null);
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.Components.WebViewE2E.Test (6)
BasicBlazorHybridTest.cs (6)
21Console.WriteLine($"Current directory: {Environment.CurrentDirectory}"); 28Environment.SetEnvironmentVariable("PATH", newNativePath + ";" + Environment.GetEnvironmentVariable("PATH")); 29Console.WriteLine($"New PATH env var: {Environment.GetEnvironmentVariable("PATH")}"); 64"Fatal exception" + Environment.NewLine + 65error.ExceptionObject.ToString() + Environment.NewLine);
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.DataProtection.Tests (10)
Repositories\FileSystemXmlRepositoryTests.cs (3)
24? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "ASP.NET") 25: Path.Combine(Environment.GetEnvironmentVariable("HOME"), ".aspnet");
StringLoggerFactory.cs (4)
66"Provider: {0}" + Environment.NewLine + 67"Log level: {1}" + Environment.NewLine + 68"Event id: {2}" + Environment.NewLine + 69"Exception: {3}" + Environment.NewLine +
XmlAssert.cs (3)
41"Expected element:" + Environment.NewLine 42+ expected.ToString() + Environment.NewLine 43+ "Actual element:" + Environment.NewLine
Microsoft.AspNetCore.DeveloperCertificates.XPlat (19)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
1042return string.Join(Environment.NewLine, description);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
25private static readonly string MacOSUserKeychain = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + "/Library/Keychains/login.keychain-db"; 33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https");
src\Shared\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);
Microsoft.AspNetCore.Diagnostics (3)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (1)
304.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
src\Shared\Diagnostics\BaseView.cs (1)
293return string.Join("<br />" + Environment.NewLine,
src\Shared\RazorViews\BaseView.cs (1)
283return string.Join("<br />" + Environment.NewLine,
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (2)
src\Shared\Diagnostics\BaseView.cs (1)
293return string.Join("<br />" + Environment.NewLine,
src\Shared\RazorViews\BaseView.cs (1)
283return string.Join("<br />" + Environment.NewLine,
Microsoft.AspNetCore.FunctionalTests (2)
WebApplicationFunctionalTests.cs (2)
156var timeoutTicks = Environment.TickCount64 + InternalTesting.TaskExtensions.DefaultTimeoutDuration; 159while (!logWritten && Environment.TickCount < timeoutTicks)
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
src\Grpc\JsonTranscoding\src\Shared\X509CertificateHelpers.cs (1)
117Environment.NewLine,
Microsoft.AspNetCore.Hosting (8)
Internal\HostingLoggerExtensions.cs (1)
35message = message + Environment.NewLine + ex.Message;
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.Hosting.Tests (4)
GenericWebHostBuilderTests.cs (4)
23Environment.SetEnvironmentVariable("ASPNETCORE_" + randomEnvKey, "true"); 29Environment.SetEnvironmentVariable("ASPNETCORE_" + randomEnvKey, null); 36Environment.SetEnvironmentVariable("ASPNETCORE_" + randomEnvKey, "true"); 42Environment.SetEnvironmentVariable("ASPNETCORE_" + randomEnvKey, 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.Html.Abstractions.Tests (4)
HtmlContentBuilderExtensionsTest.cs (4)
25entry => Assert.Equal(Environment.NewLine, HtmlContentToString(entry))); 41entry => Assert.Equal(Environment.NewLine, HtmlContentToString(entry))); 58entry => Assert.Equal(Environment.NewLine, HtmlContentToString(entry))); 74entry => Assert.Equal(Environment.NewLine, HtmlContentToString(entry)));
Microsoft.AspNetCore.Http (1)
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.Http.Connections.Tests (7)
HttpConnectionDispatcherTests.cs (7)
558connection.LastSeenTicks = TimeSpan.FromMilliseconds(Environment.TickCount64) - disconnectTimeout - TimeSpan.FromTicks(1); 1280var initialTime = TimeSpan.FromMilliseconds(Environment.TickCount64); 1305connection.TryCancelSend(TimeSpan.FromMilliseconds(Environment.TickCount64) + options.TransportSendTimeout + TimeSpan.FromTicks(1)); 1321var initialTime = TimeSpan.FromMilliseconds(Environment.TickCount64); 1344connection.TryCancelSend(TimeSpan.FromMilliseconds(Environment.TickCount64) + options.TransportSendTimeout + TimeSpan.FromTicks(1)); 1365var initialTime = TimeSpan.FromMilliseconds(Environment.TickCount64); 1388connection.TryCancelSend(TimeSpan.FromMilliseconds(Environment.TickCount64) + options.TransportSendTimeout + TimeSpan.FromTicks(1));
Microsoft.AspNetCore.Http.Microbenchmarks (3)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (3)
357? Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT"), "RequestDelegateGenerator", "Baselines") 368newSource += Environment.NewLine; 377.Split(Environment.NewLine);
Microsoft.AspNetCore.HttpLogging (3)
HttpLog.cs (2)
45builder.Append(Environment.NewLine); 53builder.Append(Environment.NewLine);
W3CLoggingMiddleware.cs (1)
94_serverName ??= Environment.MachineName;
Microsoft.AspNetCore.HttpLogging.Tests (17)
FileLoggerProcessorTests.cs (13)
22TempPath = Path.Combine(Environment.CurrentDirectory, "_"); 53Assert.Equal(_messageOne + Environment.NewLine, File.ReadAllText(filePath)); 99Assert.Equal(_messageOne + Environment.NewLine, File.ReadAllText(filePathToday)); 101Assert.Equal(_messageTwo + Environment.NewLine, File.ReadAllText(filePathTomorrow)); 140Assert.Equal(_messageOne + Environment.NewLine, File.ReadAllText(filePath1)); 141Assert.Equal(_messageTwo + Environment.NewLine, File.ReadAllText(filePath2)); 404Assert.Equal(_messageOne + Environment.NewLine, File.ReadAllText(filePath1)); 405Assert.Equal(_messageTwo + Environment.NewLine, File.ReadAllText(filePath2)); 406Assert.Equal(_messageThree + Environment.NewLine, File.ReadAllText(filePath3)); 471Assert.Equal(_messageThree + Environment.NewLine, File.ReadAllText(filePath3)); 472Assert.Equal(_messageFour + Environment.NewLine, File.ReadAllText(filePath4)); 539Assert.Equal(_messageOne + Environment.NewLine, File.ReadAllText(filePath1)); 540Assert.Equal(_messageTwo + Environment.NewLine, File.ReadAllText(filePath2));
HttpLoggingMiddlewareTests.cs (4)
1363var lines = requestLog.Message.Split(Environment.NewLine); 1611var lines = Assert.Single(TestSink.Writes.Where(w => w.LogLevel >= LogLevel.Information)).Message.Split(Environment.NewLine); 1673var lines = Assert.Single(TestSink.Writes).Message.Split(Environment.NewLine); 1740var lines = Assert.Single(TestSink.Writes.Where(w => w.LogLevel >= LogLevel.Information)).Message.Split(Environment.NewLine);
Microsoft.AspNetCore.Identity.UI (2)
_Layout_cshtml.g.cs (2)
295$"we have looked at it in the following locations: {System.Environment.NewLine}{string.Join(System.Environment.NewLine, result.SearchedLocations)}.");
Microsoft.AspNetCore.InternalTesting (16)
AssemblyTestLog.cs (2)
41var maxPathString = Environment.GetEnvironmentVariable(MaxPathLengthEnvironmentVariableName); 226var stackTrace = Environment.StackTrace;
CultureReplacer.cs (2)
34_threadId = Environment.CurrentManagedThreadId; 73Assert.True(Environment.CurrentManagedThreadId == _threadId,
HelixHelper.cs (2)
13public static string GetTargetHelixQueue() => Environment.GetEnvironmentVariable("helix") ?? ""; 18var uploadRoot = Environment.GetEnvironmentVariable("HELIX_WORKITEM_UPLOAD_ROOT");
Logging\XunitLoggerProvider.cs (3)
47private static readonly string[] NewLineChars = new[] { Environment.NewLine }; 98if (message.EndsWith(Environment.NewLine, StringComparison.Ordinal)) 100message = message.Substring(0, message.Length - Environment.NewLine.Length);
Tracing\EventSourceValidator.cs (2)
103Environment.NewLine + string.Join(Environment.NewLine, errors));
xunit\AspNetTestRunner.cs (1)
102return new(totalTimeTaken, string.Join(Environment.NewLine, messages));
xunit\EnvironmentVariableSkipConditionAttribute.cs (1)
83return Environment.GetEnvironmentVariable(name);
xunit\MaximumOSVersionAttribute.cs (1)
74return Environment.OSVersion.Version;
xunit\MinimumOsVersionAttribute.cs (1)
70return Environment.OSVersion.Version;
xunit\SkipOnCIAttribute.cs (1)
41public static string GetIfOnAzdo() => Environment.GetEnvironmentVariable("AGENT_OS");
Microsoft.AspNetCore.InternalTesting.Tests (23)
AssemblyTestLogTests.cs (2)
392return string.Join(Environment.NewLine, input.Split(new[] { Environment.NewLine }, StringSplitOptions.None)
MaximumOSVersionTest.cs (4)
21Environment.OSVersion.Version.ToString().StartsWith("6.1", StringComparison.Ordinal), 32Environment.OSVersion.Version.ToString().StartsWith("6.1", StringComparison.Ordinal), 72Environment.OSVersion.Version.ToString().StartsWith("6.1", StringComparison.Ordinal), 86Assert.True(Environment.OSVersion.Version.ToString().StartsWith("6.1", StringComparison.Ordinal),
MinimumOSVersionTest.cs (3)
20Environment.OSVersion.Version.ToString().StartsWith("6.1", StringComparison.Ordinal), 31Environment.OSVersion.Version.ToString().StartsWith("6.1", StringComparison.Ordinal), 70Environment.OSVersion.Version.ToString().StartsWith("6.1", StringComparison.Ordinal),
QuarantinedTestAttributeTest.cs (2)
16if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX")) || !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("AGENT_OS")))
SkipOnCITests.cs (2)
16if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX")) || !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("AGENT_OS")))
XunitLoggerProviderTest.cs (10)
27"| [TIMESTAMP] TestCategory Information: This is some great information" + Environment.NewLine + 28"| [TIMESTAMP] TestCategory Trace: This is some unimportant information" + Environment.NewLine; 44Assert.Equal("| [TIMESTAMP] TestCategory Error: This is a bad error" + Environment.NewLine, MakeConsistent(testTestOutputHelper.Output)); 55logger.LogInformation("This is a" + Environment.NewLine + "multi-line" + Environment.NewLine + "message"); 59"| [TIMESTAMP] TestCategory Information: This is a" + Environment.NewLine + 60"| multi-line" + Environment.NewLine + 61"| message" + Environment.NewLine; 77logger.LogInformation("This is a" + Environment.NewLine + "multi-line" + Environment.NewLine + "message");
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.Core.Test (59)
ApiConventionMethodAttributeTest.cs (3)
147Environment.NewLine + 148string.Join(Environment.NewLine, attributes.Select(a => a.FullName)) + 149Environment.NewLine +
ApiConventionTypeAttributeTest.cs (3)
82Environment.NewLine + 83string.Join(Environment.NewLine, attributes.Select(a => a.ToString())) + 84Environment.NewLine +
ApplicationModels\ControllerActionDescriptorProviderTests.cs (28)
424"The following errors occurred with attribute routing information:" + Environment.NewLine + 425Environment.NewLine + 426"Error 1:" + Environment.NewLine + 427$"For action: '{controllerTypeInfo.FullName}.Unknown ({assemblyName})'" + Environment.NewLine + 430" a route or within a constraint, use '[[' or ']]' instead." + Environment.NewLine + 431Environment.NewLine + 432"Error 2:" + Environment.NewLine + 433$"For action: '{controllerTypeInfo.FullName}.Invalid ({assemblyName})'" + Environment.NewLine + 664"The following errors occurred with attribute routing information:" + Environment.NewLine + 665Environment.NewLine + 666"Error 1:" + Environment.NewLine + 668" must not define attribute routed actions and non attribute routed actions at the same time:" + Environment.NewLine + 671"HTTP Verbs: 'GET'" + Environment.NewLine + 673"Route Template: '(none)' - HTTP Verbs: 'DELETE, PATCH, POST, PUT'" + Environment.NewLine + 674Environment.NewLine + 706+ Environment.NewLine 707+ Environment.NewLine 709+ Environment.NewLine 712+ Environment.NewLine + 716+ Environment.NewLine 719"HTTP Verbs: ''" + Environment.NewLine + 720Environment.NewLine + 873"The following errors occurred with attribute routing information:" + Environment.NewLine + 874Environment.NewLine + 875"Error 1:" + Environment.NewLine + 876$"For action: '{controllerTypeInfo.FullName}.Get ({assemblyName})'" + Environment.NewLine + 1402.Split(new[] { Environment.NewLine }, StringSplitOptions.None) 1406.Split(new[] { Environment.NewLine }, StringSplitOptions.None)
ApplicationModels\InferParameterBindingInfoConventionTest.cs (6)
60Environment.NewLine + "TestModel a" + 61Environment.NewLine + "Car b"; 79Environment.NewLine + "TestModel a" + 80Environment.NewLine + "int b"; 98Environment.NewLine + "decimal a" + 99Environment.NewLine + "int b";
Infrastructure\ActionSelectorTest.cs (4)
506var actionNames = string.Join(Environment.NewLine, actions.Select(action => action.DisplayName)); 817"The following actions matched route data and had all constraints satisfied:" + Environment.NewLine + 818Environment.NewLine + 819"Ambiguous1" + Environment.NewLine +
Routing\AttributeRoutingTest.cs (15)
29"The following errors occurred with attribute routing information:" + Environment.NewLine + 30Environment.NewLine + 31"For action: 'InvalidTemplate'" + Environment.NewLine + 56"The following errors occurred with attribute routing information:" + Environment.NewLine + 57Environment.NewLine + 58"For action: 'DisallowedParameter'" + Environment.NewLine + 86"The following errors occurred with attribute routing information:" + Environment.NewLine + 87Environment.NewLine + 88"For action: 'DisallowedParameter1'" + Environment.NewLine + 90"Use '[foo]' in the route template to insert the value 'bleh'." + Environment.NewLine + 91Environment.NewLine + 92"For action: 'DisallowedParameter2'" + Environment.NewLine + 128"The following errors occurred with attribute routing information:" + Environment.NewLine + 129Environment.NewLine + 130"For action: 'Microsoft.AspNetCore.Mvc.Routing.AttributeRoutingTest+HomeController.Index'" + Environment.NewLine +
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (4)
XmlDataContractSerializerInputFormatterTest.cs (1)
534var inputStart = Encoding.UTF8.GetBytes("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + Environment.NewLine +
XmlDataContractSerializerOutputFormatterTest.cs (1)
690var newLine = Environment.NewLine;
XmlSerializerInputFormatterTest.cs (1)
554var inputStart = Encoding.UTF8.GetBytes("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + Environment.NewLine +
XmlSerializerOutputFormatterTest.cs (1)
74var newLine = Environment.NewLine;
Microsoft.AspNetCore.Mvc.FunctionalTests (27)
ContentNegotiationTest.cs (3)
59var expectedBody = $"{{{Environment.NewLine} \"name\": \"My name\",{Environment.NewLine}" + 60$" \"address\": \"My address\"{Environment.NewLine}}}";
HtmlGenerationTest.cs (10)
94Assert.Equal($"Vrijdag{Environment.NewLine}Month: FirstOne", response, ignoreLineEndingDifferences: true); 649"<label class=\"control-label col-md-2\" for=\"Name\">ItemName</label>" + Environment.NewLine + 650"<input id=\"Name\" name=\"Name\" type=\"text\" value=\"\" />" + Environment.NewLine + Environment.NewLine + 651"<label class=\"control-label col-md-2\" for=\"Id\">ItemNo</label>" + Environment.NewLine + 653Environment.NewLine + Environment.NewLine; 666var expected = "<label for=\"Description\">ItemDesc</label>" + Environment.NewLine + 667"<input id=\"Description\" name=\"Description\" type=\"text\" value=\"\" />" + Environment.NewLine + Environment.NewLine;
HtmlGenerationWithCultureTest.cs (2)
178throw new XunitException($"Unexpected correlation Id, reading values from document:{Environment.NewLine}{documentContent}"); 196throw new ArgumentException($"Document does not contain element that matches the selector {selector}: " + Environment.NewLine + document.DocumentElement.OuterHtml);
Infrastructure\HttpClientExtensions.cs (3)
29throw new InvalidOperationException("Response content could not be parsed as HTML: " + Environment.NewLine + content); 42string responseContent = string.Join(Environment.NewLine, response.Headers); 52throw EqualException.ForMismatchedValues(expectedStatusCode, response.StatusCode, $"Expected status code {expectedStatusCode}. Actual {response.StatusCode}. Response Content:" + Environment.NewLine + responseContent);
Infrastructure\IHtmlDocumentExtensions.cs (1)
16throw new ArgumentException($"Document does not contain element that matches the selector {selector}: " + Environment.NewLine + document.DocumentElement.OuterHtml);
Infrastructure\ResourceFile.cs (2)
133/// <remarks>Normalizes line endings to <see cref="Environment.NewLine"/>.</remarks> 173/// <remarks>Normalizes line endings to <see cref="Environment.NewLine"/>.</remarks>
RazorBuildTest.cs (1)
158await UpdateFile("/Pages/UpdateablePage.cshtml", "@page" + Environment.NewLine + "@GetType().Assembly");
RazorRuntimeCompilationHostingStartupTest.cs (1)
104await UpdateFile("/Pages/UpdateablePage.cshtml", "@page" + Environment.NewLine + "@GetType().Assembly");
SimpleTests.cs (3)
33var expected = "{" + Environment.NewLine 34+ " \"first\": \"wall\"," + Environment.NewLine 35+ " \"second\": \"floor\"" + Environment.NewLine
TempDataInCookiesTest.cs (1)
50throw new Exception($"Expected exactly one instance of TempDataSerializer based on NewtonsoftJson, but found {tempDataSerializers.Count} instance(s):" + Environment.NewLine + builder);
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.Razor.Extensions.UnitTests (2)
RazorPageDocumentClassifierPassTest.cs (2)
65absoluteIndex: 14 + Environment.NewLine.Length * 2, 68length: 5 + Environment.NewLine.Length,
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (2)
CompilationFailedException.cs (2)
24return Resources.CompilationFailed + Environment.NewLine + 26Environment.NewLine,
Microsoft.AspNetCore.Mvc.Razor.Test (53)
ApplicationParts\RazorCompiledItemFeatureProviderTest.cs (1)
94Environment.NewLine,
RazorPageTest.cs (3)
785var expected = string.Join(Environment.NewLine, 795v.WriteLiteral("Layout start" + Environment.NewLine); 803page.BodyContent = new HtmlString("body content" + Environment.NewLine);
RazorViewTest.cs (49)
236Environment.NewLine, 249v.Write("layout-content" + Environment.NewLine); 518Environment.NewLine, 561Environment.NewLine, 604Environment.NewLine, 649var htmlEncodedNewLine = htmlEncoder.Encode(Environment.NewLine); 651Environment.NewLine + 675v.Write("layout-content" + Environment.NewLine); 677v.Write(Environment.NewLine); 679v.Write(Environment.NewLine); 757Environment.NewLine, 824Environment.NewLine, 907v.Write("NestedLayout" + Environment.NewLine); 920v.Write("BaseLayout" + Environment.NewLine); 974v.Write("NestedLayout" + Environment.NewLine); 988v.Write("BaseLayout" + Environment.NewLine); 1060Environment.NewLine + 1062Environment.NewLine + 1064Environment.NewLine + 1066Environment.NewLine + 1082v.Write("layout-1" + Environment.NewLine); 1093v.Write("layout-2" + Environment.NewLine); 1129"HtmlEncode[[layout-2" + Environment.NewLine + 1130"]]bar-content" + Environment.NewLine + 1131"HtmlEncode[[layout-1" + Environment.NewLine + 1132"]]foo-content" + Environment.NewLine + 1152v.Write("layout-1" + Environment.NewLine); 1165v.Write("layout-2" + Environment.NewLine); 1298Environment.NewLine + 1300Environment.NewLine + 1303Environment.NewLine + 1304Environment.NewLine; 1320v.Write("NestedLayout" + Environment.NewLine); 1332v.Write("BaseLayout" + Environment.NewLine); 1368Environment.NewLine + 1370Environment.NewLine + 1372Environment.NewLine + 1379v.WriteLiteral("body content" + Environment.NewLine); 1382v.WriteLiteral("section-content-1" + Environment.NewLine); 1391v.Write("layout-1" + Environment.NewLine); 1426Environment.NewLine + 1428Environment.NewLine + 1437v.WriteLiteral("section-content-1" + Environment.NewLine); 1446v.Write("layout-1" + Environment.NewLine); 1484v.WriteLiteral("before-flush" + Environment.NewLine); 1525v.Write("layout-1" + Environment.NewLine); 1706Environment.NewLine, 1719v.WriteLiteral("ViewStart1" + Environment.NewLine); 1723v.WriteLiteral("ViewStart2" + Environment.NewLine);
Microsoft.AspNetCore.Mvc.RazorPages (1)
Infrastructure\DefaultPageHandlerMethodSelector.cs (1)
52throw new InvalidOperationException(Resources.FormatAmbiguousHandler(Environment.NewLine, ambiguousMethods));
Microsoft.AspNetCore.Mvc.RazorPages.Test (5)
ApplicationModels\TempDataFilterPageApplicationModelProviderTest.cs (1)
50Environment.NewLine +
Infrastructure\DefaultPageHandlerMethodSelectorTest.cs (4)
664Environment.NewLine + Environment.NewLine + methods; 724Environment.NewLine + Environment.NewLine + methods;
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.TagHelpers.Test (85)
AnchorTagHelperTest.cs (3)
550Environment.NewLine, 588Environment.NewLine, 626Environment.NewLine,
FormActionTagHelperTest.cs (4)
573Environment.NewLine, 611Environment.NewLine, 649Environment.NewLine, 687Environment.NewLine,
FormTagHelperTest.cs (3)
1066Environment.NewLine, 1100Environment.NewLine, 1134Environment.NewLine,
LabelTagHelperTest.cs (35)
43new TagHelperOutputContent(string.Empty, Environment.NewLine, Environment.NewLine, "Text") }, 45new TagHelperOutputContent(Environment.NewLine, string.Empty, "HtmlEncode[[Text]]", "Text") }, 48new TagHelperOutputContent(string.Empty, Environment.NewLine, Environment.NewLine, "Text") }, 50new TagHelperOutputContent(Environment.NewLine, string.Empty, "HtmlEncode[[Text]]", "Text") }, 52new TagHelperOutputContent(Environment.NewLine, "Hello World", "Hello World", "Text") }, 54new TagHelperOutputContent(string.Empty, Environment.NewLine, Environment.NewLine, "Text") }, 56new TagHelperOutputContent(Environment.NewLine, string.Empty, "HtmlEncode[[Text]]", "Text") }, 58new TagHelperOutputContent(Environment.NewLine, "Hello World", "Hello World", "Text") }, 73new TagHelperOutputContent(Environment.NewLine, string.Empty, "HtmlEncode[[Text]]", "NestedModel_Text") }, 75new TagHelperOutputContent(Environment.NewLine, "Hello World", "Hello World", "NestedModel_Text") }, 77new TagHelperOutputContent(string.Empty, Environment.NewLine, Environment.NewLine, "NestedModel_Text") }, 79new TagHelperOutputContent(Environment.NewLine, string.Empty, "HtmlEncode[[Text]]", "NestedModel_Text") }, 81new TagHelperOutputContent(Environment.NewLine, "Hello World", "Hello World", "NestedModel_Text") }, 83new TagHelperOutputContent(string.Empty, Environment.NewLine, Environment.NewLine, "NestedModel_Text") }, 98new TagHelperOutputContent(Environment.NewLine, string.Empty, "HtmlEncode[[Text]]", "z0__Text") }, 100new TagHelperOutputContent(Environment.NewLine, "Hello World", "Hello World", "z0__Text") }, 102new TagHelperOutputContent(string.Empty, Environment.NewLine, Environment.NewLine, "z0__Text") }, 104new TagHelperOutputContent(Environment.NewLine, string.Empty, "HtmlEncode[[Text]]", "z1__Text") }, 106new TagHelperOutputContent(Environment.NewLine, "Hello World", "Hello World", "z1__Text") }, 108new TagHelperOutputContent(string.Empty, Environment.NewLine, Environment.NewLine, "z1__Text") }, 123new TagHelperOutputContent(Environment.NewLine, string.Empty, "HtmlEncode[[Text]]", "z0__NestedModel_Text") }, 125new TagHelperOutputContent(Environment.NewLine, "Hello World", "Hello World", "z0__NestedModel_Text") }, 127new TagHelperOutputContent(string.Empty, Environment.NewLine, Environment.NewLine, "z0__NestedModel_Text") }, 129new TagHelperOutputContent(Environment.NewLine, string.Empty, "HtmlEncode[[Text]]", "z1__NestedModel_Text") }, 131new TagHelperOutputContent(Environment.NewLine, "Hello World", "Hello World", "z1__NestedModel_Text") }, 133new TagHelperOutputContent(string.Empty, Environment.NewLine, Environment.NewLine, "z1__NestedModel_Text") },
LinkTagHelperTest.cs (3)
838var expectedPostElement = Environment.NewLine + 892var expectedPostElement = Environment.NewLine + 951Environment.NewLine +
PartialTagHelperTest.cs (2)
572var expected = string.Join(Environment.NewLine, 704Environment.NewLine,
ScriptTagHelperTest.cs (3)
915Assert.Equal(Environment.NewLine + "<script>(isavailable()||document.write(\"JavaScriptEncode[[<script " + 947Assert.Equal(Environment.NewLine + "<script>(isavailable()||document.write(\"JavaScriptEncode[[<script " + 960Environment.NewLine +
SelectTagHelperTest.cs (17)
44var noneSelected = "<option></option>" + Environment.NewLine + 45"<option>HtmlEncode[[outer text]]</option>" + Environment.NewLine + 46"<option>HtmlEncode[[inner text]]</option>" + Environment.NewLine + 47"<option>HtmlEncode[[other text]]</option>" + Environment.NewLine; 48var innerSelected = "<option></option>" + Environment.NewLine + 49"<option>HtmlEncode[[outer text]]</option>" + Environment.NewLine + 50"<option selected=\"HtmlEncode[[selected]]\">HtmlEncode[[inner text]]</option>" + Environment.NewLine + 51"<option>HtmlEncode[[other text]]</option>" + Environment.NewLine; 52var outerSelected = "<option></option>" + Environment.NewLine + 53"<option selected=\"HtmlEncode[[selected]]\">HtmlEncode[[outer text]]</option>" + Environment.NewLine + 54"<option>HtmlEncode[[inner text]]</option>" + Environment.NewLine + 55"<option>HtmlEncode[[other text]]</option>" + Environment.NewLine; 368var expectedOptions = "<option>HtmlEncode[[0]]</option>" + Environment.NewLine 369+ "<option>HtmlEncode[[1]]</option>" + Environment.NewLine 370+ "<option>HtmlEncode[[2]]</option>" + Environment.NewLine 371+ "<option>HtmlEncode[[3]]</option>" + Environment.NewLine 372+ "<option>HtmlEncode[[4]]</option>" + Environment.NewLine;
TextAreaTagHelperTest.cs (10)
45Environment.NewLine }, 49Environment.NewLine }, 52Environment.NewLine + "HtmlEncode[[outer text]]" }, 56Environment.NewLine }, 59Environment.NewLine + "HtmlEncode[[inner text]]" }, 63Environment.NewLine }, 66Environment.NewLine + "HtmlEncode[[outer text]]" }, 70Environment.NewLine }, 73Environment.NewLine + "HtmlEncode[[inner text]]" }, 196var expectedContent = Environment.NewLine + "HtmlEncode[[model-value]]";
ValidationSummaryTagHelperTest.cs (5)
90$"Custom Content<ul><li style=\"display:none\"></li>{Environment.NewLine}</ul>", 264$"Custom Content<ul><li>{expectedError}</li>{Environment.NewLine}</ul>", 329$"Custom Content<ul><li>{expectedError0}</li>{Environment.NewLine}" + 330$"<li>{expectedError2}</li>{Environment.NewLine}</ul>", 642$"Custom Content<ul><li>{expectedError}</li>{Environment.NewLine}</ul>",
Microsoft.AspNetCore.Mvc.Test (1)
MvcServiceCollectionExtensionsTest.cs (1)
626string.Join(Environment.NewLine, serviceDescriptors.Select(sd => sd.ImplementationType)));
Microsoft.AspNetCore.Mvc.Testing (1)
.packages\microsoft.extensions.hostfactoryresolver.sources\11.0.0-preview.5.26256.105\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (1)
33if (uint.TryParse(Environment.GetEnvironmentVariable(TimeoutEnvironmentKey), out uint timeoutInSeconds))
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.Mvc.ViewFeatures.Test (375)
Buffers\ViewBufferTextWriterTest.cs (4)
64var newLine = Environment.NewLine; 83var newLine = Environment.NewLine; 108var newLine = Environment.NewLine; 141var newLine = Environment.NewLine;
DefaultDisplayTemplatesTest.cs (10)
47"<div class=\"HtmlEncode[[display-label]]\">HtmlEncode[[Property1]]</div>" + Environment.NewLine 49" SimpleDisplayText = p1</div>" + Environment.NewLine 50+ "<div class=\"HtmlEncode[[display-label]]\">HtmlEncode[[Prop2]]</div>" + Environment.NewLine 52" SimpleDisplayText = (null)</div>" + Environment.NewLine; 118var expected = "<div class=\"HtmlEncode[[display-label]]\">HtmlEncode[[Property1]]</div>" + Environment.NewLine + 119"<div class=\"HtmlEncode[[display-field]]\"></div>" + Environment.NewLine + 120"<div class=\"HtmlEncode[[display-label]]\">HtmlEncode[[Property3]]</div>" + Environment.NewLine + 121"<div class=\"HtmlEncode[[display-field]]\"></div>" + Environment.NewLine; 146"<div class=\"HtmlEncode[[display-label]]\">HtmlEncode[[Prop2]]</div>" + Environment.NewLine + 148" SimpleDisplayText = (null)</div>" + Environment.NewLine;
DefaultEditorTemplatesTest.cs (20)
152"<div class=\"HtmlEncode[[editor-label]]\"><label></label></div>" + Environment.NewLine 164"<div class=\"HtmlEncode[[editor-label]]\">Some string</div>" + Environment.NewLine 168"<div class=\"HtmlEncode[[editor-label]]\">Some string</div>" + Environment.NewLine 180Environment.NewLine + 184Environment.NewLine + 186Environment.NewLine + 190Environment.NewLine; 211Environment.NewLine + 215Environment.NewLine + 217Environment.NewLine + 221Environment.NewLine; 248Environment.NewLine + 252Environment.NewLine; 343Environment.NewLine + 346Environment.NewLine + 348Environment.NewLine + 351Environment.NewLine; 377Environment.NewLine + 382Environment.NewLine; 499Environment.NewLine +
Filters\TempDataApplicationModelProviderTest.cs (1)
52Environment.NewLine +
PartialViewResultTest.cs (3)
67Environment.NewLine, 105Environment.NewLine, 143Environment.NewLine,
Rendering\HtmlHelperDisplayExtensionsTest.cs (2)
17var expected = $"<div class=\"HtmlEncode[[display-label]]\">HtmlEncode[[SomeProperty]]</div>{Environment.NewLine}" + 18$"<div class=\"HtmlEncode[[display-field]]\">HtmlEncode[[PropValue]]</div>{Environment.NewLine}";
Rendering\HtmlHelperDropDownListExtensionsTest.cs (27)
25"<option value=\"HtmlEncode[[0]]\">HtmlEncode[[Zero]]</option>" + Environment.NewLine + 26"<option value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 27"<option value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 28"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 48"<option value=\"\">HtmlEncode[[--select--]]</option>" + Environment.NewLine + 49"<option value=\"HtmlEncode[[0]]\">HtmlEncode[[Zero]]</option>" + Environment.NewLine + 50"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 51"<option value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 52"<option value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 72"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[4]]\">HtmlEncode[[Four]]</option>" + Environment.NewLine + 73"<option value=\"HtmlEncode[[5]]\">HtmlEncode[[Five]]</option>" + Environment.NewLine + 97"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[4]]\">HtmlEncode[[Four]]</option>" + Environment.NewLine + 98"<option value=\"HtmlEncode[[5]]\">HtmlEncode[[Five]]</option>" + Environment.NewLine + 123"<option value=\"\">HtmlEncode[[--select--]]</option>" + Environment.NewLine + 124"<option value=\"HtmlEncode[[4]]\">HtmlEncode[[Four]]</option>" + Environment.NewLine + 125"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[5]]\">HtmlEncode[[Five]]</option>" + Environment.NewLine + 149"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[0]]\">HtmlEncode[[Zero]]</option>" + Environment.NewLine + 150"<option value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 151"<option value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 152"<option value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 172"<option value=\"HtmlEncode[[4]]\">HtmlEncode[[Four]]</option>" + Environment.NewLine + 173"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[5]]\">HtmlEncode[[Five]]</option>" + Environment.NewLine + 198"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[4]]\">HtmlEncode[[Four]]</option>" + Environment.NewLine + 199"<option value=\"HtmlEncode[[5]]\">HtmlEncode[[Five]]</option>" + Environment.NewLine + 223"<option value=\"\">HtmlEncode[[--select--]]</option>" + Environment.NewLine + 224"<option value=\"HtmlEncode[[4]]\">HtmlEncode[[Four]]</option>" + Environment.NewLine + 225"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[5]]\">HtmlEncode[[Five]]</option>" + Environment.NewLine +
Rendering\HtmlHelperListBoxExtensionsTest.cs (16)
25"<option value=\"HtmlEncode[[0]]\">HtmlEncode[[Zero]]</option>" + Environment.NewLine + 26"<option value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 27"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 28"<option value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 48"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[4]]\">HtmlEncode[[Four]]</option>" + Environment.NewLine + 49"<option value=\"HtmlEncode[[5]]\">HtmlEncode[[Five]]</option>" + Environment.NewLine + 73"<option value=\"HtmlEncode[[4]]\">HtmlEncode[[Four]]</option>" + Environment.NewLine + 74"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[5]]\">HtmlEncode[[Five]]</option>" + Environment.NewLine + 98"<option value=\"HtmlEncode[[0]]\">HtmlEncode[[Zero]]</option>" + Environment.NewLine + 99"<option value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 100"<option value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 101"<option value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 120"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[4]]\">HtmlEncode[[Four]]</option>" + Environment.NewLine + 121"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[5]]\">HtmlEncode[[Five]]</option>" + Environment.NewLine + 145"<option value=\"HtmlEncode[[4]]\">HtmlEncode[[Four]]</option>" + Environment.NewLine + 146"<option value=\"HtmlEncode[[5]]\">HtmlEncode[[Five]]</option>" + Environment.NewLine +
Rendering\HtmlHelperPartialExtensionsTest.cs (16)
401Environment.NewLine + 402"location1" + Environment.NewLine + 430Environment.NewLine + 431"location1" + Environment.NewLine + 459Environment.NewLine + 460"location1" + Environment.NewLine + 461"location2" + Environment.NewLine + 462"location3" + Environment.NewLine + 490Environment.NewLine + 491"location1" + Environment.NewLine + 519Environment.NewLine + 520"location1" + Environment.NewLine + 548Environment.NewLine + 549"location1" + Environment.NewLine + 550"location2" + Environment.NewLine + 551"location3" + Environment.NewLine +
Rendering\HtmlHelperSelectTest.cs (168)
84Environment.NewLine + 85"<option value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 86"<option value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 87"<option value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 90Environment.NewLine + 91"<option value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 92"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 93"<option value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 99Environment.NewLine + 101Environment.NewLine + 102"<option value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 103"<option disabled=\"HtmlEncode[[disabled]]\" value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 106Environment.NewLine + 107"<option disabled=\"HtmlEncode[[disabled]]\" value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 108"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 109"<option disabled=\"HtmlEncode[[disabled]]\" value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 115Environment.NewLine + 116"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[0]]\">HtmlEncode[[Zero]]</option>" + Environment.NewLine + 117"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 118"</optgroup>" + Environment.NewLine + 119"<optgroup label=\"HtmlEncode[[Group Two]]\">" + Environment.NewLine + 120"<option value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 121"</optgroup>" + Environment.NewLine + 122"<option value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 125Environment.NewLine + 126"<option value=\"HtmlEncode[[0]]\">HtmlEncode[[Zero]]</option>" + Environment.NewLine + 127"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 128"</optgroup>" + Environment.NewLine + 129"<optgroup label=\"HtmlEncode[[Group Two]]\">" + Environment.NewLine + 130"<option value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 131"</optgroup>" + Environment.NewLine + 132"<option value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 138Environment.NewLine + 139"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[0]]\">HtmlEncode[[Zero]]</option>" + Environment.NewLine + 140"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 141"<option value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 142"<option value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 143"</optgroup>" + Environment.NewLine + 146Environment.NewLine + 147"<option value=\"HtmlEncode[[0]]\">HtmlEncode[[Zero]]</option>" + Environment.NewLine + 148"<option value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 149"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 150"<option value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 151"</optgroup>" + Environment.NewLine + 157Environment.NewLine + 158"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[0]]\">HtmlEncode[[Zero]]</option>" + Environment.NewLine + 159"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 160"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 161"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 162"</optgroup>" + Environment.NewLine + 165Environment.NewLine + 166"<option value=\"HtmlEncode[[0]]\">HtmlEncode[[Zero]]</option>" + Environment.NewLine + 167"<option value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 168"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 169"<option value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 170"</optgroup>" + Environment.NewLine + 187Environment.NewLine + 188"<option value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 189"<option value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 190"<option value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 193Environment.NewLine + 194"<option value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 195"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 196"<option value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 199Environment.NewLine + 200"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 201"<option value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 202"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 208Environment.NewLine + 210Environment.NewLine + 211"<option value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 212"<option disabled=\"HtmlEncode[[disabled]]\" value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 215Environment.NewLine + 216"<option disabled=\"HtmlEncode[[disabled]]\" value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 217"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 218"<option disabled=\"HtmlEncode[[disabled]]\" value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 221Environment.NewLine + 222"<option disabled=\"HtmlEncode[[disabled]]\" selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 223"<option value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 224"<option disabled=\"HtmlEncode[[disabled]]\" selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 230Environment.NewLine + 231"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[0]]\">HtmlEncode[[Zero]]</option>" + Environment.NewLine + 232"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 233"</optgroup>" + Environment.NewLine + 234"<optgroup label=\"HtmlEncode[[Group Two]]\">" + Environment.NewLine + 235"<option value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 236"</optgroup>" + Environment.NewLine + 237"<option value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 240Environment.NewLine + 241"<option value=\"HtmlEncode[[0]]\">HtmlEncode[[Zero]]</option>" + Environment.NewLine + 242"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 243"</optgroup>" + Environment.NewLine + 244"<optgroup label=\"HtmlEncode[[Group Two]]\">" + Environment.NewLine + 245"<option value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 246"</optgroup>" + Environment.NewLine + 247"<option value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 250Environment.NewLine + 251"<option value=\"HtmlEncode[[0]]\">HtmlEncode[[Zero]]</option>" + Environment.NewLine + 252"<option value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 253"</optgroup>" + Environment.NewLine + 254"<optgroup label=\"HtmlEncode[[Group Two]]\">" + Environment.NewLine + 255"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 256"</optgroup>" + Environment.NewLine + 257"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 263Environment.NewLine + 264"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[0]]\">HtmlEncode[[Zero]]</option>" + Environment.NewLine + 265"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 266"<option value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 267"<option value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 268"</optgroup>" + Environment.NewLine + 271Environment.NewLine + 272"<option value=\"HtmlEncode[[0]]\">HtmlEncode[[Zero]]</option>" + Environment.NewLine + 273"<option value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 274"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 275"<option value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 276"</optgroup>" + Environment.NewLine + 279Environment.NewLine + 280"<option value=\"HtmlEncode[[0]]\">HtmlEncode[[Zero]]</option>" + Environment.NewLine + 281"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 282"<option value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 283"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 284"</optgroup>" + Environment.NewLine + 290"<optgroup disabled=\"HtmlEncode[[disabled]]\" label=\"HtmlEncode[[Disabled Group]]\">" + Environment.NewLine + 291"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[0]]\">HtmlEncode[[Zero]]</option>" + Environment.NewLine + 292"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 293"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 294"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 295"</optgroup>" + Environment.NewLine + 298"<optgroup disabled=\"HtmlEncode[[disabled]]\" label=\"HtmlEncode[[Disabled Group]]\">" + Environment.NewLine + 299"<option value=\"HtmlEncode[[0]]\">HtmlEncode[[Zero]]</option>" + Environment.NewLine + 300"<option value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 301"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 302"<option value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 303"</optgroup>" + Environment.NewLine + 306"<optgroup disabled=\"HtmlEncode[[disabled]]\" label=\"HtmlEncode[[Disabled Group]]\">" + Environment.NewLine + 307"<option value=\"HtmlEncode[[0]]\">HtmlEncode[[Zero]]</option>" + Environment.NewLine + 308"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 309"<option value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 310"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 311"</optgroup>" + Environment.NewLine + 697Environment.NewLine + 698"<option disabled=\"HtmlEncode[[disabled]]\" value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 699"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 700"<option disabled=\"HtmlEncode[[disabled]]\" value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 724"<select id=\"HtmlEncode[[unrelated]]\" name=\"HtmlEncode[[unrelated]]\"><option value=\"HtmlEncode[[0]]\">HtmlEncode[[Zero]]</option>" + Environment.NewLine + 725"<option disabled=\"HtmlEncode[[disabled]]\" value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 726"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 727"<option disabled=\"HtmlEncode[[disabled]]\" value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 1045Environment.NewLine + 1046"<option disabled=\"HtmlEncode[[disabled]]\" value=\"HtmlEncode[[1]]\">HtmlEncode[[One]]</option>" + Environment.NewLine + 1047"<option selected=\"HtmlEncode[[selected]]\" value=\"HtmlEncode[[2]]\">HtmlEncode[[Two]]</option>" + Environment.NewLine + 1048"<option disabled=\"HtmlEncode[[disabled]]\" value=\"HtmlEncode[[3]]\">HtmlEncode[[Three]]</option>" + Environment.NewLine + 1511$"{ GetOption(SelectSources.ModelStateEntry, source) }{ Environment.NewLine }" + 1512$"{ GetOption(SelectSources.ModelStateEntryWithPrefix, source) }{ Environment.NewLine }" + 1513$"{ GetOption(SelectSources.ViewDataEntry, source) }{ Environment.NewLine }" + 1514$"{ GetOption(SelectSources.PropertyOfViewDataEntry, source) }{ Environment.NewLine }" + 1515$"{ GetOption(SelectSources.ViewDataEntryWithPrefix, source) }{ Environment.NewLine }" + 1516$"{ GetOption(SelectSources.PropertyOfViewDataEntryWithPrefix, source) }{ Environment.NewLine }" + 1517$"{ GetOption(SelectSources.ModelValue, source) }{ Environment.NewLine }" + 1518$"{ GetOption(SelectSources.PropertyOfModel, source) }{ Environment.NewLine }" + 1526$"{ GetOption(SelectSources.ModelStateEntry, source) }{ Environment.NewLine }" + 1527$"{ GetOption(SelectSources.ModelStateEntryWithPrefix, source) }{ Environment.NewLine }" + 1528$"{ GetOption(SelectSources.ViewDataEntry, source) }{ Environment.NewLine }" + 1529$"{ GetOption(SelectSources.PropertyOfViewDataEntry, source) }{ Environment.NewLine }" + 1530$"{ GetOption(SelectSources.ViewDataEntryWithPrefix, source) }{ Environment.NewLine }" + 1531$"{ GetOption(SelectSources.PropertyOfViewDataEntryWithPrefix, source) }{ Environment.NewLine }" + 1532$"{ GetOption(SelectSources.ModelValue, source) }{ Environment.NewLine }" + 1533$"{ GetOption(SelectSources.PropertyOfModel, source) }{ Environment.NewLine }" +
Rendering\HtmlHelperTextAreaExtensionsTest.cs (7)
29"<textarea id=\"HtmlEncode[[Property1]]\" name=\"HtmlEncode[[Property1]]\">" + Environment.NewLine + 48"<textarea id=\"HtmlEncode[[Property1]]\" name=\"HtmlEncode[[Property1]]\">" + Environment.NewLine + 67"<textarea id=\"HtmlEncode[[Property1]]\" name=\"HtmlEncode[[Property1]]\">" + Environment.NewLine + 87Environment.NewLine + 107Environment.NewLine + 124"name=\"HtmlEncode[[Property1]]\" rows=\"HtmlEncode[[1]]\">" + Environment.NewLine + 141"name=\"HtmlEncode[[Property1]]\" rows=\"HtmlEncode[[1]]\">" + Environment.NewLine +
Rendering\HtmlHelperTextAreaTest.cs (6)
49"<textarea id=\"HtmlEncode[[pre_Property3_key_]]\" name=\"HtmlEncode[[pre.Property3[key]]]\">" + Environment.NewLine + 54"<textarea id=\"HtmlEncode[[pre_Property4_Property5]]\" name=\"HtmlEncode[[pre.Property4.Property5]]\">" + Environment.NewLine + 59"<textarea id=\"HtmlEncode[[pre_Property4_Property6_0_]]\" name=\"HtmlEncode[[pre.Property4.Property6[0]]]\">" + Environment.NewLine + 96"<textarea id=\"HtmlEncode[[pre_Property3_key_]]\" name=\"HtmlEncode[[pre.Property3[key]]]\">" + Environment.NewLine + 101"<textarea id=\"HtmlEncode[[pre_Property4_Property5]]\" name=\"HtmlEncode[[pre.Property4.Property5]]\">" + Environment.NewLine + 106"<textarea id=\"HtmlEncode[[pre_Property4_Property6_0_]]\" name=\"HtmlEncode[[pre.Property4.Property6[0]]]\">" + Environment.NewLine +
Rendering\HtmlHelperValidationSummaryTest.cs (84)
26"<ul><li style=\"display:none\"></li>" + Environment.NewLine + 30"<li style=\"display:none\"></li>" + Environment.NewLine + 33"<span>HtmlEncode[[This is my message]]</span>" + Environment.NewLine + 34"<ul><li style=\"display:none\"></li>" + Environment.NewLine + 37"<h3>HtmlEncode[[This is my message]]</h3>" + Environment.NewLine + 38"<ul><li style=\"display:none\"></li>" + Environment.NewLine + 42"<span>HtmlEncode[[This is my message]]</span>" + Environment.NewLine + 43"<ul><li style=\"display:none\"></li>" + Environment.NewLine + 47"<h3>HtmlEncode[[This is my message]]</h3>" + Environment.NewLine + 48"<ul><li style=\"display:none\"></li>" + Environment.NewLine + 75"<li>HtmlEncode[[This is my validation message]]</li>" + Environment.NewLine + 78"<li>HtmlEncode[[This is my validation message]]</li>" + Environment.NewLine + 97"<li>HtmlEncode[[This is an error for the model root.]]</li>" + Environment.NewLine + 98"<li>HtmlEncode[[This is another error for the model root.]]</li>" + Environment.NewLine + 101"<li>HtmlEncode[[This is an error for Property3.]]</li>" + Environment.NewLine + 104"<li>HtmlEncode[[This is an error for Property2.]]</li>" + Environment.NewLine + 105"<li>HtmlEncode[[This is another error for Property2.]]</li>" + Environment.NewLine + 106"<li>HtmlEncode[[The value '' is not valid for Property2.]]</li>" + Environment.NewLine + 107"<li>HtmlEncode[[This is an error for Property3.OrderedProperty3.]]</li>" + Environment.NewLine + 108"<li>HtmlEncode[[This is an error for Property3.OrderedProperty2.]]</li>" + Environment.NewLine + 109"<li>HtmlEncode[[This is an error for Property3.Property2.]]</li>" + Environment.NewLine + 110"<li>HtmlEncode[[This is an error for Property3.]]</li>" + Environment.NewLine + 111"<li>HtmlEncode[[This is an error for the model root.]]</li>" + Environment.NewLine + 112"<li>HtmlEncode[[This is another error for the model root.]]</li>" + Environment.NewLine + 302"<li>HtmlEncode[[New error for Property2.]]</li>" + Environment.NewLine + 303"<li>HtmlEncode[[This is an error for Property3.OrderedProperty3.]]</li>" + Environment.NewLine + 304"<li>HtmlEncode[[This is an error for Property3.Property2.]]</li>" + Environment.NewLine + 305"<li>HtmlEncode[[This is an error for the model root.]]</li>" + Environment.NewLine + 306"<li>HtmlEncode[[This is another error for the model root.]]</li>" + Environment.NewLine + 332"<li>HtmlEncode[[This is an error for Property2.]]</li>" + Environment.NewLine + 333"<li>HtmlEncode[[This is another error for Property2.]]</li>" + Environment.NewLine + 334"<li>HtmlEncode[[The value '' is not valid for Property2.]]</li>" + Environment.NewLine + 335"<li>HtmlEncode[[This is an error for Property3.OrderedProperty3.]]</li>" + Environment.NewLine + 336"<li>HtmlEncode[[This is an error for Property3.OrderedProperty2.]]</li>" + Environment.NewLine + 337"<li>HtmlEncode[[This is an error for Property3.Property2.]]</li>" + Environment.NewLine + 338"<li>HtmlEncode[[This is an error for Property3.]]</li>" + Environment.NewLine + 339"<li>HtmlEncode[[This is an error for the model root.]]</li>" + Environment.NewLine + 340"<li>HtmlEncode[[This is another error for the model root.]]</li>" + Environment.NewLine + 341"<li>HtmlEncode[[non-existent-error1]]</li>" + Environment.NewLine + 342"<li>HtmlEncode[[non-existent-error2]]</li>" + Environment.NewLine + 343"<li>HtmlEncode[[non-existent-error3]]</li>" + Environment.NewLine + 368"<li>HtmlEncode[[Property1 error]]</li>" + Environment.NewLine + 369"<li>HtmlEncode[[Property2[0].OrderedProperty1 error]]</li>" + Environment.NewLine + 370"<li>HtmlEncode[[Property2[0].Property1 error]]</li>" + Environment.NewLine + 371"<li>HtmlEncode[[Property2[2].Property3 error]]</li>" + Environment.NewLine + 372"<li>HtmlEncode[[Property2[10].Property2 error]]</li>" + Environment.NewLine + 398"<li>HtmlEncode[[[0].OrderedProperty2 error]]</li>" + Environment.NewLine + 399"<li>HtmlEncode[[[0].OrderedProperty1 error]]</li>" + Environment.NewLine + 400"<li>HtmlEncode[[[0].Property1 error]]</li>" + Environment.NewLine + 401"<li>HtmlEncode[[[2].OrderedProperty3 error]]</li>" + Environment.NewLine + 402"<li>HtmlEncode[[[2].Property3 error]]</li>" + Environment.NewLine + 428"<li>HtmlEncode[[[0].OrderedProperty2 error]]</li>" + Environment.NewLine + 429"<li>HtmlEncode[[[0].OrderedProperty1 error]]</li>" + Environment.NewLine + 430"<li>HtmlEncode[[[0].Property1 error]]</li>" + Environment.NewLine + 431"<li>HtmlEncode[[[2].OrderedProperty3 error]]</li>" + Environment.NewLine + 432"<li>HtmlEncode[[[2].Property3 error]]</li>" + Environment.NewLine + 433"<li>HtmlEncode[[OrderedProperty1 error]]</li>" + Environment.NewLine + 434"<li>HtmlEncode[[OrderedProperty2 error]]</li>" + Environment.NewLine + 462"<li>HtmlEncode[[This is an error for OrderedProperty3.]]</li>" + Environment.NewLine + 463"<li>HtmlEncode[[This is an error for OrderedProperty2.]]</li>" + Environment.NewLine + 464"<li>HtmlEncode[[This is another error for OrderedProperty2.]]</li>" + Environment.NewLine + 465"<li>HtmlEncode[[This is yet-another error for OrderedProperty2.]]</li>" + Environment.NewLine + 466"<li>HtmlEncode[[This is an error for OrderedProperty1.]]</li>" + Environment.NewLine + 467"<li>HtmlEncode[[This is an error for Property3.]]</li>" + Environment.NewLine + 468"<li>HtmlEncode[[This is an error for Property1.]]</li>" + Environment.NewLine + 469"<li>HtmlEncode[[This is another error for Property1.]]</li>" + Environment.NewLine + 470"<li>HtmlEncode[[This is an error for Property2.]]</li>" + Environment.NewLine + 471"<li>HtmlEncode[[This is another error for Property2.]]</li>" + Environment.NewLine + 472"<li>HtmlEncode[[This is an error for LastProperty.]]</li>" + Environment.NewLine + 503"<ul><li>HtmlEncode[[Error for Property1]]</li>" + Environment.NewLine + 535"<span>HtmlEncode[[Custom Message]]</span>" + Environment.NewLine + 536"<ul><li>HtmlEncode[[Error for Property1]]</li>" + Environment.NewLine + 554"<div>HtmlEncode[[Custom Message]]</div>" + Environment.NewLine + 555"<ul><li>HtmlEncode[[Error for Property1]]</li>" + Environment.NewLine + 574Environment.NewLine + 575"<ul><li>HtmlEncode[[Error for root]]</li>" + Environment.NewLine + 593"<span>HtmlEncode[[Custom Message]]</span>" + Environment.NewLine + 594"<ul><li>HtmlEncode[[Error for Property1]]</li>" + Environment.NewLine + 612"<div>HtmlEncode[[Custom Message]]</div>" + Environment.NewLine + 613"<ul><li>HtmlEncode[[Error for Property1]]</li>" + Environment.NewLine + 632Environment.NewLine + 633"<ul><li>HtmlEncode[[Error for root]]</li>" + Environment.NewLine + 655Environment.NewLine + 656"<ul><li>HtmlEncode[[Error for root]]</li>" + Environment.NewLine +
ViewComponents\DefaultViewComponentSelectorTest.cs (4)
97"The view component name 'Ambiguous' matched multiple types:" + Environment.NewLine + 99"Name: 'Namespace1.Ambiguous'" + Environment.NewLine + 118$"The view component name '{name}' matched multiple types:" + Environment.NewLine + 120"Name: 'Ambiguous.Name'" + Environment.NewLine +
ViewComponents\ViewViewComponentResultTest.cs (4)
145var expected = string.Join(Environment.NewLine, 183var expected = string.Join(Environment.NewLine, 221var expected = string.Join(Environment.NewLine, 379var expected = string.Join(Environment.NewLine,
ViewResultTest.cs (3)
77Environment.NewLine, 115Environment.NewLine, 155Environment.NewLine,
Microsoft.AspNetCore.OpenApi.Build.Tests (1)
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
48if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
Microsoft.AspNetCore.OpenApi.Tests (2)
Integration\OpenApiDocumentIntegrationTests.cs (1)
44? Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT"), "Integration", "snapshots")
Integration\OpenApiDocumentLocalizationTests.cs (1)
15? Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT"), "Integration", "snapshots")
Microsoft.AspNetCore.Razor.Language.Legacy.UnitTests (2)
Legacy\CSharpSectionTest.cs (1)
147var newLine = Environment.NewLine;
Legacy\TokenizerTestBase.cs (1)
64Assert.True(success, Environment.NewLine + output.ToString());
Microsoft.AspNetCore.Razor.Language.UnitTests (20)
CodeGeneration\CSharpCodeWriterTest.cs (1)
15private static readonly int WriterNewLineLength = Environment.NewLine.Length;
Components\ComponentDuplicateAttributeDiagnosticPassTest.cs (1)
20RazorProjectFileSystem.Create(Environment.CurrentDirectory),
Components\ComponentMarkupBlockPassTest.cs (1)
19RazorProjectFileSystem.Create(Environment.CurrentDirectory),
Components\ComponentMarkupEncodingPassTest.cs (1)
19RazorProjectFileSystem.Create(Environment.CurrentDirectory),
Components\ComponentWhitespacePassTest.cs (1)
18RazorProjectFileSystem.Create(Environment.CurrentDirectory),
DefaultRazorIntermediateNodeLoweringPhaseIntegrationTest.cs (2)
302c1 => Html(Environment.NewLine, c1), 315c1 => Html(Environment.NewLine, c1)));
DefaultRazorTagHelperBinderPhaseTest.cs (7)
29new SourceSpan(new SourceLocation(14 + Environment.NewLine.Length, 1, 14), contentLength: 1)), 31new SourceSpan(new SourceLocation(14 + Environment.NewLine.Length, 1, 14), contentLength: 1), "\"") 58new SourceSpan(new SourceLocation(17 + Environment.NewLine.Length, 1, 17), contentLength: 1)), 60new SourceSpan(new SourceLocation(17 + Environment.NewLine.Length, 1, 17), contentLength: 1), "\"") 87new SourceSpan(new SourceLocation(17 + Environment.NewLine.Length, 1, 17), contentLength: 1)), 89new SourceSpan(new SourceLocation(17 + Environment.NewLine.Length, 1, 17), contentLength: 1), "tagHelperPrefix", '\"', "\""), 480new SourceSpan(new SourceLocation((Environment.NewLine.Length * 2) + 30, 2, 1), contentLength: 4), "form");
IntegrationTests\ComponentDirectiveIntegrationTest.cs (1)
79"@inherits TestNamespace.TestBaseClass" + Environment.NewLine +
Legacy\CSharpCodeParserTest.cs (3)
53InvalidPrefixError(2 + Environment.NewLine.Length, Environment.NewLine[0], """ 189absoluteIndex: 22 + Environment.NewLine.Length,
Legacy\CSharpSectionTest.cs (1)
150var newLine = Environment.NewLine;
Legacy\TokenizerTestBase.cs (1)
70Assert.True(success, Environment.NewLine + output.ToString());
Microsoft.AspNetCore.Razor.Microbenchmarks.Compiler (4)
CodeGenerationBenchmark.cs (2)
44throw new Exception("Error!" + Environment.NewLine + string.Join(Environment.NewLine, generated.Diagnostics));
SyntaxTreeGenerationBenckmark.cs (2)
52throw new Exception("Error!" + Environment.NewLine + string.Join(Environment.NewLine, syntaxTree.Diagnostics));
Microsoft.AspNetCore.Razor.Microbenchmarks.Generator (1)
ProjectSetup.cs (1)
24throw new InvalidOperationException(string.Join(Environment.NewLine, workspace.Diagnostics));
Microsoft.AspNetCore.Razor.Test.Common (10)
Language\IntegrationTests\IntegrationTestBase.cs (5)
254var diagnosticsLog = string.Join(Environment.NewLine, csharpDocument.Diagnostics.Select(d => d.ToString()).ToArray()); 668var startAnchor = "Actual:" + Environment.NewLine; 669var endAnchor = "Diff:" + Environment.NewLine; 679return text.Trim().Replace(Environment.NewLine + spaces, Environment.NewLine);
ManualRunOnlyFactAttribute.cs (1)
14if (Environment.GetEnvironmentVariable("_IntegrationTestsRunningInCI") is not null)
TestCompilation.cs (2)
109Environment.NewLine, 111Assert.True(emitResult.Success, $"Compilation is invalid : {Environment.NewLine}{diagnostics}");
ThrowingTraceListener.cs (2)
26(string.IsNullOrEmpty(detailMessage) ? "" : Environment.NewLine + detailMessage); 28_fails.Add($"{logMessage}{Environment.NewLine}{stackTrace}");
Microsoft.AspNetCore.Razor.Test.Common.Cohosting (2)
CohostTestBase.cs (2)
76{string.Join(Environment.NewLine, ex.Errors.SelectMany(e => e).Select(e => e.Message))} 136AssertEx.EqualOrDiff("", string.Join(Environment.NewLine, errors.Where(e => e.Contains("Razor") && !e.Contains("RazorInProcLanguageClient"))));
Microsoft.AspNetCore.Razor.Test.Common.Tooling (2)
Language\IntegrationTests\RazorToolingIntegrationTestBase.cs (1)
270var diagnosticsLog = string.Join(Environment.NewLine, cSharpResult.Diagnostics.Select(d => d.ToString()).ToArray());
Mef\ExportProviderCache.cs (1)
105"Failed to construct the MEF catalog for testing. Multiple exports were found for a part for which only one export is expected:" + Environment.NewLine
Microsoft.AspNetCore.Razor.Utilities.Shared (2)
Assumed.cs (2)
152=> ThrowHelper.ThrowInvalidOperationException(message + Environment.NewLine + SR.FormatFile_0_Line_1(path, line)); 157=> ThrowHelper.ThrowInvalidOperationException<T>(message + Environment.NewLine + SR.FormatFile_0_Line_1(path, line));
Microsoft.AspNetCore.Razor.Utilities.Shared.UnitTests (2)
Threading\CleanableWeakCacheTests.cs (2)
292var taskCount = Environment.ProcessorCount * 2; 330var taskCount = Environment.ProcessorCount * 2;
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.Routing.FunctionalTests (3)
EndpointRoutingIntegrationTest.cs (2)
20Environment.NewLine + 25Environment.NewLine +
MinimalFormTests.cs (1)
211Environment.NewLine +
Microsoft.AspNetCore.Routing.Tests (17)
EndpointMiddlewareTest.cs (4)
100Environment.NewLine + 129Environment.NewLine + 226Environment.NewLine + 323Environment.NewLine +
EndpointNameAddressSchemeTest.cs (1)
173Assert.Equal(String.Join(Environment.NewLine, @"The following endpoints with a duplicate endpoint name were found.",
Internal\DfaGraphWriterTest.cs (6)
33Assert.Equal(String.Join(Environment.NewLine, @"digraph DFA {", 35"}") + Environment.NewLine, writer.ToString()); 56Assert.Equal(String.Join(Environment.NewLine, @"digraph DFA {", 58@"}") + Environment.NewLine, writer.ToString()); 80Assert.Equal(String.Join(Environment.NewLine, @"digraph DFA {", 86@"}") + Environment.NewLine, sdf);
Matching\CandidateSetTest.cs (2)
325Environment.NewLine + 327Environment.NewLine +
Matching\DefaultEndpointSelectorTest.cs (3)
165@"The request matched multiple endpoints. Matches: " + Environment.NewLine + Environment.NewLine + 166"test: /test2" + Environment.NewLine + "test: /test3", ex.Message);
Tree\LinkGenerationDecisionTreeTest.cs (1)
725var newLine = Environment.NewLine;
Microsoft.AspNetCore.Server.HttpSys (5)
HttpSysOptions.cs (2)
19internal static readonly int DefaultMaxAccepts = 5 * Environment.ProcessorCount; 75/// The default is 5 times the number of processors as returned by <see cref="Environment.ProcessorCount" />.
NativeInterop\SafeNativeOverlapped.cs (1)
14private static bool HasShutdownStarted => Environment.HasShutdownStarted
NativeInterop\UrlGroup.cs (2)
180throw new HttpSysException((int)statusCode, Resources.FormatException_AccessDenied(uriPrefix, Environment.UserDomainName + @"\" + Environment.UserName));
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (5)
DelegateTests.cs (1)
173Assert.True(Environment.OSVersion.Version < new Version(10, 0, 22000), "This should be supported on Win 11.");
Http2Tests.cs (2)
195if (Environment.OSVersion.Version < new Version(10, 0, 19041, 0)) 259if (Environment.OSVersion.Version < new Version(10, 0, 19041, 0))
HttpsTests.cs (1)
192if (Environment.OSVersion.Version > new Version(10, 0, 19043, 0))
Utilities.cs (1)
41IsWin8orLater = (Environment.OSVersion.Version >= win8Version);
Microsoft.AspNetCore.Server.HttpSys.NonHelixTests (1)
Utilities.cs (1)
25IsWin8orLater = (Environment.OSVersion.Version >= win8Version);
Microsoft.AspNetCore.Server.IIS (4)
src\Shared\RazorViews\BaseView.cs (1)
283return string.Join("<br />" + Environment.NewLine,
StartupHook.cs (3)
28var detailedErrors = Environment.GetEnvironmentVariable("ASPNETCORE_DETAILEDERRORS"); 32var aspnetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); 35var dotnetEnvironment = Environment.GetEnvironmentVariable("DOTNET_ENVIRONMENT");
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.IntegrationTesting (21)
Common\DotNetCommands.cs (5)
18var dotnetHome = Environment.GetEnvironmentVariable("DOTNET_HOME"); 20var dotnetRoot = Environment.GetEnvironmentVariable("DOTNET_ROOT"); 22var dotnetInstallDir = Environment.GetEnvironmentVariable("DOTNET_INSTALL_DIR"); 24var userProfile = Environment.GetEnvironmentVariable("USERPROFILE"); 25var home = Environment.GetEnvironmentVariable("HOME");
Deployers\NginxDeployer.cs (6)
103var retVal = Environment.GetEnvironmentVariable("LOGNAME") 104?? Environment.GetEnvironmentVariable("USER") 105?? Environment.GetEnvironmentVariable("USERNAME"); 153Logger.LogTrace($"Config File Content:{Environment.NewLine}===START CONFIG==={Environment.NewLine}{{configContent}}{Environment.NewLine}===END CONFIG===", DeploymentParameters.ServerConfigTemplateContent);
Deployers\RemoteWindowsDeployer\RemoteWindowsDeployer.cs (3)
183Logger.LogTrace($"Config File Content:{Environment.NewLine}===START CONFIG==={Environment.NewLine}{{configContent}}{Environment.NewLine}===END CONFIG===", webConfig.ToString());
src\Shared\Process\ProcessEx.cs (4)
124if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 126startInfo.EnvironmentVariables["NUGET_FALLBACK_PACKAGES"] = Environment.GetEnvironmentVariable("NUGET_FALLBACK_PACKAGES"); 228private static string GetNugetPackagesRestorePath() => (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("NUGET_RESTORE"))) 233: Environment.GetEnvironmentVariable("NUGET_RESTORE");
xunit\IISExpressAncmSchema.cs (2)
22Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles),
xunit\SkipIfEnvironmentVariableNotEnabled.cs (1)
26return string.Equals(Environment.GetEnvironmentVariable(_environmentVariableName), "true", StringComparison.OrdinalIgnoreCase);
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (9)
IISDeployer.cs (3)
81Logger.LogInformation(Environment.OSVersion.ToString()); 530HelixHelper.PreserveFile(Path.Combine(Environment.SystemDirectory, @"inetsrv\config\ApplicationHost.config"), fileNamePrefix + ".inetsrv.applicationHost.config"); 531HelixHelper.PreserveFile(Path.Combine(Environment.SystemDirectory, @"inetsrv\config\redirection.config"), fileNamePrefix + ".inetsrv.redirection.config");
IISDeployerBase.cs (2)
97if (!File.Exists(Environment.ExpandEnvironmentVariables(ancmFile))) 100if (!File.Exists(Environment.ExpandEnvironmentVariables(ancmFile)))
IISExpressDeployer.cs (2)
50Logger.LogInformation(Environment.OSVersion.ToString()); 386var iisExpressPath = Path.Combine(Environment.GetEnvironmentVariable("SystemDrive") + "\\", programFiles, "IIS Express", "iisexpress.exe");
ProcessTracker.cs (2)
18if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows) || Environment.OSVersion.Version < new Version(6, 2)) 24var jobHandle = CreateJobObject(IntPtr.Zero, name: $"ProcessTracker{Environment.ProcessId}");
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\Shared\CertificateGeneration\CertificateManager.cs (1)
1042return string.Join(Environment.NewLine, description);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
25private static readonly string MacOSUserKeychain = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + "/Library/Keychains/login.keychain-db"; 33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https");
src\Shared\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);
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.Server.Kestrel.Core.Tests (14)
DiagnosticMemoryPoolTests.cs (4)
118Assert.Equal($"Cannot access a disposed object.{Environment.NewLine}Object name: 'MemoryPoolBlock'.", exception.Message); 133Assert.Equal($"Cannot access a disposed object.{Environment.NewLine}Object name: 'MemoryPoolBlock'.", exception.Message); 155Assert.Equal($"Cannot access a disposed object.{Environment.NewLine}Object name: 'MemoryPoolBlock'.", ode.Message); 172Assert.Equal($"Cannot access a disposed object.{Environment.NewLine}Object name: 'MemoryPoolBlock'.", exception.Message);
LoggingStreamTests.cs (1)
39Assert.Equal($"Write[{bufferLength}]{Environment.NewLine}{expectedOutput}", mockLogger.Logs);
MemoryPoolTests.cs (1)
47Assert.Equal($"Cannot access a disposed object.{Environment.NewLine}Object name: 'MemoryPool'.", exception.Message);
src\Servers\Kestrel\shared\test\RevocationResponder.cs (1)
15Environment.GetEnvironmentVariable("TRACE_REVOCATION_RESPONSE") != null;
src\Servers\Kestrel\shared\test\StreamBackedTestConnection.cs (7)
119throw new TimeoutException($"Did not receive a complete response within {Timeout}.{Environment.NewLine}{Environment.NewLine}" + 120$"Expected:{Environment.NewLine}{expected}{Environment.NewLine}{Environment.NewLine}" + 121$"Actual:{Environment.NewLine}{new string(actual, 0, offset)}{Environment.NewLine}",
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (4)
InMemoryTransportBenchmark.cs (1)
79throw new InvalidOperationException(string.Join(Environment.NewLine,
NamedPipesTransportBenchmark.cs (1)
81throw new InvalidOperationException(string.Join(Environment.NewLine,
SchedulerBenchmark.cs (1)
20private static readonly int IOQueueCount = Math.Min(Environment.ProcessorCount, 16);
src\Servers\Kestrel\Transport.Sockets\src\Internal\IOQueue.cs (1)
88int processorCount = Environment.ProcessorCount;
Microsoft.AspNetCore.Server.Kestrel.Tests (2)
KestrelConfigurationLoaderTests.cs (2)
2141var appData = Environment.GetEnvironmentVariable("APPDATA"); 2142var home = Environment.GetEnvironmentVariable("HOME");
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (2)
NamedPipeTransportOptions.cs (2)
19/// Defaults to <see cref="Environment.ProcessorCount" /> rounded down and clamped between 1 and 16. 21public int ListenerQueueCount { get; set; } = Math.Min(Environment.ProcessorCount, 16);
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (3)
Internal\IOQueue.cs (1)
88int processorCount = Environment.ProcessorCount;
SocketConnectionFactoryOptions.cs (1)
37/// Defaults to a value based on and limited to <see cref="Environment.ProcessorCount" />.
SocketTransportOptions.cs (1)
31/// Defaults to a value based on and limited to <see cref="Environment.ProcessorCount" />.
Microsoft.AspNetCore.Shared.Tests (20)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
1042return string.Join(Environment.NewLine, description);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
25private static readonly string MacOSUserKeychain = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + "/Library/Keychains/login.keychain-db"; 33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https");
src\Shared\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);
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
48if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
Microsoft.AspNetCore.SignalR.Common.Tests (4)
Internal\Protocol\MessagePackHubProtocolTestBase.cs (4)
280Assert.True(string.Equals(actual, testData.Binary, StringComparison.Ordinal), $"Binary encoding changed from{Environment.NewLine} [{testData.Binary}]{Environment.NewLine} to{Environment.NewLine} [{actual}]{Environment.NewLine}Please verify the MsgPack output and update the baseline");
Microsoft.AspNetCore.SignalR.StackExchangeRedis (3)
Internal\AckHandler.cs (2)
51var currentTick = Environment.TickCount64; 91CreatedTick = Environment.TickCount64;
RedisHubLifetimeManager.cs (1)
814return $"{Environment.MachineName}_{Guid.NewGuid():N}";
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (7)
Docker.cs (6)
63foreach (var dir in Environment.GetEnvironmentVariable("PATH").Split(Path.PathSeparator)) 133output = output.Trim().Replace(Environment.NewLine, ""); 136Environment.SetEnvironmentVariable("REDIS_CONNECTION", $"{output}:6379"); 167throw new Exception($"Command '{fileName} {arguments}' failed with exit code '{exitCode}'. Output:{Environment.NewLine}{output}"); 181output = string.Join(Environment.NewLine, lines.ToArray()); 190output = string.Join(Environment.NewLine, lines);
Startup.cs (1)
24options.Configuration.EndPoints.Add(Environment.GetEnvironmentVariable("REDIS_CONNECTION"));
Microsoft.AspNetCore.SignalR.Tests (4)
NativeAotTests.cs (4)
420"Provider: {0}" + Environment.NewLine + 421"Log level: {1}" + Environment.NewLine + 422"Event id: {2}" + Environment.NewLine + 423"Exception: {3}" + Environment.NewLine +
Microsoft.AspNetCore.SignalR.Tests.Utils (8)
src\Shared\SignalR\InProcessTestServer.cs (3)
123throw new TimeoutException($"Timed out waiting for application to start.{Environment.NewLine}Startup Logs:{Environment.NewLine}{RenderLogs(logs)}"); 148foreach (var line in message.Split(new[] { Environment.NewLine }, StringSplitOptions.None))
src\Shared\SignalR\VerifyNoErrorScope.cs (5)
46errorMessage += Environment.NewLine; 47errorMessage += string.Join(Environment.NewLine, results.Select(record => 54lineMessage += Environment.NewLine; 56lineMessage += Environment.NewLine; 58lineMessage += Environment.NewLine;
Microsoft.AspNetCore.SpaProxy (3)
SpaProxyLaunchManager.cs (3)
223$processId = Get-Process -PID {Environment.ProcessId} -ErrorAction Stop; 286ps {Environment.ProcessId}; 290ps {Environment.ProcessId} > /dev/null;
Microsoft.AspNetCore.SpaServices.Extensions (1)
Npm\NodeScriptRunner.cs (1)
138+ $" Current PATH enviroment variable is: { Environment.GetEnvironmentVariable("PATH") }\n"
Microsoft.AspNetCore.SpaServices.Extensions.Tests (1)
ListLoggerFactory.cs (1)
87TestOutputHelper?.WriteLine(message + Environment.NewLine);
Microsoft.AspNetCore.TestHost (1)
.packages\microsoft.extensions.hostfactoryresolver.sources\11.0.0-preview.5.26256.105\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (1)
33if (uint.TryParse(Environment.GetEnvironmentVariable(TimeoutEnvironmentKey), out uint timeoutInSeconds))
Microsoft.AspNetCore.TestHost.Tests (2)
HttpContextBuilderTests.cs (2)
178var bytes = Encoding.UTF8.GetBytes("BodyStarted" + Environment.NewLine); 214await c.Response.WriteAsync("BodyStarted" + Environment.NewLine);
Microsoft.AspNetCore.Tests (2)
WebApplicationTests.cs (2)
653Assert.Equal(NormalizePath(Environment.CurrentDirectory), NormalizePath(builder.Environment.ContentRootPath)); 669options.StartInfo.WorkingDirectory = Environment.SystemDirectory;
Microsoft.AspNetCore.WebSockets.ConformanceTests (8)
Autobahn\AutobahnTester.cs (1)
123Assert.True(failures.Length == 0, "Autobahn results did not meet expectations:" + Environment.NewLine + failures.ToString());
Autobahn\Executable.cs (1)
22foreach (var dir in Environment.GetEnvironmentVariable("PATH").Split(Path.PathSeparator))
Autobahn\Wstest.cs (1)
28var location = Environment.GetEnvironmentVariable("ASPNETCORE_WSTEST_PATH");
AutobahnTests.cs (2)
35var reportDir = Environment.GetEnvironmentVariable("AUTOBAHN_SUITES_REPORT_DIR"); 85var pf = Environment.GetEnvironmentVariable("PROGRAMFILES");
SkipIfWsTestNotPresentAttribute.cs (3)
16!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("TEAMCITY_VERSION")) || 17string.Equals(Environment.GetEnvironmentVariable("TRAVIS"), "true", StringComparison.OrdinalIgnoreCase) || 18string.Equals(Environment.GetEnvironmentVariable("APPVEYOR"), "true", StringComparison.OrdinalIgnoreCase);
Microsoft.AspNetCore.WebUtilities (1)
AspNetCoreTempDirectory.cs (1)
19var temp = Environment.GetEnvironmentVariable("ASPNETCORE_TEMP") ?? // ASPNETCORE_TEMP - User set temporary location.
Microsoft.Build (135)
BackEnd\BuildManager\BuildManager.cs (2)
819switch (Environment.GetEnvironmentVariable("MSBuildDebugBuildManagerOnStart")) 2440if (Environment.GetEnvironmentVariable("MSBUILDCLEARXMLCACHEONBUILDMANAGER") == "1")
BackEnd\BuildManager\BuildParameters.cs (3)
430set => _enableNodeReuse = Environment.GetEnvironmentVariable("MSBUILDDISABLENODEREUSE") == "1" ? false : value; 1013if (Environment.GetEnvironmentVariable("MSBUILDDISABLENODEREUSE") == "1") // For example to disable node reuse within Visual Studio 1018if (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)
490foreach (DictionaryEntry envVar in Environment.GetEnvironmentVariables())
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (2)
153_debugForceCaching = Environment.GetEnvironmentVariable("MSBUILDDEBUGFORCECACHING") == "1"; 1500file.WriteLine("{0}({1})-{2}: {3}", Thread.CurrentThread.Name, Environment.CurrentManagedThreadId, DateTime.UtcNow.Ticks, message);
BackEnd\Components\Caching\ConfigCache.cs (4)
40if (!int.TryParse(Environment.GetEnvironmentVariable("MSBUILDCONFIGCACHESWEEPTHRESHHOLD"), out _sweepThreshhold)) 250if (String.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDENABLEAGGRESSIVECACHING"))) 387capacity => new ConcurrentDictionary<int, BuildRequestConfiguration>(Environment.ProcessorCount, capacity)); 392_byMetadata = new ConcurrentDictionary<ConfigurationMetadata, BuildRequestConfiguration>(Environment.ProcessorCount, configurationsById.Count);
BackEnd\Components\Communications\DetouredNodeLauncher.cs (1)
150foreach (DictionaryEntry baseVar in Environment.GetEnvironmentVariables())
BackEnd\Components\Communications\NodeLauncher.cs (6)
66bool showNodeWindow = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDNODEWINDOW")); 144$"Failed to launch node from {nodeLaunchData.MSBuildLocation}. CommandLine: {commandLineArgs}{Environment.NewLine}{ex}"); 298foreach (System.Collections.DictionaryEntry entry in Environment.GetEnvironmentVariables()) 326string useMSBuildServerEnvVarValue = Environment.GetEnvironmentVariable(Traits.UseMSBuildServerEnvVarName); 331Environment.SetEnvironmentVariable(Traits.UseMSBuildServerEnvVarName, "0"); 339Environment.SetEnvironmentVariable(Traits.UseMSBuildServerEnvVarName, useMSBuildServerEnvVarValue);
BackEnd\Components\Communications\NodeProviderInProc.cs (2)
131concurrencyLevel: Environment.ProcessorCount, 223if (Environment.GetEnvironmentVariable("MSBUILDINPROCENVCHECK") == "1")
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (1)
260string msbuildExeName = Environment.GetEnvironmentVariable("MSBUILD_EXE_NAME");
BackEnd\Components\Communications\NodeProviderOutOfProcTaskHost.cs (3)
175name = Environment.GetEnvironmentVariable("MSBUILDTASKHOST_EXE_NAME") ?? "MSBuildTaskHost.exe"; 427name = Environment.GetEnvironmentVariable("MSBUILD_EXE_NAME"); 612string envPath = Environment.GetEnvironmentVariable(environmentVariable);
BackEnd\Components\Logging\LoggingService.cs (1)
323string queueCapacityEnvironment = Environment.GetEnvironmentVariable("MSBUILDLOGGINGQUEUECAPACITY");
BackEnd\Components\Logging\LoggingServiceLogMethods.cs (4)
231message += Environment.NewLine + "This is an unhandled exception from a task -- PLEASE OPEN A BUG AGAINST THE TASK OWNER."; 235message += Environment.NewLine + exception.ToString(); 265message += Environment.NewLine + "This is an unhandled exception from a task -- PLEASE OPEN A BUG AGAINST THE TASK OWNER."; 270message += 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)
691if (Environment.GetEnvironmentVariable("MSBUILDFORCESTA") == "1")
BackEnd\Components\RequestBuilder\TargetUpToDateChecker.cs (1)
1258private static readonly bool s_sortInputsOutputs = (Environment.GetEnvironmentVariable("MSBUILDSORTINPUTSOUTPUTS") == "1");
BackEnd\Components\RequestBuilder\TaskBuilder.cs (2)
838if (ExceptionHandling.IsCriticalException(ex) || Environment.GetEnvironmentVariable("MSBUILDDONOTCATCHTASKEXCEPTIONS") == "1") 929if (ExceptionHandling.IsCriticalException(taskException) || (Environment.GetEnvironmentVariable("MSBUILDDONOTCATCHTASKEXCEPTIONS") == "1"))
BackEnd\Components\RequestBuilder\TaskHost.cs (6)
47private static readonly bool s_breakOnLogAfterTaskReturns = Environment.GetEnvironmentVariable("MSBUILDBREAKONLOGAFTERTASKRETURNS") == "1"; 362_yieldThreadId = Environment.CurrentManagedThreadId; 391ErrorUtilities.VerifyThrow(_yieldThreadId == Environment.CurrentManagedThreadId, $"Cannot call Reacquire() on thread {Environment.CurrentManagedThreadId} when Yield() was called on thread {_yieldThreadId}"); 1034string initialLeaseTimeFromEnvironment = Environment.GetEnvironmentVariable("MSBUILDENGINEPROXYINITIALLEASETIME"); 1055string leaseExtensionTimeFromEnvironment = Environment.GetEnvironmentVariable("MSBUILDENGINEPROXYLEASEEXTENSIONTIME");
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"); 2690file.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 (4)
74if (Environment.OSVersion.Version.Major >= 6) 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);
DebugUtils.cs (3)
178builder.Append(Environment.NewLine); 181builder.Append(Environment.NewLine); 183builder.Append(Environment.NewLine);
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)
173private 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)
3069foreach (DictionaryEntry environmentVariable in Environment.GetEnvironmentVariables()) 3086Environment.SetEnvironmentVariable(environmentVariableName, null); 3099Environment.SetEnvironmentVariable(clearedVariable.Key as string, clearedVariable.Value as string);
Instance\TaskFactories\AssemblyTaskFactory.cs (2)
277ProjectErrorUtilities.ThrowInvalidProject(elementLocation, "TaskLoadFailure", taskName, loadInfo.AssemblyLocation, Environment.NewLine + e.InnerException.ToString()); 472ProjectErrorUtilities.ThrowInvalidProject(elementLocation, "TaskLoadFailure", taskName, _loadedType.Assembly.AssemblyLocation, Environment.NewLine + e.InnerException.ToString());
Instance\TaskFactoryEngineContext.cs (2)
313string initialLeaseTimeFromEnvironment = Environment.GetEnvironmentVariable("MSBUILDENGINEPROXYINITIALLEASETIME"); 334string leaseExtensionTimeFromEnvironment = Environment.GetEnvironmentVariable("MSBUILDENGINEPROXYLEASEEXTENSIONTIME");
Instance\TaskRegistry.cs (1)
1481ProjectErrorUtilities.ThrowInvalidProject(elementLocation, "TaskFactoryLoadFailure", TaskFactoryAttributeName, taskFactoryLoadInfo.AssemblyLocation, Environment.NewLine + e.InnerException.ToString());
Logging\BaseConsoleLogger.cs (2)
143WriteHandler(Environment.NewLine); 884Traits.LogAllEnvironmentVariables = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDLOGALLENVIRONMENTVARIABLES"));
Logging\BinaryLogger\BinaryLogger.cs (7)
339_initialIsBinaryLoggerEnabled = Environment.GetEnvironmentVariable("MSBUILDBINARYLOGGERENABLED"); 341Environment.SetEnvironmentVariable("MSBUILDTARGETOUTPUTLOGGING", "true"); 342Environment.SetEnvironmentVariable("MSBUILDLOGIMPORTS", "1"); 343Environment.SetEnvironmentVariable("MSBUILDBINARYLOGGERENABLED", bool.TrueString); 489Environment.SetEnvironmentVariable("MSBUILDTARGETOUTPUTLOGGING", _initialTargetOutputLogging ? "true" : null); 490Environment.SetEnvironmentVariable("MSBUILDLOGIMPORTS", _initialLogImports ? "1" : null); 491Environment.SetEnvironmentVariable("MSBUILDBINARYLOGGERENABLED", _initialIsBinaryLoggerEnabled);
Logging\BinaryLogger\BuildEventArgsReader.cs (1)
1831if (!Environment.Is64BitProcess)
Logging\OptimizedStringIndenter.cs (1)
64int indentedStringLength = segments.Length * (Environment.NewLine.Length + indent);
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; 285string tlEnvVariable = Environment.GetEnvironmentVariable("MSBUILDTERMINALLOGGER") ?? string.Empty;
LogMessagePacketBase.cs (2)
260private static readonly int s_defaultPacketVersion = (Environment.Version.Major * 10) + Environment.Version.Minor;
ObjectPool`1.cs (1)
112: this(factory, Environment.ProcessorCount * 2, trimOnFree)
Resources\Constants.cs (1)
237var environmentType = new Tuple<string, Type>(null, typeof(Environment));
TaskLoggingHelper.cs (5)
1258message += Environment.NewLine + exception.StackTrace; 1454string initialLeaseTimeFromEnvironment = Environment.GetEnvironmentVariable("MSBUILDTASKLOGGINGHELPERINITIALLEASETIME"); 1474string leaseExtensionTimeFromEnvironment = Environment.GetEnvironmentVariable("MSBUILDTASKLOGGINGHELPERLEASEEXTENSIONTIME"); 1623bool diagnostics = Environment.GetEnvironmentVariable("MSBUILDDIAGNOSTICS") != null; 1630message += Environment.NewLine + exception.StackTrace;
Tracing.cs (2)
60string val = Environment.GetEnvironmentVariable("MSBUILDTRACEINTERVAL"); 121Trace.WriteLine(System.Environment.StackTrace);
Utilities\EngineFileUtilities.cs (1)
567string? wildCards = Environment.GetEnvironmentVariable("MsBuildSkipEagerWildCardEvaluationRegexes");
Utilities\NuGetFrameworkWrapper.cs (1)
185{(Environment.Is64BitProcess ? _bindingRedirects64 : _bindingRedirects32)}
Utilities\Utilities.cs (13)
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"); 532bool useLegacyMSBuildExtensionsPathBehavior = !String.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDLEGACYEXTENSIONSPATH")); 560localAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); 565localAppData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
Microsoft.Build.BuildCheck.UnitTests (2)
EndToEndTests.cs (2)
144$"Resource for culture {culture} was {(isResourceExpected ? "not " : "")}found in deps.json:{Environment.NewLine}{output.DepsJsonResources.ToString()}"); 149$"Unexpected resource for culture {culture} was found in deps.json:{Environment.NewLine}{output.DepsJsonResources.ToString()}");
Microsoft.Build.CommandLine.UnitTests (19)
CommandLineSwitches_Tests.cs (1)
1624string[] helpMessageLines = item.Value.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
MSBuildMultithreaded_Tests.cs (1)
72string? globalEnvValue = Environment.GetEnvironmentVariable(envVarName);
MSBuildServer_Tests.cs (6)
153Environment.SetEnvironmentVariable("MSBUILDUSESERVER", ""); 160Environment.SetEnvironmentVariable("MSBUILDUSESERVER", "1"); 214Environment.SetEnvironmentVariable("MSBUILDUSESERVER", "0"); 220Environment.SetEnvironmentVariable("MSBUILDUSESERVER", "1"); 337output.ShouldContain($@":MSBuildStartupDirectory:{Environment.CurrentDirectory}:"); 349output.ShouldContain($@":MSBuildStartupDirectory:{Environment.CurrentDirectory}:");
XMake_Tests.cs (11)
583output.EndsWith(Environment.NewLine, StringComparison.Ordinal).ShouldBeTrue(); 623output.EndsWith(Environment.NewLine, StringComparison.Ordinal).ShouldBeFalse(); 631string oldValueForMSBuildLoadMicrosoftTargetsReadOnly = Environment.GetEnvironmentVariable("MSBuildLoadMicrosoftTargetsReadOnly"); 637Environment.SetEnvironmentVariable("MSBuildLoadMicrosoftTargetsReadOnly", oldValueForMSBuildLoadMicrosoftTargetsReadOnly); 1012var originalUILanguage = Environment.GetEnvironmentVariable(DOTNET_CLI_UI_LANGUAGE); 1202Environment.SetEnvironmentVariable("MyEnvVariable", "1"); 1212Environment.SetEnvironmentVariable("MyEnvVariable", null); 1224string oldValueForMSBuildLoadMicrosoftTargetsReadOnly = Environment.GetEnvironmentVariable("MSBuildLoadMicrosoftTargetsReadOnly"); 1267Environment.SetEnvironmentVariable("MSBuildLoadMicrosoftTargetsReadOnly", oldValueForMSBuildLoadMicrosoftTargetsReadOnly); 1272? Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "notepad.exe")
Microsoft.Build.Engine.OM.UnitTests (16)
Construction\WhiteSpacePreservation_Tests.cs (1)
504if (Environment.NewLine.Length == 2)
Definition\Project_Tests.cs (14)
93<PropertyGroup><NewLine>" + Environment.NewLine + Environment.NewLine + "</NewLine></PropertyGroup>" + 1225string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVersion"); 1229Environment.SetEnvironmentVariable("VisualStudioVersion", null); 1244Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion); 1255string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVersion"); 1259Environment.SetEnvironmentVariable("VisualStudioVersion", "ABCD"); 1270Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion); 1280string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVersion"); 1284Environment.SetEnvironmentVariable("VisualStudioVersion", null); 1298Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion); 1309string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVersion"); 1313Environment.SetEnvironmentVariable("VisualStudioVersion", "ABC"); 1330Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion);
Definition\ProjectItem_Tests.cs (1)
2466<I1 Include='f1' M1='{Environment.CurrentDirectory}\b\c' M2='6'/>
Microsoft.Build.Engine.UnitTests (326)
BackEnd\AppHostSupport_Tests.cs (8)
98env.SetEnvironmentVariable("DOTNET_ROOT_X86", Environment.GetEnvironmentVariable("DOTNET_ROOT_X86")); 105Environment.GetEnvironmentVariable("DOTNET_ROOT").ShouldBeNull(); 106Environment.GetEnvironmentVariable("DOTNET_ROOT_X64").ShouldBeNull(); 134Environment.GetEnvironmentVariable("DOTNET_ROOT").ShouldBe(originalValue); 158Environment.GetEnvironmentVariable("DOTNET_ROOT").ShouldBe(originalDotnetRoot); // Preserved 159Environment.GetEnvironmentVariable("DOTNET_ROOT_X64").ShouldBeNull(); // Cleared 160Environment.GetEnvironmentVariable("DOTNET_ROOT_X86").ShouldBeNull(); // Cleared 161Environment.GetEnvironmentVariable("DOTNET_ROOT_ARM64").ShouldBeNull(); // Was already null
BackEnd\BuildManager_Tests.cs (1)
4152env.SetCurrentDirectory(Environment.CurrentDirectory);
BackEnd\BuildRequestConfiguration_Tests.cs (9)
366string originalValue = Environment.GetEnvironmentVariable("MSBUILDCACHE"); 369Environment.SetEnvironmentVariable("MSBUILDCACHE", "1"); 416Environment.SetEnvironmentVariable("MSBUILDCACHE", originalValue); 467string originalTmp = Environment.GetEnvironmentVariable("TMP"); 468string originalTemp = Environment.GetEnvironmentVariable("TEMP"); 474Environment.SetEnvironmentVariable("TMP", problematicTmpPath); 475Environment.SetEnvironmentVariable("TEMP", problematicTmpPath); 484Environment.SetEnvironmentVariable("TMP", originalTmp); 485Environment.SetEnvironmentVariable("TEMP", originalTemp);
BackEnd\IntrinsicTask_Tests.cs (2)
1825env.SetCurrentDirectory(Environment.CurrentDirectory); 1835<I1 Include='f1' M1='{Environment.CurrentDirectory}\b\c' M2='6'/>
BackEnd\LoggingServicesLogMethod_Tests.cs (2)
1326message += Environment.NewLine + "This is an unhandled exception from a task -- PLEASE OPEN A BUG AGAINST THE TASK OWNER."; 1330message += Environment.NewLine + exception.ToString();
BackEnd\NodePackets_Tests.cs (3)
257string _initialTargetOutputLogging = Environment.GetEnvironmentVariable("MSBUILDTARGETOUTPUTLOGGING"); 258Environment.SetEnvironmentVariable("MSBUILDTARGETOUTPUTLOGGING", "1"); 349Environment.SetEnvironmentVariable("MSBUILDTARGETOUTPUTLOGGING", _initialTargetOutputLogging);
BackEnd\RedirectConsoleWriter_Tests.cs (1)
27sb.ToString().ShouldBe($"Line 1{Environment.NewLine}Line 2");
BackEnd\SdkResolverLoader_Tests.cs (6)
335var origIncludeDefault = Environment.GetEnvironmentVariable("MSBUILDINCLUDEDEFAULTSDKRESOLVER"); 339Environment.SetEnvironmentVariable("MSBUILDINCLUDEDEFAULTSDKRESOLVER", "false"); 353Environment.SetEnvironmentVariable("MSBUILDINCLUDEDEFAULTSDKRESOLVER", origIncludeDefault); 363var origResolversFolder = Environment.GetEnvironmentVariable("MSBUILDADDITIONALSDKRESOLVERSFOLDER"); 384Environment.SetEnvironmentVariable("MSBUILDADDITIONALSDKRESOLVERSFOLDER", additionalRoot); 393Environment.SetEnvironmentVariable("MSBUILDADDITIONALSDKRESOLVERSFOLDER", origResolversFolder);
BackEnd\SdkResolverService_Tests.cs (1)
68_logger.Errors[0].Message.ShouldBe(ResourceUtilities.FormatResourceStringIgnoreCodeAndKeyword("FailedToResolveSDK", "notfound", string.Join($"{Environment.NewLine} ", new[] {
BackEnd\TargetResult_Tests.cs (4)
134string oldTmp = Environment.GetEnvironmentVariable("TMP"); 138Environment.SetEnvironmentVariable("TMP", "C:\\}"); 141Environment.SetEnvironmentVariable("TMP", "C:\\{"); 146Environment.SetEnvironmentVariable("TMP", oldTmp);
BackEnd\TaskEnvironment_Tests.cs (19)
106Environment.SetEnvironmentVariable(testVarName, null); 132Environment.SetEnvironmentVariable(testVarName, null); 170Environment.SetEnvironmentVariable(var1Name, null); 171Environment.SetEnvironmentVariable(var2Name, null); 172Environment.SetEnvironmentVariable(var3Name, null); 298Environment.SetEnvironmentVariable(testVarName, null); 317Environment.GetEnvironmentVariable(testVarName).ShouldBe(testVarValue); 324Environment.GetEnvironmentVariable(testVarName).ShouldBeNull(); 329Environment.SetEnvironmentVariable(testVarName, null); 346Environment.GetEnvironmentVariable(testVarName).ShouldBeNull(); 354Environment.GetEnvironmentVariable(testVarName).ShouldBeNull(); 358Environment.SetEnvironmentVariable(testVarName, null); 370Environment.SetEnvironmentVariable(testVarName, testVarValue); 376Environment.SetEnvironmentVariable(testVarName, null); 389Environment.SetEnvironmentVariable(testVarName, testVarValue); 398Environment.SetEnvironmentVariable(testVarName, "changed_after_snapshot"); 403Environment.SetEnvironmentVariable(testVarName, null); 416Environment.SetEnvironmentVariable(excludedVarName, "process_level_value"); 434Environment.SetEnvironmentVariable(excludedVarName, null);
BinaryLogger_Tests.cs (4)
258$"Buffers starting at position {readCount} differ. First:{Environment.NewLine}{string.Join(",", bytes1)}{Environment.NewLine}Second:{Environment.NewLine}{string.Join(",", bytes2)}"); 475TransientTestFile testFile = testFolder.CreateFile(testFileName, string.Join(Environment.NewLine, new[] { "123", "456" }));
ConsoleLogger_Tests.cs (20)
133foreach (DictionaryEntry entry in Environment.GetEnvironmentVariables()) 620console.ToString().ShouldContain(message + Environment.NewLine); 675console.ToString().ShouldMatch($@"<{expectedColor}><cyan>\d\d:\d\d:\d\d\.\d\d\d\s+\d+><reset color>{Regex.Escape(file)}\({lineNumber}\): {subcategory} {expectedMessageType} {code}: {message} \(TaskId:\d+\){Environment.NewLine}<reset color>"); 679console.ToString().ShouldMatch($@"<cyan>\d\d:\d\d:\d\d\.\d\d\d\s+\d+><reset color><{expectedColor}>{Regex.Escape(file)}\({lineNumber}\): {subcategory} {expectedMessageType} {code}: {message}{Environment.NewLine}<reset color>"); 788sc.ToString().ShouldBe("<red>file.vb(42): VBC error 31415: Some long message" + Environment.NewLine + "<reset color>"); 850sc.ToString().ShouldBe("<yellow>file.vb(42): VBC warning 31415: Some long message" + Environment.NewLine + "<reset color>"); 964sc.ToString().ShouldBe("<red>file.vb(42): VBC error 31415: Some long message" + Environment.NewLine + "<reset color>"); 1025sc.ToString().ShouldBe("<yellow>file.vb(42): VBC warning 31415: Some long message" + Environment.NewLine + "<reset color>"); 1086sc.ToString().ShouldBe("<yellow>file.vb(42): VBC warning 31415: Some long message" + Environment.NewLine + "<reset color>"); 1103sc.ToString().ShouldBe($"msg{Environment.NewLine}"); 1336message = message.Replace("\r\n", "\n").Replace("\n", Environment.NewLine); 1378item1spec = Environment.NewLine + " spec" + Environment.NewLine; 1379item2spec = Environment.NewLine + " spec2" + Environment.NewLine; 1380item3spec = Environment.NewLine + " (spec;3" + Environment.NewLine; 1382item1type = "type" + Environment.NewLine; 1383item2type = "type2" + Environment.NewLine; 1384item3type = "type(3)" + Environment.NewLine;
ConsoleOutputAlignerTests.cs (34)
27output.ShouldBe(indent + input + Environment.NewLine); 39output.ShouldBe(input + Environment.NewLine); 52output.ShouldBe(input + Environment.NewLine); 64output.ShouldBe(input + Environment.NewLine); 76output.ShouldBe(input + Environment.NewLine); 89output.ShouldBe(indent + input + Environment.NewLine); 102output.ShouldBe(expected1stLine + Environment.NewLine + expected2ndLine + Environment.NewLine); 123output.ShouldBe(expected.Replace("\n", Environment.NewLine)); 137output.ShouldBe(expected1stLine + Environment.NewLine + expected2ndLine + Environment.NewLine); 146input = input.Replace("\n", Environment.NewLine); 151output.ShouldBe(input + Environment.NewLine); 168expected = expected.Replace("\n", Environment.NewLine) + Environment.NewLine; 183input = input.Replace("\n", Environment.NewLine); 188output.ShouldBe(input + Environment.NewLine); 206string expected = input.Replace("\r", "").Replace("\n", Environment.NewLine) + Environment.NewLine; 220input = input.Replace("\n", Environment.NewLine); 221expected = expected.Replace("\n", Environment.NewLine); 234input = input.Replace("\n", Environment.NewLine); 235expected = expected.Replace("\n", Environment.NewLine); 248input = input.Replace("\n", Environment.NewLine); 253output.ShouldBe(input + Environment.NewLine); 263input = input.Replace("\n", Environment.NewLine); 268output.ShouldBe((prefixAlreadyWritten ? string.Empty : prefix) + input + Environment.NewLine); 278input = input.Replace("\n", Environment.NewLine); 283output.ShouldBe((prefixAlreadyWritten ? string.Empty : prefix) + input + Environment.NewLine); 293input = input.Replace("\n", Environment.NewLine); 298string expected = (prefixAlreadyWritten ? string.Empty : prefix) + input + Environment.NewLine + 299prefix + "x" + Environment.NewLine; 369input = input.Replace("\n", Environment.NewLine); 370expected = expected.Replace("\n", Environment.NewLine);
Construction\SolutionFile_OldParser_Tests.cs (1)
2475string[] lines = solutionFileContent.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
Construction\SolutionProjectGenerator_Tests.cs (14)
47_originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVersion"); 53Environment.SetEnvironmentVariable("VisualStudioVersion", _originalVisualStudioVersion); 298Environment.SetEnvironmentVariable("MSBuildSolutionBatchTargets", "1"); 310Environment.SetEnvironmentVariable("MSBuildSolutionBatchTargets", null); 457Environment.SetEnvironmentVariable("VisualStudioVersion", null); 501Environment.SetEnvironmentVariable("VisualStudioVersion", null); 542Environment.SetEnvironmentVariable("VisualStudioVersion", "ABC"); 660string previousLegacyEnvironmentVariable = Environment.GetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION"); 664Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", "1"); 709Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", previousLegacyEnvironmentVariable); 1106Assert.True(buildResult, String.Join(Environment.NewLine, logger.Errors.Select(beea => beea.Message))); 1983string oldValueForMSBuildEmitSolution = Environment.GetEnvironmentVariable("MSBuildEmitSolution"); 2016Environment.SetEnvironmentVariable("MSBuildEmitSolution", "1"); 2035Environment.SetEnvironmentVariable("MSBuildEmitSolution", oldValueForMSBuildEmitSolution);
Definition\Project_Internal_Tests.cs (12)
31string oldValue = Environment.GetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION"); 38Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", "1"); 61Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", oldValue); 75string oldValue = Environment.GetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION"); 82Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", "1"); 101Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", oldValue); 121string oldValue = Environment.GetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION"); 129Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", "1"); 144Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", oldValue); 172string oldValue = Environment.GetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION"); 180Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", "1"); 200Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", oldValue);
Definition\Toolset_Tests.cs (33)
186string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVersion"); 190Environment.SetEnvironmentVariable("VisualStudioVersion", null); 202Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion); 214string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVersion"); 218Environment.SetEnvironmentVariable("VisualStudioVersion", null); 232Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion); 239string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVersion"); 243Environment.SetEnvironmentVariable("VisualStudioVersion", null); 257Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion); 264string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVersion"); 268Environment.SetEnvironmentVariable("VisualStudioVersion", "foo"); 279Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion); 286string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVersion"); 290Environment.SetEnvironmentVariable("VisualStudioVersion", null); 304Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion); 311string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVersion"); 315Environment.SetEnvironmentVariable("VisualStudioVersion", "foo"); 332Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion); 339string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVersion"); 343Environment.SetEnvironmentVariable("VisualStudioVersion", null); 354Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion); 361string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVersion"); 365Environment.SetEnvironmentVariable("VisualStudioVersion", "FakeSubToolset"); 373Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion); 380string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVersion"); 384Environment.SetEnvironmentVariable("VisualStudioVersion", null); 395Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion); 402string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVersion"); 406Environment.SetEnvironmentVariable("VisualStudioVersion", null); 420Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion); 427string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVersion"); 431Environment.SetEnvironmentVariable("VisualStudioVersion", ObjectModelHelpers.CurrentVisualStudioVersion); 448Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion);
Definition\ToolsVersion_Tests.cs (42)
293string oldLegacyToolsVersion = Environment.GetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION"); 294string oldTreatHigherToolsVersions = Environment.GetEnvironmentVariable("MSBUILDTREATHIGHERTOOLSVERSIONASCURRENT"); 298Environment.SetEnvironmentVariable("MSBUILDTREATHIGHERTOOLSVERSIONASCURRENT", "1"); 299Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", "1"); 323Environment.SetEnvironmentVariable("MSBUILDTREATHIGHERTOOLSVERSIONASCURRENT", oldTreatHigherToolsVersions); 324Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", oldLegacyToolsVersion); 332string oldLegacyToolsVersion = Environment.GetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION"); 336Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", "1"); 360Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", oldLegacyToolsVersion); 368string oldLegacyToolsVersion = Environment.GetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION"); 372Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", "1"); 395Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", oldLegacyToolsVersion); 428string oldLegacyToolsVersion = Environment.GetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION"); 429string oldForceToolsVersionToCurrent = Environment.GetEnvironmentVariable("MSBUILDTREATALLTOOLSVERSIONSASCURRENT"); 433Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", "1"); 434Environment.SetEnvironmentVariable("MSBUILDTREATALLTOOLSVERSIONSASCURRENT", "1"); 457Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", oldLegacyToolsVersion); 458Environment.SetEnvironmentVariable("MSBUILDTREATALLTOOLSVERSIONSASCURRENT", oldForceToolsVersionToCurrent); 537string oldDefaultToolsVersion = Environment.GetEnvironmentVariable("MSBUILDDEFAULTTOOLSVERSION"); 541Environment.SetEnvironmentVariable("MSBUILDDEFAULTTOOLSVERSION", "foo"); 564Environment.SetEnvironmentVariable("MSBUILDDEFAULTTOOLSVERSION", oldDefaultToolsVersion); 576string oldDefaultToolsVersion = Environment.GetEnvironmentVariable("MSBUILDDEFAULTTOOLSVERSION"); 580Environment.SetEnvironmentVariable("MSBUILDDEFAULTTOOLSVERSION", "foo"); 603Environment.SetEnvironmentVariable("MSBUILDDEFAULTTOOLSVERSION", oldDefaultToolsVersion); 615string oldLegacyToolsVersion = Environment.GetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION"); 616string oldForceToolsVersionToCurrent = Environment.GetEnvironmentVariable("MSBUILDTREATALLTOOLSVERSIONSASCURRENT"); 620Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", "1"); 621Environment.SetEnvironmentVariable("MSBUILDTREATALLTOOLSVERSIONSASCURRENT", "1"); 645Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", oldLegacyToolsVersion); 646Environment.SetEnvironmentVariable("MSBUILDTREATALLTOOLSVERSIONSASCURRENT", oldForceToolsVersionToCurrent); 687string oldDefaultToolsVersion = Environment.GetEnvironmentVariable("MSBUILDDEFAULTTOOLSVERSION"); 691Environment.SetEnvironmentVariable("MSBUILDDEFAULTTOOLSVERSION", "foo"); 716Environment.SetEnvironmentVariable("MSBUILDDEFAULTTOOLSVERSION", oldDefaultToolsVersion); 771string oldLegacyToolsVersion = Environment.GetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION"); 772string oldForceToolsVersionToCurrent = Environment.GetEnvironmentVariable("MSBUILDTREATALLTOOLSVERSIONSASCURRENT"); 776Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", "1"); 777Environment.SetEnvironmentVariable("MSBUILDTREATALLTOOLSVERSIONSASCURRENT", "1"); 801Environment.SetEnvironmentVariable("MSBUILDLEGACYDEFAULTTOOLSVERSION", oldLegacyToolsVersion); 802Environment.SetEnvironmentVariable("MSBUILDTREATALLTOOLSVERSIONSASCURRENT", oldForceToolsVersionToCurrent); 884string oldDefaultToolsVersion = Environment.GetEnvironmentVariable("MSBUILDDEFAULTTOOLSVERSION"); 888Environment.SetEnvironmentVariable("MSBUILDDEFAULTTOOLSVERSION", "foo"); 912Environment.SetEnvironmentVariable("MSBUILDDEFAULTTOOLSVERSION", oldDefaultToolsVersion);
Evaluation\Evaluator_Tests.cs (76)
584string originalValue = Environment.GetEnvironmentVariable("MSBUILDWARNONUNINITIALIZEDPROPERTY"); 587Environment.SetEnvironmentVariable("MSBUILDWARNONUNINITIALIZEDPROPERTY", "true"); 602Environment.SetEnvironmentVariable("MSBUILDWARNONUNINITIALIZEDPROPERTY", originalValue); 626string originalValue = Environment.GetEnvironmentVariable("MSBUILDWARNONUNINITIALIZEDPROPERTY"); 631Environment.SetEnvironmentVariable("MSBUILDWARNONUNINITIALIZEDPROPERTY", null); 647Environment.SetEnvironmentVariable("MSBUILDWARNONUNINITIALIZEDPROPERTY", originalValue); 672string originalValue = Environment.GetEnvironmentVariable("MSBUILDWARNONUNINITIALIZEDPROPERTY"); 675Environment.SetEnvironmentVariable("MSBUILDWARNONUNINITIALIZEDPROPERTY", "true"); 690Environment.SetEnvironmentVariable("MSBUILDWARNONUNINITIALIZEDPROPERTY", originalValue); 718string originalValue = Environment.GetEnvironmentVariable("MSBUILDWARNONUNINITIALIZEDPROPERTY"); 721Environment.SetEnvironmentVariable("MSBUILDWARNONUNINITIALIZEDPROPERTY", "true"); 736Environment.SetEnvironmentVariable("MSBUILDWARNONUNINITIALIZEDPROPERTY", originalValue); 2460string backupMSBuildExtensionsPath = Environment.GetEnvironmentVariable(specialPropertyName); 2461string backupMSBuildExtensionsPath32 = Environment.GetEnvironmentVariable(specialPropertyName32); 2462string backupMagicSwitch = Environment.GetEnvironmentVariable("MSBUILDLEGACYEXTENSIONSPATH"); 2463string targetVar = Environment.GetEnvironmentVariable("Target"); 2464string numberVar = Environment.GetEnvironmentVariable("0env"); 2465string msbuildVar = Environment.GetEnvironmentVariable("msbuildtoolsversion"); 2471Environment.SetEnvironmentVariable(specialPropertyName, null); 2472Environment.SetEnvironmentVariable(specialPropertyName32, null); 2473Environment.SetEnvironmentVariable("MSBUILDLEGACYEXTENSIONSPATH", null); 2484Environment.SetEnvironmentVariable(specialPropertyName, backupMSBuildExtensionsPath); 2485Environment.SetEnvironmentVariable(specialPropertyName32, backupMSBuildExtensionsPath32); 2486Environment.SetEnvironmentVariable("MSBUILDLEGACYEXTENSIONSPATH", backupMagicSwitch); 2487Environment.SetEnvironmentVariable("Target", targetVar); 2488Environment.SetEnvironmentVariable("0env", numberVar); 2489Environment.SetEnvironmentVariable("msbuildtoolsversion", msbuildVar); 2501string backupMSBuildExtensionsPath = Environment.GetEnvironmentVariable("MSBuildExtensionsPath"); 2507Environment.SetEnvironmentVariable("MSBuildExtensionsPath", @"c:\foo\bar"); 2517Environment.SetEnvironmentVariable("MSBuildExtensionsPath", backupMSBuildExtensionsPath); 2581string originalMSBuildExtensionsPath32Value = Environment.GetEnvironmentVariable("MSBuildExtensionsPath32"); 2585Environment.SetEnvironmentVariable("MSBuildExtensionsPath32", @"c:\devdiv\vscore\msbuild"); 2594Environment.SetEnvironmentVariable("MSBuildExtensionsPath32", originalMSBuildExtensionsPath32Value); 2656string originalMSBuildExtensionsPath64Value = Environment.GetEnvironmentVariable("MSBuildExtensionsPath64"); 2660Environment.SetEnvironmentVariable("MSBuildExtensionsPath64", @"c:\devdiv\vscore\msbuild"); 2669Environment.SetEnvironmentVariable("MSBuildExtensionsPath64", originalMSBuildExtensionsPath64Value); 2695string expected = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); 2698expected = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); 2713string originalLocalAppDataValue = Environment.GetEnvironmentVariable("LocalAppData"); 2717Environment.SetEnvironmentVariable("LocalAppData", @"c:\AppData\Local"); 2726Environment.SetEnvironmentVariable("LocalAppData", originalLocalAppDataValue); 3108string oldEnvironmentValue = Environment.GetEnvironmentVariable("EnvironmentProperty"); 3112Environment.SetEnvironmentVariable("EnvironmentProperty", "Bar;Baz"); 3148Environment.SetEnvironmentVariable("EnvironmentProperty", oldEnvironmentValue); 3863string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVerson"); 3866Environment.SetEnvironmentVariable("VisualStudioVersion", null); 3907Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion); 3918string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVerson"); 3921Environment.SetEnvironmentVariable("VisualStudioVersion", "ABCDE"); 3960Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion); 3970string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVerson"); 3973Environment.SetEnvironmentVariable("VisualStudioVersion", "FakeSubToolset"); 4012Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion); 4022string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVerson"); 4025Environment.SetEnvironmentVariable("VisualStudioVersion", "abcdef"); 4064Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion); 4074string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVerson"); 4075string originalC = Environment.GetEnvironmentVariable("C"); 4076string originalD = Environment.GetEnvironmentVariable("D"); 4080Environment.SetEnvironmentVariable("VisualStudioVersion", "FakeSubToolset"); 4081Environment.SetEnvironmentVariable("C", "c4"); // not explosive :) 4082Environment.SetEnvironmentVariable("D", "d4"); 4124Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion); 4125Environment.SetEnvironmentVariable("C", originalC); 4126Environment.SetEnvironmentVariable("D", originalD); 4136string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVerson"); 4140Environment.SetEnvironmentVariable("VisualStudioVersion", "FakeSubToolset"); 4187Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion); 4197string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVerson"); 4201Environment.SetEnvironmentVariable("VisualStudioVersion", "FakeSubToolset"); 4245Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion); 4346string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVerson"); 4352Environment.SetEnvironmentVariable("VisualStudioVersion", null); 4365Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion);
Evaluation\Expander_Tests.cs (14)
1914Assert.Equal(Environment.GetEnvironmentVariable(envVar), result); 2332string expected = ("OS=" + Environment.GetEnvironmentVariable("OS")).ToUpperInvariant(); 2665string env = Environment.GetEnvironmentVariable("MSBUILDENABLEALLPROPERTYFUNCTIONS"); 2669Environment.SetEnvironmentVariable("MSBUILDENABLEALLPROPERTYFUNCTIONS", "1"); 2679Environment.SetEnvironmentVariable("MSBUILDENABLEALLPROPERTYFUNCTIONS", env); 2694string env = Environment.GetEnvironmentVariable("MSBUILDENABLEALLPROPERTYFUNCTIONS"); 2698Environment.SetEnvironmentVariable("MSBUILDENABLEALLPROPERTYFUNCTIONS", "1"); 2710Environment.SetEnvironmentVariable("MSBUILDENABLEALLPROPERTYFUNCTIONS", env); 2903Assert.Equal(System.Environment.GetFolderPath(Environment.SpecialFolder.System), result); 3889Assert.Equal(Environment.GetEnvironmentVariable(envVar), result); 3913Assert.Equal(Environment.GetEnvironmentVariable(envVar), result); 3937Assert.Equal(Environment.GetEnvironmentVariable(envVar), result); 3961Assert.Equal(Environment.GetEnvironmentVariable(envVar), result);
Instance\ProjectInstance_Internal_Tests.cs (12)
314string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVersion"); 318Environment.SetEnvironmentVariable("VisualStudioVersion", null); 337Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion); 348string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVersion"); 352Environment.SetEnvironmentVariable("VisualStudioVersion", "ABCD"); 363Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion); 373string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVersion"); 377Environment.SetEnvironmentVariable("VisualStudioVersion", null); 391Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion); 402string originalVisualStudioVersion = Environment.GetEnvironmentVariable("VisualStudioVersion"); 406Environment.SetEnvironmentVariable("VisualStudioVersion", "ABC"); 432Environment.SetEnvironmentVariable("VisualStudioVersion", originalVisualStudioVersion);
NetTaskHost_E2E_Tests.cs (1)
287env.SetEnvironmentVariable("PATH", $"{coreDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}");
ProjectCache\ProjectCacheTests.cs (3)
436MaxNodeCount = Environment.ProcessorCount 445MaxNodeCount = Environment.ProcessorCount 762MaxNodeCount = Environment.ProcessorCount,
TestAssets\ExampleNetTask\ExampleTask\ExampleTask.cs (1)
26string[] args = Environment.GetCommandLineArgs();
WarningsAsMessagesAndErrors_Tests.cs (1)
267{(customProperties != null ? String.Join(Environment.NewLine, customProperties.Select(i => $"<{i.Key}>{i.Value}</{i.Key}>")) : "")}
XmakeAttributes_Tests.cs (2)
133string notCurrentArchitecture = Environment.Is64BitProcess ? XMakeAttributes.MSBuildArchitectureValues.x86 : XMakeAttributes.MSBuildArchitectureValues.x64; 148string notCurrentArchitecture = Environment.Is64BitProcess ? XMakeAttributes.MSBuildArchitectureValues.x86 : XMakeAttributes.MSBuildArchitectureValues.x64;
Microsoft.Build.Framework (119)
BackEnd\CommunicationsUtilities.cs (2)
272IDictionary vars = Environment.GetEnvironmentVariables(); 782writer.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); 695return 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)
135string 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 (3)
116string? value = Environment.GetEnvironmentVariable(name); 135string? value = Environment.GetEnvironmentVariable(name); 151string? value = Environment.GetEnvironmentVariable(name);
ErrorUtilities.cs (1)
19private static readonly bool s_enableMSBuildDebugTracing = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDENABLEDEBUGTRACING"));
FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
FileClassifier.cs (2)
124string? programFiles = Environment.GetEnvironmentVariable(programFilesEnv); 136string? dir = Environment.GetEnvironmentVariable("VSAPPIDDIR");
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 (3)
194int numberOfCpus = Environment.ProcessorCount; 816Version osVersion = Environment.OSVersion.Version; 1299acceptAnsiColorCodes = AnsiDetector.IsAnsiSupported(Environment.GetEnvironmentVariable("TERM"));
OperatingSystem.cs (1)
42Version current = Environment.OSVersion.Version;
Traits.cs (63)
32DebugScheduler = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDDEBUGSCHEDULER")); 33DebugNodeCommunication = DebugEngine || !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDDEBUGCOMM")); 38internal readonly string? MSBuildDisableFeaturesFromVersion = Environment.GetEnvironmentVariable("MSBUILDDISABLEFEATURESFROMVERSION"); 41public readonly bool ForceAllTasksOutOfProcToTaskHost = Environment.GetEnvironmentVariable("MSBUILDFORCEALLTASKSOUTOFPROC") == "1"; 47public readonly bool ForceMultiThreaded = Environment.GetEnvironmentVariable("MSBUILDFORCEMULTITHREADED") == "1"; 52public readonly bool UseLazyWildCardEvaluation = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MsBuildSkipEagerWildCardEvaluationRegexes")); 53public readonly bool LogExpandedWildcards = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDLOGEXPANDEDWILDCARDS")); 54public readonly bool ThrowOnDriveEnumeratingWildcard = Environment.GetEnvironmentVariable("MSBUILDFAILONDRIVEENUMERATINGWILDCARD") == "1"; 59public readonly bool CacheFileExistence = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MsBuildCacheFileExistence")); 61public readonly bool UseSimpleProjectRootElementCacheConcurrency = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MsBuildUseSimpleProjectRootElementCacheConcurrency")); 66public readonly bool MSBuildCacheFileEnumerations = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MsBuildCacheFileEnumerations")); 68public readonly bool EnableAllPropertyFunctions = Environment.GetEnvironmentVariable("MSBUILDENABLEALLPROPERTYFUNCTIONS") == "1"; 73public readonly bool EnableRestoreFirst = Environment.GetEnvironmentVariable("MSBUILDENABLERESTOREFIRST") == "1"; 78public static readonly string? MSBuildNodeHandshakeSalt = Environment.GetEnvironmentVariable("MSBUILDNODEHANDSHAKESALT"); 83public readonly bool ForceEvaluateAsFullFramework = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MsBuildForceEvaluateAsFullFramework")); 96public readonly bool EmitSolutionMetaproj = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBuildEmitSolution")); 106public readonly bool SolutionBatchTargets = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBuildSolutionBatchTargets")); 111public readonly bool LogPropertyFunctionsRequiringReflection = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBuildLogPropertyFunctionsRequiringReflection")); 116public readonly bool LogAllAssemblyLoads = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDLOGALLASSEMBLYLOADS")); 121public static bool LogAllEnvironmentVariables = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDLOGALLENVIRONMENTVARIABLES")); 137public readonly bool EnableRarNode = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBuildRarNode")); 159public static string? MSBuildLoggingArgs => Environment.GetEnvironmentVariable(MSBuildLoggingArgsEnvVarName); 164public readonly bool EmitLogsAsMessage = string.Equals(Environment.GetEnvironmentVariable(MSBuildLoggingArgsLevelEnvVarName), "message", StringComparison.OrdinalIgnoreCase); 166public readonly bool DebugEngine = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBuildDebugEngine")); 169public readonly bool DebugUnitTests = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBuildDebugUnitTests")); 171public readonly bool InProcNodeDisabled = Environment.GetEnvironmentVariable("MSBUILDNOINPROCNODE") == "1"; 176public readonly bool ForceTaskFactoryOutOfProc = Environment.GetEnvironmentVariable("MSBUILDFORCEINLINETASKFACTORIESOUTOFPROC") == "1"; 181public readonly bool ConsoleUseDefaultEncoding = Environment.GetEnvironmentVariable("MSBUILD_CONSOLE_USE_DEFAULT_ENCODING") == "1" || Environment.GetEnvironmentVariable("DOTNET_CLI_CONSOLE_USE_DEFAULT_ENCODING") == "1"; 196public readonly bool SlnParsingWithSolutionPersistenceOptIn = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILD_PARSE_SLN_WITH_SOLUTIONPERSISTENCE")); 213public readonly bool DoNotSendDeferredMessagesToBuildManager = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MsBuildDoNotSendDeferredMessagesToBuildManager")); 219public readonly bool DoNotExpandQualifiedMetadataInUpdateOperation = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBuildDoNotExpandQualifiedMetadataInUpdateOperation")); 229public readonly bool AlwaysUseContentTimestamp = Environment.GetEnvironmentVariable("MSBUILDALWAYSCHECKCONTENTTIMESTAMP") == "1"; 235public readonly bool TruncateTaskInputs = Environment.GetEnvironmentVariable("MSBUILDTRUNCATETASKINPUTS") == "1"; 240public readonly bool DoNotTruncateConditions = Environment.GetEnvironmentVariable("MSBuildDoNotTruncateConditions") == "1"; 245public readonly bool AlwaysEvaluateDangerousGlobs = Environment.GetEnvironmentVariable("MSBuildAlwaysEvaluateDangerousGlobs") == "1"; 250public readonly bool AlwaysDoImmutableFilesUpToDateCheck = Environment.GetEnvironmentVariable("MSBUILDDONOTCACHEMODIFICATIONTIME") == "1"; 255public readonly bool CopyWithoutDelete = Environment.GetEnvironmentVariable("MSBUILDCOPYWITHOUTDELETE") == "1"; 272_logProjectImports = !String.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDLOGIMPORTS")); 289_logTaskInputs = Environment.GetEnvironmentVariable("MSBUILDLOGTASKINPUTS") == "1"; 308var variable = Environment.GetEnvironmentVariable("MSBUILDLOGPROPERTIESANDITEMSAFTEREVALUATION"); 328public readonly bool CacheAssemblyInformation = Environment.GetEnvironmentVariable("MSBUILDDONOTCACHERARASSEMBLYINFORMATION") != "1"; 335public readonly bool UseSymlinkTimeInsteadOfTargetTime = Environment.GetEnvironmentVariable("MSBUILDUSESYMLINKTIMESTAMP") == "1"; 340public readonly bool ReuseTaskHostNodes = Environment.GetEnvironmentVariable("MSBUILDREUSETASKHOSTNODES") == "1"; 345public readonly bool IgnoreEmptyImports = Environment.GetEnvironmentVariable("MSBUILDIGNOREEMPTYIMPORTS") == "1"; 350public readonly bool IgnoreTreatAsLocalProperty = Environment.GetEnvironmentVariable("MSBUILDIGNORETREATASLOCALPROPERTY") != null; 355public readonly bool DebugEvaluation = Environment.GetEnvironmentVariable("MSBUILDDEBUGEVALUATION") != null; 360public readonly bool WarnOnUninitializedProperty = !String.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDWARNONUNINITIALIZEDPROPERTY")); 368public readonly bool UseCaseSensitiveItemNames = Environment.GetEnvironmentVariable("MSBUILDUSECASESENSITIVEITEMNAMES") == "1"; 373public readonly bool DisableLongPaths = Environment.GetEnvironmentVariable("MSBUILDDISABLELONGPATHS") == "1"; 378public readonly bool DisableSdkResolutionCache = Environment.GetEnvironmentVariable("MSBUILDDISABLESDKCACHE") == "1"; 383public readonly bool TargetPathForRelatedFiles = Environment.GetEnvironmentVariable("MSBUILDTARGETPATHFORRELATEDFILES") == "1"; 388public readonly bool UseSingleLoadContext = Environment.GetEnvironmentVariable("MSBUILDSINGLELOADCONTEXT") == "1"; 395public readonly bool UseCustomLoadContextForDependenciesInToolsDirectory = Environment.GetEnvironmentVariable("MSBUILDUSECUSTOMLOADCONTEXTFORDEPENDENCIESINTOOLSDIRECTORY") == "1"; 400public readonly bool UseAutoRunWhenLaunchingProcessUnderCmd = Environment.GetEnvironmentVariable("MSBUILDUSERAUTORUNINCMD") == "1"; 405public readonly bool AvoidUnicodeWhenWritingToolTaskBatch = Environment.GetEnvironmentVariable("MSBUILDAVOIDUNICODE") == "1"; 410public readonly bool EnsureStdOutForChildNodesIsPrimaryStdout = Environment.GetEnvironmentVariable("MSBUILDENSURESTDOUTFORTASKPROCESSES") == "1"; 418public readonly bool UseMinimalResxParsingInCoreScenarios = Environment.GetEnvironmentVariable("MSBUILDUSEMINIMALRESX") == "1"; 426public readonly bool DoNotVersionBuildResult = Environment.GetEnvironmentVariable("MSBUILDDONOTVERSIONBUILDRESULT") == "1"; 431public readonly bool DoNotLimitBuildCheckResultsNumber = Environment.GetEnvironmentVariable("MSBUILDDONOTLIMITBUILDCHECKRESULTSNUMBER") == "1"; 466var value = Environment.GetEnvironmentVariable(environmentVariable); 485var mode = Environment.GetEnvironmentVariable("MSBUILD_PROJECTINSTANCE_TRANSLATION_MODE"); 509var mode = Environment.GetEnvironmentVariable("MSBUILD_SDKREFERENCE_PROPERTY_EXPANSION_MODE");
Utilities\FrameworkLocationHelper.cs (11)
140internal static readonly string programFiles = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles); 550if (Environment.Is64BitProcess && s_fallbackDotNetFrameworkSdkInstallPath == null) 789string complusInstallRoot = Environment.GetEnvironmentVariable("COMPLUS_INSTALLROOT"); 790string complusVersion = Environment.GetEnvironmentVariable("COMPLUS_VERSION"); 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.Framework.UnitTests (19)
AssemblyLoadBuildEventArgs_Tests.cs (2)
32int packetVersion = (Environment.Version.Major * 10) + Environment.Version.Minor;
BuildCanceledEventArgs_Tests.cs (2)
30int packetVersion = (Environment.Version.Major * 10) + Environment.Version.Minor;
BuildCheckTracingEventArgs_Tests.cs (2)
45int packetVersion = (Environment.Version.Major * 10) + Environment.Version.Minor;
BuildSubmissionStartedEventArgs_Tests.cs (2)
53int packetVersion = (Environment.Version.Major * 10) + Environment.Version.Minor;
CommunicationUtilities_Tests.cs (3)
22IDictionary referenceVars = Environment.GetEnvironmentVariables(); 55Environment.GetEnvironmentVariable(testName1).ShouldBe(testValue); 56Environment.GetEnvironmentVariable(testName2).ShouldBe(null);
CustomEventArgSerialization_Tests.cs (2)
37private int _eventArgVersion = (Environment.Version.Major * 10) + Environment.Version.Minor;
FileUtilities_Tests.cs (2)
817string directory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "subfolder");
GeneratedFileUsedEventArgs_Tests.cs (2)
27int packetVersion = (Environment.Version.Major * 10) + Environment.Version.Minor;
WorkerNodeTelemetryEventArgs_Tests.cs (2)
41int packetVersion = (Environment.Version.Major * 10) + Environment.Version.Minor;
Microsoft.Build.Tasks.CodeAnalysis (20)
src\Compilers\Core\MSBuildTask\ManagedCompiler.cs (1)
647string? libDirectory = Environment.GetEnvironmentVariable("LIB");
src\Compilers\Core\MSBuildTask\ManagedToolTask.cs (2)
264.. Environment.GetEnvironmentVariables().Cast<System.Collections.DictionaryEntry>() 271if (RuntimeHostInfo.ShouldDisableTieredCompilation && Environment.GetEnvironmentVariable(RuntimeHostInfo.DotNetTieredCompilationEnvironmentName) == null)
src\Compilers\Core\MSBuildTask\Vbc.cs (1)
240private static readonly string[] s_separator = { Environment.NewLine };
src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\Compilers\Shared\BuildServerConnection.cs (4)
212var originalThreadId = Environment.CurrentManagedThreadId; 273var releaseThreadId = Environment.CurrentManagedThreadId; 554var environmentVariables = GetServerEnvironmentVariables(Environment.GetEnvironmentVariables(), logger); 674var userName = Environment.UserName;
src\Compilers\Shared\CompilerServerLogger.cs (3)
120loggingFilePath = Environment.GetEnvironmentVariable(EnvironmentVariableName); 153var threadId = Environment.CurrentManagedThreadId; 155string output = prefix + message + Environment.NewLine;
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\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
Microsoft.Build.Tasks.CodeAnalysis.Sdk (20)
src\Compilers\Core\MSBuildTask\ManagedCompiler.cs (1)
647string? libDirectory = Environment.GetEnvironmentVariable("LIB");
src\Compilers\Core\MSBuildTask\ManagedToolTask.cs (2)
264.. Environment.GetEnvironmentVariables().Cast<System.Collections.DictionaryEntry>() 271if (RuntimeHostInfo.ShouldDisableTieredCompilation && Environment.GetEnvironmentVariable(RuntimeHostInfo.DotNetTieredCompilationEnvironmentName) == null)
src\Compilers\Core\MSBuildTask\Vbc.cs (1)
240private static readonly string[] s_separator = { Environment.NewLine };
src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\Compilers\Shared\BuildServerConnection.cs (4)
212var originalThreadId = Environment.CurrentManagedThreadId; 273var releaseThreadId = Environment.CurrentManagedThreadId; 554var environmentVariables = GetServerEnvironmentVariables(Environment.GetEnvironmentVariables(), logger); 674var userName = Environment.UserName;
src\Compilers\Shared\CompilerServerLogger.cs (3)
120loggingFilePath = Environment.GetEnvironmentVariable(EnvironmentVariableName); 153var threadId = Environment.CurrentManagedThreadId; 155string output = prefix + message + Environment.NewLine;
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\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (18)
DotNetSdkTests.cs (3)
30var root3 = Environment.GetEnvironmentVariable("NUGET_PACKAGES"); 31root3 ??= Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget", "packages");
MapSourceRootTests.cs (12)
269"MapSourceRoots.NoSuchTopLevelSourceRoot", "SourceRoot.ContainingRoot", "SourceRoot", Utilities.GetFullPathNoThrow(path2))) + Environment.NewLine + 271"MapSourceRoots.NoSuchTopLevelSourceRoot", "SourceRoot.ContainingRoot", "SourceRoot", Utilities.GetFullPathNoThrow(path1))) + Environment.NewLine, engine.Log); 330"MapSourceRoots.ContainsDuplicate", "SourceRoot", Utilities.GetFullPathNoThrow(path1), "SourceControl", "git", "tfvc")) + Environment.NewLine + 332"MapSourceRoots.ContainsDuplicate", "SourceRoot", Utilities.GetFullPathNoThrow(path1), "RevisionId", "RevId1", "RevId2")) + Environment.NewLine + 334"MapSourceRoots.ContainsDuplicate", "SourceRoot", Utilities.GetFullPathNoThrow(path1), "NestedRoot", "NR1A", "NR1B")) + Environment.NewLine + 336"MapSourceRoots.ContainsDuplicate", "SourceRoot", Utilities.GetFullPathNoThrow(path1), "ContainingRoot", path3, "CR")) + Environment.NewLine + 338"MapSourceRoots.ContainsDuplicate", "SourceRoot", Utilities.GetFullPathNoThrow(path1), "MappedPath", "MP1", "MP2")) + Environment.NewLine + 340"MapSourceRoots.ContainsDuplicate", "SourceRoot", Utilities.GetFullPathNoThrow(path1), "SourceLinkUrl", "URL1", "URL2")) + Environment.NewLine, 378"MapSourceRoots.NoSuchTopLevelSourceRoot", "SourceRoot.ContainingRoot", "SourceRoot", Utilities.GetFullPathNoThrow(Utilities.FixFilePath(@"c:\MyProjects\MyProject\")))) + Environment.NewLine, engine.Log); 407"MapSourceRoots.NoSuchTopLevelSourceRoot", "SourceRoot.ContainingRoot", "SourceRoot", @"")) + Environment.NewLine, engine.Log); 441"MapSourceRoots.NoTopLevelSourceRoot", "SourceRoot", "DeterministicSourcePaths")) + Environment.NewLine, engine.Log); 497string.Join(Environment.NewLine, task.MappedSourceRoots.Select(InspectSourceRoot)));
TestUtilities\DotNetSdkTestBase.cs (3)
75var dotnetInstallDir = Environment.GetEnvironmentVariable("DOTNET_INSTALL_DIR"); 78dotnetInstallDir = Environment.GetEnvironmentVariable("PATH")?.Split(Path.PathSeparator).FirstOrDefault(isMatchingDotNetInstance); 121{string.Join(Environment.NewLine + " ", expressions.SelectWithIndex((e, i) => $@"<_Value{i}>{e}</_Value{i}><_Value{i} Condition=""'$(_Value{i})' == ''"">{EmptyValueMarker}</_Value{i}>"))}
Microsoft.Build.Tasks.Core (72)
AssemblyDependency\AssemblyFoldersFromConfig\AssemblyFoldersFromConfigCache.cs (1)
43if (Environment.GetEnvironmentVariable("MSBUILDDISABLEASSEMBLYFOLDERSEXCACHE") != null)
AssemblyDependency\AssemblyFoldersFromConfig\AssemblyFoldersFromConfigResolver.cs (1)
118bool useCache = Environment.GetEnvironmentVariable("MSBUILDDISABLEASSEMBLYFOLDERSEXCACHE") == null;
AssemblyDependency\Node\OutOfProcRarNode.cs (1)
23: this(Environment.ProcessorCount)
AssemblyDependency\ResolveAssemblyReference.cs (2)
2240_logVerboseSearchResults = Environment.GetEnvironmentVariable("MSBUILDLOGVERBOSERARSEARCHRESULTS") != null; 2945string dumpFrameworkSubsetList = Environment.GetEnvironmentVariable("MSBUILDDUMPFRAMEWORKSUBSETLIST");
AssemblyFoldersEx.cs (1)
85bool is64bitOS = Environment.Is64BitOperatingSystem;
AssemblyFoldersFromConfig.cs (1)
43if (Environment.Is64BitOperatingSystem)
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),
DebugUtils.cs (3)
178builder.Append(Environment.NewLine); 181builder.Append(Environment.NewLine); 183builder.Append(Environment.NewLine);
Exec.cs (1)
511return 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}");
LogMessagePacketBase.cs (2)
260private static readonly int s_defaultPacketVersion = (Environment.Version.Major * 10) + Environment.Version.Minor;
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)
229$"{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);
Tracing.cs (2)
60string val = Environment.GetEnvironmentVariable("MSBUILDTRACEINTERVAL"); 121Trace.WriteLine(System.Environment.StackTrace);
Microsoft.Build.Tasks.UnitTests (98)
AssemblyDependency\ResolveAssemblyReferenceTestFixture.cs (2)
178Environment.SetEnvironmentVariable("MSBUILDDISABLEASSEMBLYFOLDERSEXCACHE", "1"); 185Environment.SetEnvironmentVariable("MSBUILDDISABLEASSEMBLYFOLDERSEXCACHE", null);
Copy_Tests.cs (12)
105_alwaysOverwriteReadOnlyFiles = Environment.GetEnvironmentVariable(Copy.AlwaysOverwriteReadOnlyFilesEnvVar); 106_alwaysRetry = Environment.GetEnvironmentVariable(Copy.AlwaysRetryEnvVar); 108Environment.SetEnvironmentVariable(Copy.AlwaysOverwriteReadOnlyFilesEnvVar, null); 109Environment.SetEnvironmentVariable(Copy.AlwaysRetryEnvVar, null); 117Environment.SetEnvironmentVariable(Copy.AlwaysOverwriteReadOnlyFilesEnvVar, _alwaysOverwriteReadOnlyFiles); 118Environment.SetEnvironmentVariable(Copy.AlwaysRetryEnvVar, _alwaysRetry); 839string oldAlwaysOverwriteValue = Environment.GetEnvironmentVariable(Copy.AlwaysOverwriteReadOnlyFilesEnvVar); 843Environment.SetEnvironmentVariable(Copy.AlwaysOverwriteReadOnlyFilesEnvVar, "1 "); 888Environment.SetEnvironmentVariable(Copy.AlwaysOverwriteReadOnlyFilesEnvVar, oldAlwaysOverwriteValue); 906string oldAlwaysRetryValue = Environment.GetEnvironmentVariable(Copy.AlwaysRetryEnvVar); 910Environment.SetEnvironmentVariable(Copy.AlwaysRetryEnvVar, "1 "); 957Environment.SetEnvironmentVariable(Copy.AlwaysRetryEnvVar, oldAlwaysRetryValue);
Exec_Tests.cs (22)
291Environment.GetFolderPath(Environment.SpecialFolder.Windows); // not desktop etc - IT redirection messes it up 303string working = @"\\" + Environment.MachineName + @"\c$"; 311string system = Environment.GetFolderPath(Environment.SpecialFolder.System); 323Environment.GetFolderPath(Environment.SpecialFolder.Windows) : "/usr/lib"); 346string oldTmp = Environment.GetEnvironmentVariable("TMP"); 359Environment.SetEnvironmentVariable("TMP", newTmp); 367Environment.SetEnvironmentVariable("TMP", oldTmp); 383string oldTmp = Environment.GetEnvironmentVariable("TMP"); 396Environment.SetEnvironmentVariable("TMP", newTmp); 405Environment.SetEnvironmentVariable("TMP", oldTmp); 421string oldTmp = Environment.GetEnvironmentVariable("TMP"); 434Environment.SetEnvironmentVariable("TMP", newTmp); 442Environment.SetEnvironmentVariable("TMP", oldTmp); 458string oldTmp = Environment.GetEnvironmentVariable("TMP"); 471Environment.SetEnvironmentVariable("TMP", newTmp); 479Environment.SetEnvironmentVariable("TMP", oldTmp); 872string oldValue = Environment.GetEnvironmentVariable("errorlevel"); 877Environment.SetEnvironmentVariable("errorlevel", "1"); 884Environment.SetEnvironmentVariable("errorlevel", oldValue);
FormatUrl_Tests.cs (4)
76t.OutputUrl.ShouldBe(new Uri(Path.Combine(Environment.CurrentDirectory, t.InputUrl)).AbsoluteUri); 116t.InputUrl = Environment.CurrentDirectory; 133t.OutputUrl.ShouldBe(new Uri(Environment.CurrentDirectory).AbsoluteUri); 175t.OutputUrl.ShouldBe(@"https://" + Environment.MachineName.ToLowerInvariant() + "/Example/Path");
GetInstalledSDKLocations_Tests.cs (10)
275Environment.SetEnvironmentVariable("MSBUILDSDKREFERENCEDIRECTORY", _fakeSDKStructureRoot + ";" + _fakeSDKStructureRoot2); 276Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", "true"); 309Environment.SetEnvironmentVariable("MSBUILDSDKREFERENCEDIRECTORY", null); 310Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", null); 322Environment.SetEnvironmentVariable("MSBUILDSDKREFERENCEDIRECTORY", _fakeSDKStructureRoot + ";" + _fakeSDKStructureRoot2); 323Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", "true"); 383Environment.SetEnvironmentVariable("MSBUILDSDKREFERENCEDIRECTORY", null); 384Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", null); 396Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", "true"); 457Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", null);
HintPathResolver_Tests.cs (2)
54bool result = ResolveHintPath(Environment.NewLine + tempFile.Path + Environment.NewLine);
RegressionTests.cs (1)
79Assert.True(result, "Output:" + Environment.NewLine + logger.FullLog);
ResolveSDKReference_Tests.cs (20)
3765Environment.SetEnvironmentVariable("MSBUILDSDKREFERENCEDIRECTORY", testDirectoryRoot); 3766Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", "true"); 3834Environment.SetEnvironmentVariable("MSBUILDSDKREFERENCEDIRECTORY", null); 3835Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", null); 3906Environment.SetEnvironmentVariable("MSBUILDSDKREFERENCEDIRECTORY", testDirectoryRoot); 3907Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", "true"); 3977Environment.SetEnvironmentVariable("MSBUILDSDKREFERENCEDIRECTORY", null); 3978Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", null); 4028Environment.SetEnvironmentVariable("MSBUILDSDKREFERENCEDIRECTORY", testDirectoryRoot); 4029Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", "true"); 4086Environment.SetEnvironmentVariable("MSBUILDSDKREFERENCEDIRECTORY", null); 4087Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", null); 4133Environment.SetEnvironmentVariable("MSBUILDSDKREFERENCEDIRECTORY", testDirectoryRoot); 4134Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", "true"); 4185Environment.SetEnvironmentVariable("MSBUILDSDKREFERENCEDIRECTORY", null); 4186Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", null); 4272Environment.SetEnvironmentVariable("MSBUILDSDKREFERENCEDIRECTORY", testDirectoryRoot); 4273Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", "true"); 4317Environment.SetEnvironmentVariable("MSBUILDSDKREFERENCEDIRECTORY", null); 4318Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", null);
RoslynCodeTaskFactory_Tests.cs (1)
953var dotnetPath = Environment.GetEnvironmentVariable(Constants.DotnetHostPathEnvVarName);
TaskFactoryUtilities_Tests.cs (1)
58var directories = new List<string> { Environment.CurrentDirectory };
WriteCodeFragment_Tests.cs (4)
619var multilineString = String.Join(Environment.NewLine, lines); 656var multilineString = String.Join(Environment.NewLine, lines); 1271string expectedContent = string.Join(Environment.NewLine, expectedHeader.Concat(expectedAttributes)); 1275Environment.NewLine,
WriteLinesToFile_Tests.cs (3)
435maxNodeCount: Environment.ProcessorCount, 496maxNodeCount: Environment.ProcessorCount, 579maxNodeCount: Environment.ProcessorCount,
XmlPoke_Tests.cs (16)
60nodes.ShouldNotBeNull($"There should be <variable /> elements with a Name attribute {Environment.NewLine}{xmlDocument.OuterXml}"); 62nodes.Count.ShouldBe(3, $"There should be 3 <variable /> elements with a Name attribute {Environment.NewLine}{xmlDocument.OuterXml}"); 64nodes.ShouldAllBe(i => i.Value.Equals("Mert"), $"All <variable /> elements should have Name=\"Mert\" {Environment.NewLine}{xmlDocument.OuterXml}"); 77nodes.ShouldNotBeNull($"There should be <variable /> elements with a Name attribute {Environment.NewLine}{xmlDocument.OuterXml}"); 79nodes.Count.ShouldBe(3, $"There should be 3 <variable /> elements with a Name attribute {Environment.NewLine}{xmlDocument.OuterXml}"); 81nodes.ShouldAllBe(i => i.Value.Equals(value), $"All <variable /> elements should have Name=\"{value}\" {Environment.NewLine}{xmlDocument.OuterXml}"); 94nodes.ShouldNotBeNull($"There should be <class /> elements with an AccessModifier attribute {Environment.NewLine}{xmlDocument.OuterXml}"); 96nodes.Count.ShouldBe(1, $"There should be 1 <class /> element with an AccessModifier attribute {Environment.NewLine}{xmlDocument.OuterXml}"); 111nodes.ShouldNotBeNull($"There should be <class /> elements {Environment.NewLine}{xmlDocument.OuterXml}"); 113nodes.Count.ShouldBe(1, $"There should be 1 <class /> element {Environment.NewLine}{xmlDocument.OuterXml}"); 117testNodes.ShouldNotBeNull($"There should be <class /> elements with one child Test element {Environment.NewLine}{xmlDocument.OuterXml}"); 119testNodes.Count.ShouldBe(1, $"There should be 1 <class /> element with one child Test element {Environment.NewLine}{xmlDocument.OuterXml}"); 135nodes.ShouldNotBeNull($"There should be <class /> element with an AccessModifier attribute {Environment.NewLine}{xmlDocument.OuterXml}"); 137nodes.Count.ShouldBe(1, $"There should be 1 <class /> element with an AccessModifier attribute {Environment.NewLine}{xmlDocument.OuterXml}"); 311nodes.ShouldNotBeNull($"There should be <variable/> elements {Environment.NewLine}{xmlDocument.OuterXml}"); 313nodes.Count.ShouldBe(3, $"There should be 3 <variable/> elements {Environment.NewLine}{xmlDocument.OuterXml}");
Microsoft.Build.UnitTests.Shared (26)
EnvironmentProvider.cs (3)
114getEnvironmentVariable = Environment.GetEnvironmentVariable; 122getEnvironmentVariable ??= Environment.GetEnvironmentVariable; 132currentProcessPath = Environment.ProcessPath;
MockEngine.cs (2)
176string message = $"Received telemetry event '{eventName}'{Environment.NewLine}"; 179message += $" Property '{key}' = '{properties[key]}'{Environment.NewLine}";
RequiresSymbolicLinksFactAttribute.cs (1)
18bool.TryParse(Environment.GetEnvironmentVariable("TF_BUILD"), out bool value) && value;
RunnerUtilities.cs (1)
102var comSpec = Environment.GetEnvironmentVariable("ComSpec");
TestEnvironment.cs (19)
176() => Environment.GetEnvironmentVariable(environmentVariableName))); 475_initialEnvironment = Environment.GetEnvironmentVariables(); 480var environment = Environment.GetEnvironmentVariables(); 629Environment.SetEnvironmentVariable(key, tempPath); 641Environment.SetEnvironmentVariable(key, tempPaths[key]); 651[TMP] = Environment.GetEnvironmentVariable(TMP), 652[TEMP] = Environment.GetEnvironmentVariable(TEMP) 657tempPaths[TMPDIR] = Environment.GetEnvironmentVariable(TMPDIR); 709_previousDebugEngineEnv = Environment.GetEnvironmentVariable("MSBuildDebugEngine"); 710_previousDebugPath = Environment.GetEnvironmentVariable("MSBUILDDEBUGPATH"); 714Environment.SetEnvironmentVariable("MSBuildDebugEngine", "1"); 715Environment.SetEnvironmentVariable("MSBUILDDEBUGPATH", FileUtilities.TempFileDirectory); 719Environment.SetEnvironmentVariable("MSBuildDebugEngine", null); 720Environment.SetEnvironmentVariable("MSBUILDDEBUGPATH", null); 726Environment.SetEnvironmentVariable("MSBuildDebugEngine", _previousDebugEngineEnv); 727Environment.SetEnvironmentVariable("MSBUILDDEBUGPATH", _previousDebugPath); 823_originalValue = Environment.GetEnvironmentVariable(environmentVariableName); 825Environment.SetEnvironmentVariable(environmentVariableName, newValue); 832public override void Revert() => Environment.SetEnvironmentVariable(_environmentVariableName, _originalValue);
Microsoft.Build.Utilities.Core (36)
AssemblyFolders\AssemblyFoldersFromConfigInfo.cs (1)
35DirectoryPath = Environment.ExpandEnvironmentVariables(directoryPath);
AssemblyFoldersEx.cs (1)
85bool is64bitOS = Environment.Is64BitOperatingSystem;
AssemblyFoldersFromConfig.cs (1)
43if (Environment.Is64BitOperatingSystem)
CommandLineBuilder.cs (1)
220CommandLine.Append(Environment.NewLine);
DebugUtils.cs (3)
178builder.Append(Environment.NewLine); 181builder.Append(Environment.NewLine); 183builder.Append(Environment.NewLine);
TaskLoggingHelper.cs (5)
1258message += Environment.NewLine + exception.StackTrace; 1454string initialLeaseTimeFromEnvironment = Environment.GetEnvironmentVariable("MSBUILDTASKLOGGINGHELPERINITIALLEASETIME"); 1474string leaseExtensionTimeFromEnvironment = Environment.GetEnvironmentVariable("MSBUILDTASKLOGGINGHELPERLEASEEXTENSIONTIME"); 1623bool diagnostics = Environment.GetEnvironmentVariable("MSBUILDDIAGNOSTICS") != null; 1630message += Environment.NewLine + exception.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); 1554$@"%SystemRoot%\System32\chcp.com {encoding.CodePage}>nul{Environment.NewLine}",
Tracing.cs (2)
60string val = Environment.GetEnvironmentVariable("MSBUILDTRACEINTERVAL"); 121Trace.WriteLine(System.Environment.StackTrace);
TrackedDependencies\FileTracker.cs (11)
91private static readonly string s_applicationDataPath = FileUtilities.EnsureTrailingSlash(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData).ToUpperInvariant()); 94private static readonly string s_localApplicationDataPath = FileUtilities.EnsureTrailingSlash(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData).ToUpperInvariant()); 98private static readonly string s_localLowApplicationDataPath = FileUtilities.EnsureTrailingSlash(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "AppData\\LocalLow").ToUpperInvariant()); 130string defaultCommonApplicationDataPath = FileUtilities.EnsureTrailingSlash(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData).ToUpperInvariant()); 404string oldPath = Environment.GetEnvironmentVariable(pathEnvironmentVariableName); 409Environment.SetEnvironmentVariable(pathEnvironmentVariableName, Path.GetDirectoryName(fileTrackerPath) + pathSeparator + oldPath); 422string[] paths = Environment.GetEnvironmentVariable(pathEnvironmentVariableName).Split(pathSeparatorArray, StringSplitOptions.RemoveEmptyEntries);
Microsoft.Build.Utilities.UnitTests (45)
MuxLogger_Tests.cs (2)
129mockLogger.FullLog.Replace(Environment.NewLine, "").ShouldBe(mockLogger2.FullLog.Replace(Environment.NewLine, ""));
ToolLocationHelper_Tests.cs (27)
654if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("ProgramFiles(x86)"))) 1950Environment.SpecialFolder folder = Environment.Is64BitOperatingSystem ? Environment.SpecialFolder.ProgramFilesX86 : Environment.SpecialFolder.ProgramFiles; 1951string programFilesX86 = Environment.GetFolderPath(folder); 2141if (!Environment.Is64BitOperatingSystem) 2162if (!Environment.Is64BitProcess) 2187if (!Environment.Is64BitOperatingSystem) 2232if (Environment.Is64BitOperatingSystem) 2270if (Environment.Is64BitOperatingSystem) 2983Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", "true"); 3008Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", null); 3020Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", "true"); 3054Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", null); 3472Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", "True"); 3503Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", null); 3516Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", "True"); 3529Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", null); 3561Environment.SetEnvironmentVariable("MSBUILDSDKREFERENCEDIRECTORY", testDirectoryRoot); 3562Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", "true"); 3593Environment.SetEnvironmentVariable("MSBUILDSDKREFERENCEDIRECTORY", null); 3594Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", null); 3635Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", "true"); 3663Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", null); 4047Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", "true"); 4076Environment.SetEnvironmentVariable("MSBUILDDISABLEREGISTRYFORSDKLOOKUP", null);
ToolTask_Tests.cs (16)
43NativeMethodsShared.IsUnixLike ? "/bin" : Environment.GetFolderPath(Environment.SpecialFolder.System), 168string systemPath = NativeMethodsShared.IsUnixLike ? "/bin" : Environment.GetFolderPath(Environment.SpecialFolder.System); 277string pattern = $"{commandLine}{Environment.NewLine}\\s*{displayMessage}"; 424string systemPath = NativeMethodsShared.IsUnixLike ? "/bin" : Environment.GetFolderPath(Environment.SpecialFolder.System); 477string systemPath = NativeMethodsShared.IsUnixLike ? "/bin" : Environment.GetFolderPath(Environment.SpecialFolder.System); 631Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), 729env.SetEnvironmentVariable("PATH", $"{tempDirectory}{Path.PathSeparator}{Environment.GetEnvironmentVariable("PATH")}"); 764expectedCmdPath = new[] { Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "cmd.exe").ToUpperInvariant() }; 1132: Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "ping.exe");
Microsoft.Cci.Extensions (2)
HostEnvironment.cs (1)
726string resolvedPath = Environment.ExpandEnvironmentVariables(path);
Writers\Syntax\TokenSyntaxWriter.cs (1)
58Write(Environment.NewLine);
Microsoft.CodeAnalysis (30)
Collections\CachingFactory.cs (1)
200Environment.ProcessorCount * 2);
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
337private readonly int _workerCount = Environment.ProcessorCount;
DiagnosticAnalyzer\AnalyzerExecutor.cs (3)
1351Environment.FailFast(CreateAnalyzerExceptionDiagnostic(analyzer, ex, info).ToString()); 1405var contextInformation = string.Join(Environment.NewLine, CreateDiagnosticDescription(info, e), CreateDisablingMessage(analyzer, analyzerName)).Trim(); 1418return 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)
344Environment.FailFast(CreateGeneratorExceptionDiagnostic(messageProvider, sourceGenerator, e, isInit).ToString());
src\Compilers\Core\AnalyzerDriver\AnalyzerExceptionDescriptionBuilder.cs (2)
16private static readonly string s_separator = Environment.NewLine + "-----" + Environment.NewLine;
src\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
112: this(factory, Environment.ProcessorCount * 2, trimOnFree)
Microsoft.CodeAnalysis.Analyzers (28)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (2)
99var parentPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
58if (Environment.OSVersion.Platform == PlatformID.Win32NT)
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\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
112: this(factory, Environment.ProcessorCount * 2, trimOnFree)
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\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (1)
173foreach (var line in child.ToString().Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingOptions2.cs (1)
47_ => Environment.NewLine
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\LineFormattingOptions.cs (1)
19[DataMember] public string NewLine { get; init; } = Environment.NewLine;
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
285: reason + Environment.NewLine + restString;
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.Analyzers.UnitTests (3)
MetaAnalyzers\ReleaseTrackingAnalyzerTests.cs (3)
566var diagnosticText = (shippedText.Length > 0 ? shippedText : unshippedText).Split([Environment.NewLine], StringSplitOptions.None).ElementAt(line - 1); 801var lineCount = (shippedText.Length > 0 ? shippedText : unshippedText).Split([Environment.NewLine], StringSplitOptions.None).Length; 832var lineCount = (shippedText.Length > 0 ? shippedText : unshippedText).Split([Environment.NewLine], StringSplitOptions.None).Length;
Microsoft.CodeAnalysis.AnalyzerUtilities (28)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (2)
99var parentPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
58if (Environment.OSVersion.Platform == PlatformID.Win32NT)
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\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
112: this(factory, Environment.ProcessorCount * 2, trimOnFree)
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\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (1)
173foreach (var line in child.ToString().Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingOptions2.cs (1)
47_ => Environment.NewLine
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\LineFormattingOptions.cs (1)
19[DataMember] public string NewLine { get; init; } = Environment.NewLine;
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
285: reason + Environment.NewLine + restString;
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.BannedApiAnalyzers (28)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (2)
99var parentPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
58if (Environment.OSVersion.Platform == PlatformID.Win32NT)
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\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
112: this(factory, Environment.ProcessorCount * 2, trimOnFree)
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\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (1)
173foreach (var line in child.ToString().Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingOptions2.cs (1)
47_ => Environment.NewLine
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\LineFormattingOptions.cs (1)
19[DataMember] public string NewLine { get; init; } = Environment.NewLine;
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
285: reason + Environment.NewLine + restString;
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 (28)
src\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderHelper.cs (1)
122var eolLength = Environment.NewLine.Length;
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (2)
99var parentPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
58if (Environment.OSVersion.Platform == PlatformID.Win32NT)
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\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
112: this(factory, Environment.ProcessorCount * 2, trimOnFree)
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingOptions2.cs (1)
47_ => Environment.NewLine
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\LineFormattingOptions.cs (1)
19[DataMember] public string NewLine { get; init; } = Environment.NewLine;
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
285: reason + Environment.NewLine + restString;
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.UnitTestUtilities (2)
src\Features\DiagnosticsTestUtilities\CodeActions\CSharpVerifierHelper.cs (2)
27var commandLineArguments = CSharpCommandLineParser.Default.Parse(args, baseDirectory: Environment.CurrentDirectory, sdkDirectory: Environment.CurrentDirectory);
Microsoft.CodeAnalysis.Collections.Package (4)
src\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
112: this(factory, Environment.ProcessorCount * 2, trimOnFree)
Microsoft.CodeAnalysis.Contracts.Package (3)
ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
91var newLine = Environment.NewLine;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\DocumentationComments\CSharpAddDocCommentNodesCodeFixProvider.cs (2)
81return elementNode.WithTrailingTrivia(SyntaxFactory.ParseTrailingTrivia(Environment.NewLine)); 85SyntaxFactory.ParseLeadingTrivia(Environment.NewLine)
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (7)
src\Analyzers\CSharp\Tests\ConvertNamespace\ConvertToBlockScopedNamespaceAnalyzerTests.cs (1)
30yield return new object[] { Environment.NewLine };
src\Analyzers\CSharp\Tests\Formatting\FormattingAnalyzerTests.cs (6)
25"class X[| |]" + Environment.NewLine + 26"{" + Environment.NewLine + 27"}" + Environment.NewLine; 29"class X" + Environment.NewLine + 30"{" + Environment.NewLine + 31"}" + Environment.NewLine;
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (15)
CommandLineTests.cs (14)
4806Assert.True(match.Success, $"Expected pattern:{Environment.NewLine}{pattern}{Environment.NewLine}Actual:{Environment.NewLine}{output}"); 6025.Replace(Environment.NewLine, string.Empty), workingDirectory: tempDir) : 6060.Replace(Environment.NewLine, string.Empty), workingDirectory: tempDir) : 6140.Replace(Environment.NewLine, string.Empty)) : 8230var errorLines = outWriter.ToString().Trim().Split(new string[] { Environment.NewLine }, StringSplitOptions.None); 8243errorLines = outWriter.ToString().Trim().Split(new string[] { Environment.NewLine }, StringSplitOptions.None); 9012Assert.Contains($"error CS0016: Could not write to output file '{exePath}' -- 'Fake IOException'{Environment.NewLine}", outWriter.ToString()); 9035Assert.Contains($"error CS0016: Could not write to output file '{pdbPath}' -- 'Fake IOException'{Environment.NewLine}", outWriter.ToString()); 9057Assert.Equal($"error CS0016: Could not write to output file '{xmlPath}' -- 'Fake IOException'{Environment.NewLine}", outWriter.ToString()); 9087Assert.Equal($"error CS0016: Could not write to output file '{sourceLinkPath}' -- 'Fake IOException'{Environment.NewLine}", outWriter.ToString()); 10664expectedExitCode, exitCode, Environment.NewLine, Environment.NewLine, output));
TouchedFileLoggingTests.cs (1)
24private static readonly string s_libDirectory = Environment.GetEnvironmentVariable("LIB");
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (16)
AutomaticCompletion\AutomaticBraceCompletionTests.cs (1)
1374buffer.Insert(10, Environment.NewLine);
Completion\ArgumentProviders\ArgumentProviderOrderTests.cs (2)
47string.Join(Environment.NewLine, expectedOrder.Select(x => x.FullName)), 48string.Join(Environment.NewLine, actualOrder.Select(x => x.FullName)));
Completion\CompletionProviders\AwaitCompletionProviderTests.cs (1)
832var data = (n$$) {{(hasNewline ? Environment.NewLine : string.Empty)}} M();
Completion\CompletionProviders\CompletionProviderOrderTests.cs (2)
86string.Join(Environment.NewLine, expectedOrder.Select(x => x.FullName)), 87string.Join(Environment.NewLine, actualOrder.Select(x => x.FullName)));
Completion\CompletionProviders\ExtensionMemberImportCompletionProviderTests.cs (2)
2771? $"using AA;{Environment.NewLine}{Environment.NewLine}"
Completion\CompletionProviders\KeywordCompletionProviderTests.cs (1)
500var data = (n$$) {{(hasNewline ? Environment.NewLine : string.Empty)}} M();
Completion\CompletionProviders\ReferenceDirectiveCompletionProviderTests.cs (1)
85var systemDir = Path.GetFullPath(Environment.SystemDirectory);
Completion\CompletionProviders\SnippetCompletionProviderTests.cs (2)
41=> await VerifyItemExistsAsync(@"$$", MockSnippetInfoService.SnippetShortcut, MockSnippetInfoService.SnippetTitle + Environment.NewLine + MockSnippetInfoService.SnippetDescription + Environment.NewLine + string.Format(FeaturesResources.Note_colon_Tab_twice_to_insert_the_0_snippet, MockSnippetInfoService.SnippetShortcut), SourceCodeKind.Regular);
Completion\CompletionProviders\TypeImportCompletionProviderTests.cs (2)
1927? $"using Foo;{Environment.NewLine}{Environment.NewLine}"
Debugging\ProximityExpressionsGetterTests.cs (1)
99{{string.Join(Environment.NewLine, body.ReplaceLineEndings("\n").Split('\n').Select(line => line == "" ? line : $" {line}"))}}
Formatting\FormattingEngineTests.cs (1)
1538var endOfFile = trailingNewLine ? Environment.NewLine : "";
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (15)
CodeGen\CodeGenAsyncLocalsTests.cs (3)
36var actualLines = c.VisualizeIL(qualifiedMethodName).Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); 38return string.Join(Environment.NewLine, 41select pair.line1.Trim() + Environment.NewLine + pair.line2.Trim());
CodeGen\CodeGenAsyncSpillTests.cs (1)
10186var expectedOutput = new bool[] { false, true, false, true, false }.Aggregate("", (str, next) => str += $"{next}{Environment.NewLine}");
CodeGen\CodeGenClosureLambdaTests.cs (5)
1461CompileAndVerify(source, expectedOutput: $"this: D::F{Environment.NewLine}base: B1::F"); 1520CompileAndVerify(source, expectedOutput: $"this: D::F{Environment.NewLine}base: B1::F"); 1694CompileAndVerify(source, expectedOutput: $"D::F{Environment.NewLine}B1::F"); 1747CompileAndVerify(source, expectedOutput: $"D::F{Environment.NewLine}B1::F"); 1802CompileAndVerify(source, expectedOutput: $"D::F{Environment.NewLine}B1::F");
CodeGen\CodeGenLocalFunctionTests.cs (2)
4728VerifyOutput(src, $"10{Environment.NewLine}4", TestOptions.ReleaseExe.WithAllowUnsafe(true), verify: Verification.Fails); 6356var usingBlock = string.Join(Environment.NewLine, usings);
CodeGen\CodeGenTests.cs (3)
2619CompileAndVerify(source, expectedOutput: $"A.P.get;B.P.set;A.P.get;B.P.set;{Environment.NewLine}A.P.get;B.P.set;D.P.get;B.P.set;"). 2790CompileAndVerify(source, expectedOutput: $"A.P.get;C.P.set;C.P.get;B.P.set;{Environment.NewLine}A.P.get;B.P.set;D.P.get;B.P.set;"). 2961CompileAndVerify(source, expectedOutput: $"B.P.get;C.P.set;C.P.get;B.P.set;{Environment.NewLine}B.P.get;D.P.set;D.P.get;B.P.set;").
Emit\DynamicAnalysis\DynamicInstrumentationTests.cs (1)
4123Assert.True(expected == instrumented, $"Method '{qualifiedMethodName}' should {(expected ? "be" : "not be")} instrumented. Actual IL:{Environment.NewLine}{il}");
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (7)
Emit\LocalStateTracing\LocalStateTracingTests.cs (4)
198verify: s_verification with { ILVerifyMessage = ilVerifyMessage + Environment.NewLine + s_verification.ILVerifyMessage }, 221$"Method '{qualifiedMethodName}' should {(expected ? "be" : "not be")} instrumented. Actual IL:{Environment.NewLine}{il}"); 377ILVerifyMessage = s_verification.ILVerifyMessage + Environment.NewLine + """ 4377verify: s_verification with { ILVerifyMessage = ilVerifyMessage + Environment.NewLine + s_verification.ILVerifyMessage },
Emit\RuntimeProbing\ModuleCancellationTests.cs (1)
40$"Method '{qualifiedMethodName}' should not be instrumented with '{instrumentationIndicator}'. Actual IL:{Environment.NewLine}{il}");
Emit\RuntimeProbing\StackOverflowProbingTests.cs (1)
33$"Method '{qualifiedMethodName}' should not be instrumented. Actual IL:{Environment.NewLine}{il}");
PDB\PDBTests.cs (1)
435.Join(Environment.NewLine);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (4)
Diagnostics\DiagnosticAnalyzerTests.cs (1)
1407if (Environment.ProcessorCount <= 1)
RefReadonlyParameterTests.cs (2)
7832CreateCompilation(source2 + Environment.NewLine + source3, new[] { comp1Ref }, parseOptions: TestOptions.Regular11).VerifyDiagnostics( 8624CreateCompilation(source2 + Environment.NewLine + source3, new[] { comp1Ref }, parseOptions: TestOptions.Regular11).VerifyDiagnostics(
Semantics\ExtensionTests2.cs (1)
27368var escapedNewline = Environment.NewLine switch
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (2)
EndToEndTests.cs (2)
357var source = string.Join(Environment.NewLine, declarations); 401var source = string.Join(Environment.NewLine, declarations);
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\Analyzers\CSharp\CodeFixes\DocumentationComments\CSharpAddDocCommentNodesCodeFixProvider.cs (2)
81return elementNode.WithTrailingTrivia(SyntaxFactory.ParseTrailingTrivia(Environment.NewLine)); 85SyntaxFactory.ParseLeadingTrivia(Environment.NewLine)
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (17)
ConvertBetweenRegularAndVerbatimString\ConvertBetweenRegularAndVerbatimInterpolatedStringTests.cs (1)
20private static string NewLineEscape { get; } = Environment.NewLine == "\r\n" ? @"\r\n" : @"\n";
ConvertBetweenRegularAndVerbatimString\ConvertBetweenRegularAndVerbatimStringTests.cs (1)
20private static string NewLineEscape { get; } = Environment.NewLine == "\r\n" ? @"\r\n" : @"\n";
ConvertNamespace\ConvertNamespaceRefactoringTests.cs (1)
25public static IEnumerable<object[]> EndOfDocumentSequences => [[""], [Environment.NewLine]];
ConvertProgram\ConvertToTopLevelStatementsAnalyzerTests.cs (1)
28yield return new object[] { Environment.NewLine };
ConvertToRawString\ConvertInterpolatedStringToRawString_FixAllTests.cs (1)
19private static string NewLineEscape { get; } = Environment.NewLine == "\r\n" ? @"\r\n" : @"\n";
ConvertToRawString\ConvertRegularStringToRawString_FixAllTests.cs (1)
20private static string NewLineEscape { get; } = Environment.NewLine == "\r\n" ? @"\r\n" : @"\n";
Copilot\CSharpImplementNotImplementedExceptionFixProviderTests.cs (1)
441Message = $"The generated implementation isn't a valid method or property:{Environment.NewLine}{replacement}",
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (3)
61$"{Environment.NewLine}Expected span: '{expectedText}' {expected}" + 62$"{Environment.NewLine}Actual span: '{actualText}' {actual}"); 767.Select(d => $"{d.Id}: {d.GetMessage().Split([Environment.NewLine], StringSplitOptions.None).First()}"));
src\Analyzers\CSharp\Tests\ConvertNamespace\ConvertToBlockScopedNamespaceAnalyzerTests.cs (1)
30yield return new object[] { Environment.NewLine };
src\Analyzers\CSharp\Tests\Formatting\FormattingAnalyzerTests.cs (6)
25"class X[| |]" + Environment.NewLine + 26"{" + Environment.NewLine + 27"}" + Environment.NewLine; 29"class X" + Environment.NewLine + 30"{" + Environment.NewLine + 31"}" + Environment.NewLine;
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (1)
InteractiveSessionReferencesTests.cs (1)
107Assert.Equal(Environment.Version, s.Result.ReturnValue);
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (8)
InteractiveSessionTests.cs (4)
417Assert.Equal(Environment.ProcessorCount, result); 457Assert.Equal(Environment.ProcessorCount, script.EvaluateAsync().Result); 466Assert.Equal(Environment.ProcessorCount, state.Result.ReturnValue); 469Assert.Equal(Environment.ProcessorCount, state.Result.ReturnValue);
ObjectFormatterTests.cs (4)
374Assert.Equal($"LongMembers {{{Environment.NewLine} LongName0123456789...{Environment.NewLine} LongValue: \"012345...{Environment.NewLine}}}{Environment.NewLine}", str);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (22)
Semantics\ConstantTests.cs (7)
1459var result = string.Join(Environment.NewLine, constants); 2995var source = string.Join(Environment.NewLine, range.Select(i => 3025var source = string.Join(Environment.NewLine, range.Select(i => 3082var source = string.Join(Environment.NewLine, range.Select(i => 3112var source = string.Join(Environment.NewLine, range.Select(i => 3172var source = string.Join(Environment.NewLine, range.Select(i => 3205var source = string.Join(Environment.NewLine, range.Select(i =>
Semantics\GenericConstraintsTests.cs (1)
2523options: TestOptions.UnsafeReleaseExe, verify: Verification.Fails, expectedOutput: string.Join(Environment.NewLine, type, size)).VerifyIL("Test.M<T>", @"
Semantics\MethodBodyModelTests.cs (1)
797Assert.Equal(string.Empty, string.Join(Environment.NewLine, comp.GetDiagnostics()));
Semantics\OperatorTests.cs (5)
3212.Split(new[] { Environment.NewLine }, System.StringSplitOptions.RemoveEmptyEntries) 12200CompileAndVerify(source: source, expectedOutput: "abcdef" + Environment.NewLine + "abcdef" + Environment.NewLine + "abcdef"); 12251CompileAndVerify(source: source, expectedOutput: "3" + Environment.NewLine + "3" + Environment.NewLine);
Semantics\OverloadResolutionTestBase.cs (1)
48.Split(new[] { Environment.NewLine }, System.StringSplitOptions.RemoveEmptyEntries)
Semantics\UnsafeTests.cs (3)
29if (Environment.NewLine == "\n") 33else if (Environment.NewLine == "\r\n") 5320var actual = string.Join(Environment.NewLine, builder);
SourceGeneration\GeneratorDriverTests.cs (4)
1260source = source.Replace(Environment.NewLine, "\r\n"); 1351source = source.Replace(Environment.NewLine, "\r\n"); 2175spc.AddSource("InvokedMethods.g.cs", string.Join(Environment.NewLine, 4315var expectedDetails = $"System.{typeName}: {message}{Environment.NewLine} ";
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Symbols\AnonymousTypesSemanticsTests.cs (1)
2141foreach (var line in source.Split(new String[] { Environment.NewLine }, StringSplitOptions.None))
Symbols\Source\CompletionTests.cs (1)
123Parallel.For(0, Math.Max(1, Environment.ProcessorCount - 1), t =>
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (85)
Diagnostics\LocationsTests.cs (1)
239AssertMappedSpanEqual(syntaxTree, $"System;{Environment.NewLine}class X", "c:\\goo.cs", 0, 6, 1, 7, hasMappedPath: false);
LexicalAndXml\DocumentationCommentLexerTestBase.cs (1)
70Console.WriteLine(string.Join("," + Environment.NewLine, baseline));
LexicalAndXml\PreprocessorTests.cs (10)
2104Assert.Equal($"#region A//B{Environment.NewLine}", regionDirective.ToFullString()); 2126Assert.Equal($"#region A/\\B{Environment.NewLine}", regionDirective.ToFullString()); 2214Assert.Equal($"#region \"{Environment.NewLine}", regionDirective.ToFullString()); 2235Assert.Equal($"#region \" {Environment.NewLine}", regionDirective.ToFullString()); 2256Assert.Equal($"#region \"goo\"{Environment.NewLine}", regionDirective.ToFullString()); 2277Assert.Equal($"#region \"goo\" {Environment.NewLine}", regionDirective.ToFullString()); 2298Assert.Equal($"#region \"\"{Environment.NewLine}", regionDirective.ToFullString()); 2319Assert.Equal($"#region \"\" {Environment.NewLine}", regionDirective.ToFullString()); 2340Assert.Equal($"#region \"\"\"{Environment.NewLine}", regionDirective.ToFullString()); 2361Assert.Equal($"#region \"\"\" {Environment.NewLine}", regionDirective.ToFullString());
LexicalAndXml\XmlDocCommentTests.cs (67)
153Assert.Equal($"/// <goo />{Environment.NewLine}", node.ToFullString()); 328Assert.Equal($"<goo {Environment.NewLine}/// />", doc.Content[1].ToFullString()); 346Assert.Equal($"/// <goo {Environment.NewLine}/// />{Environment.NewLine}", node.ToFullString()); 352Assert.Equal($"<goo {Environment.NewLine}/// />", doc.Content[1].ToFullString()); 377Assert.Equal($"<goo {Environment.NewLine} * />", doc.Content[1].ToFullString()); 397Assert.Equal($"/** <goo {Environment.NewLine} * />{Environment.NewLine} */", node.ToFullString()); 403Assert.Equal($"<goo {Environment.NewLine} * />", doc.Content[1].ToFullString()); 771Assert.Equal(Environment.NewLine, textsyntax.ChildNodesAndTokens()[0].ToString()); 773Assert.Equal(Environment.NewLine, textsyntax.ChildNodesAndTokens()[2].ToString()); 805Assert.Equal(Environment.NewLine, textsyntax.ChildNodesAndTokens()[0].ToString()); 807Assert.Equal(Environment.NewLine, textsyntax.ChildNodesAndTokens()[2].ToString()); 835Assert.Equal(Environment.NewLine, cdata.TextTokens[1].ToString()); 837Assert.Equal(Environment.NewLine, cdata.TextTokens[3].ToString()); 866Assert.Equal(Environment.NewLine, cdata.TextTokens[1].ToString()); 868Assert.Equal(Environment.NewLine, cdata.TextTokens[3].ToString()); 910Assert.Equal($"/// <![CDATA[ incomplete{Environment.NewLine}", node.ToFullString()); 920Assert.Equal(Environment.NewLine, cdata.TextTokens[1].ToString()); 997Assert.Equal(Environment.NewLine, comment.TextTokens[1].ToString()); 999Assert.Equal(Environment.NewLine, comment.TextTokens[3].ToString()); 1028Assert.Equal(Environment.NewLine, comment.TextTokens[1].ToString()); 1030Assert.Equal(Environment.NewLine, comment.TextTokens[3].ToString()); 1072Assert.Equal($"/// <!-- incomplete{Environment.NewLine}", node.ToFullString()); 1082Assert.Equal(Environment.NewLine, comment.TextTokens[1].ToString()); 1135Assert.Equal(Environment.NewLine, ProcessingInstruction.TextTokens[1].ToString()); 1137Assert.Equal(Environment.NewLine, ProcessingInstruction.TextTokens[3].ToString()); 1169Assert.Equal(Environment.NewLine, ProcessingInstruction.TextTokens[1].ToString()); 1171Assert.Equal(Environment.NewLine, ProcessingInstruction.TextTokens[3].ToString()); 1655Assert.Equal(Environment.NewLine, xmltext.ChildNodesAndTokens()[0].ToString()); 1661Assert.Equal(Environment.NewLine, xmltext.ChildNodesAndTokens()[2].ToString()); 2398Assert.Equal($"///</Goo>{Environment.NewLine}", xmlText.TextTokens.ToFullString()); 2950SyntaxFactory.XmlNewLine(Environment.NewLine), 2955SyntaxFactory.XmlNewLine(Environment.NewLine)), 2956SyntaxFactory.XmlNewLine(Environment.NewLine), 2958SyntaxFactory.XmlNewLine(Environment.NewLine), 2977SyntaxFactory.XmlNewLine(Environment.NewLine), 2979SyntaxFactory.XmlNewLine(Environment.NewLine))); 2997SyntaxFactory.XmlNewLine(Environment.NewLine), 3005SyntaxFactory.XmlNewLine(Environment.NewLine))); 3041SyntaxFactory.XmlNewLine(Environment.NewLine), 3043SyntaxFactory.XmlNewLine(Environment.NewLine)), 3044SyntaxFactory.XmlNewLine(Environment.NewLine), 3045SyntaxFactory.XmlNewLine(Environment.NewLine), 3046SyntaxFactory.XmlNewLine(Environment.NewLine), 3048SyntaxFactory.XmlNewLine(Environment.NewLine), 3049SyntaxFactory.XmlNewLine(Environment.NewLine))); 3069SyntaxFactory.XmlNewLine(Environment.NewLine), 3071SyntaxFactory.XmlNewLine(Environment.NewLine)), 3072SyntaxFactory.XmlNewLine(Environment.NewLine), 3074SyntaxFactory.XmlNewLine(Environment.NewLine), 3096SyntaxFactory.XmlNewLine(Environment.NewLine), 3097SyntaxFactory.XmlNewLine(Environment.NewLine)), 3098SyntaxFactory.XmlNewLine(Environment.NewLine), 3100SyntaxFactory.XmlNewLine(Environment.NewLine), 3102SyntaxFactory.XmlNewLine(Environment.NewLine))); 3123SyntaxFactory.XmlNewLine(Environment.NewLine), 3124SyntaxFactory.XmlNewLine(Environment.NewLine)), 3125SyntaxFactory.XmlNewLine(Environment.NewLine), 3127SyntaxFactory.XmlNewLine(Environment.NewLine), 3131SyntaxFactory.XmlNewLine(Environment.NewLine))); 3150SyntaxFactory.XmlNewLine(Environment.NewLine), 3151SyntaxFactory.XmlNewLine(Environment.NewLine)), 3152SyntaxFactory.XmlNewLine(Environment.NewLine), 3175SyntaxFactory.XmlNewLine(Environment.NewLine), 3176SyntaxFactory.XmlNewLine(Environment.NewLine)), 3177SyntaxFactory.XmlNewLine(Environment.NewLine),
Syntax\SyntaxNormalizerTests.cs (6)
3865$" ///<summary>{Environment.NewLine}" + 3866$" /// A documentation comment{Environment.NewLine}" + 3867$" ///</summary>{Environment.NewLine}" + 3893$" /// <summary>{Environment.NewLine}" + 3894$" /// A documentation comment{Environment.NewLine}" + 3895$" /// </summary>{Environment.NewLine}" +
Microsoft.CodeAnalysis.CSharp.Test.Utilities (4)
DiagnosticTestUtilities.cs (2)
110Environment.NewLine, 111actualLength == 0 ? "<none>" : string.Join(Environment.NewLine, actualErrors)));
MockCSharpCompiler.cs (1)
33: base(CSharpCommandLineParser.Default, responseFile, args, buildPaths, Environment.GetEnvironmentVariable("LIB"), loader ?? new AnalyzerAssemblyLoader(), driverCache)
RuntimeAsyncTestHelpers.cs (1)
18public static bool IsRuntimeAsyncEnabled { get; } = Environment.GetEnvironmentVariable("DOTNET_RuntimeAsync") == "1";
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
91var newLine = Environment.NewLine;
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (5)
Formatting\FormattingTests.cs (2)
9904var lines = s.Split([Environment.NewLine], StringSplitOptions.None); 9913return string.Join(Environment.NewLine, lines);
Formatting\FormattingTriviaTests.cs (1)
1687var newLine = Environment.NewLine;
OrganizeImports\OrganizeUsingsTests.cs (2)
30var document = project.AddDocument("Document", initial.ReplaceLineEndings(endOfLine ?? Environment.NewLine)); 42Assert.Equal(final.ReplaceLineEndings(endOfLine ?? Environment.NewLine), newRoot.ToFullString());
Microsoft.CodeAnalysis.Debugging.Package (4)
src\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
112: this(factory, Environment.ProcessorCount * 2, trimOnFree)
Microsoft.CodeAnalysis.EditorFeatures (11)
ExtractMethod\ExtractMethodCommandHandler.cs (6)
237EditorFeaturesResources.Extract_method_encountered_the_following_issues + Environment.NewLine + 238string.Join("", result.Reasons.Select(r => Environment.NewLine + " " + r)), 251EditorFeaturesResources.Extract_method_encountered_the_following_issues + Environment.NewLine + 252string.Join("", result.Reasons.Select(r => Environment.NewLine + " " + r)) + Environment.NewLine + Environment.NewLine +
Preview\AbstractPreviewFactoryService.cs (1)
449: string.Join(Environment.NewLine, conflictDescriptions.Concat(warningDescriptions));
Preview\DifferenceViewerPreview.cs (1)
84if (Environment.HasShutdownStarted)
Shared\Utilities\ResettableDelay.cs (2)
53_lastSetTime = Environment.TickCount; 69while (Environment.TickCount - _lastSetTime < _delayInMilliseconds);
Tagging\AbstractAsynchronousTaggerProvider.TagSource_ReferenceCounting.cs (1)
20if (!Environment.HasShutdownStarted)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (6)
AutomaticCompletion\AbstractAutomaticBraceCompletionTests.cs (2)
78Type(session, Environment.NewLine); 101Type(session, Environment.NewLine);
ObsoleteSymbol\AbstractObsoleteSymbolTests.cs (2)
44string.Join(Environment.NewLine, expectedSpans), 45string.Join(Environment.NewLine, actualSpans));
QuickInfo\AbstractQuickInfoSourceTests.cs (1)
23return string.Concat(System.Environment.NewLine, formattedCode);
Threading\StaTaskScheduler.cs (1)
25public bool IsRunningInScheduler => StaThread.ManagedThreadId == Environment.CurrentManagedThreadId;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (8)
CodeFixes\CodeFixServiceTests.cs (2)
598=> exception.Message + Environment.NewLine + exception.StackTrace; 1041code = Environment.NewLine + code;
Diagnostics\IDEDiagnosticIDConfigurationTests.cs (5)
104expectedLines = expected.Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries); 756Environment.NewLine + 757string.Join(Environment.NewLine, baseline.Select(Inspect))); 770Environment.NewLine + 771string.Join(Environment.NewLine, extraEntitiesBuilder.Select(Inspect)));
Structure\AbstractStructureTaggerProviderTests.cs (1)
19var buffer = EditorFactory.CreateBuffer(exportProvider, input.Split([Environment.NewLine], StringSplitOptions.None));
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
DkmUtilities.cs (1)
347$"EE: AppDomain {appDomain.Id}, blocks {context.MetadataBlocks.Length}, contexts {context.AssemblyContexts.Count}" + Environment.NewLine,
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (6)
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
112: this(factory, Environment.ProcessorCount * 2, trimOnFree)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (10)
Debugger\Engine\DkmClrType.cs (1)
343var vsVersion = System.Environment.GetEnvironmentVariable("VisualStudioVersion") ?? "14.0";
Debugger\Engine\DkmClrValue.cs (3)
94var intPtr = Environment.Is64BitProcess ? new IntPtr((long)RawValue) : new IntPtr((int)RawValue); 550if (Environment.Is64BitProcess) 803? (Environment.Is64BitProcess ? typeof(long) : typeof(int))
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
112: this(factory, Environment.ProcessorCount * 2, trimOnFree)
Microsoft.CodeAnalysis.Extensions.Package (4)
src\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
112: this(factory, Environment.ProcessorCount * 2, trimOnFree)
Microsoft.CodeAnalysis.ExternalAccess.Copilot (1)
Internal\SemanticSearch\CopilotSemanticSearchQueryExecutor.cs (1)
48RuntimeException ??= $"{exception.TypeName.ToVisibleDisplayString(includeLeftToRightMarker: false)}: {exception.Message}{Environment.NewLine}{exception.StackTrace.ToVisibleDisplayString(includeLeftToRightMarker: false)}";
Microsoft.CodeAnalysis.ExternalAccess.OmniSharp (1)
Options\OmniSharpLineFormattingOptions.cs (1)
14public string NewLine { get; init; } = Environment.NewLine;
Microsoft.CodeAnalysis.ExternalAccess.Xaml (1)
External\ConversionHelpers.cs (1)
25.SelectMany(section => section.TaggedParts.Add(new TaggedText(TextTags.LineBreak, 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\Analyzers\Core\Analyzers\FileHeaders\AbstractFileHeaderHelper.cs (1)
122var eolLength = Environment.NewLine.Length;
src\Compilers\Core\AnalyzerDriver\AnalyzerExceptionDescriptionBuilder.cs (2)
16private static readonly string s_separator = Environment.NewLine + "-----" + Environment.NewLine;
Microsoft.CodeAnalysis.Features.Test.Utilities (8)
EditAndContinue\ActiveStatementTestHelpers.cs (1)
88src = src[..start] + string.Join("", Enumerable.Repeat(Environment.NewLine, lineCount)) + src[end..];
EditAndContinue\EditAndContinueTestVerifier.cs (1)
461throw new Exception($"Unable to find node with span {span} `{root.GetText().GetSubText(span)}` in:{Environment.NewLine}{root}");
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (2)
83=> CreateText("[*.*]" + Environment.NewLine + string.Join(Environment.NewLine, analyzerConfig.Select(c => $"{c.key} = {c.value}")));
EditAndContinue\Extensions.cs (2)
103=> "[*.*]" + Environment.NewLine + string.Join(Environment.NewLine, config.Select(c => $"{c.key} = {c.value}"));
EditAndContinue\RudeEditDiagnosticDescription.cs (2)
58"""{Environment.NewLine}{_squiggle}{Environment.NewLine}"""
Microsoft.CodeAnalysis.Features.UnitTests (2)
FindUsages\DefinitionItemFactoryTests.cs (2)
75itemSeparator: "," + Environment.NewLine, 125=> propertyName == null ? null : $"{Environment.NewLine}{nameof(DefinitionItem)}.{propertyName} does not match expected value.";
Microsoft.CodeAnalysis.InteractiveHost (18)
Interactive\Core\InteractiveHost.Service.cs (6)
111FileUtilities.NormalizeDirectoryPath(Environment.GetFolderPath(Environment.SpecialFolder.Windows)), 112FileUtilities.NormalizeDirectoryPath(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)), 113FileUtilities.NormalizeDirectoryPath(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86)),
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (2)
99var parentPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
58if (Environment.OSVersion.Platform == PlatformID.Win32NT)
src\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
112: this(factory, Environment.ProcessorCount * 2, trimOnFree)
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.LanguageServer (16)
DotnetCliHelper.cs (1)
135var path = Environment.GetEnvironmentVariable("PATH") ?? "";
FileBasedPrograms\VirtualProjectXmlProvider.cs (3)
138: Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); 160var targetFramework = Environment.GetEnvironmentVariable("DOTNET_RUN_FILE_TFM") ?? "net$(BundledNETCoreAppTargetFrameworkVersion)";
HostWorkspace\ProjectDependencyHelper.cs (2)
97+ Environment.NewLine 98+ string.Join(Environment.NewLine, unresolved.Select(r => $" {r.Name}-{r.VersionRange}"));
Program.cs (1)
73logger.LogInformation("Server started with process ID {processId}", Environment.ProcessId);
Testing\RunTestsHandler.cs (2)
52var dotnetRootUser = Environment.GetEnvironmentVariable("DOTNET_ROOT_USER"); 183_logger.LogTrace($".runsettings:{Environment.NewLine}{contents}");
Testing\TestDiscoverer.cs (2)
42var partialResult = new RunTestsPartialResult(LanguageServerResources.Discovering_tests, $"{Environment.NewLine}{LanguageServerResources.Starting_test_discovery}", Progress: null); 84_logger.LogDebug(message: $"Potential test methods in range: {string.Join(Environment.NewLine, potentialTestMethods)}");
Testing\TestRunner.cs (1)
42progress.Report(new RunTestsPartialResult(LanguageServerResources.Running_tests, $"{Environment.NewLine}{LanguageServerResources.Starting_test_run}", initialProgress));
Testing\TestRunner.TestRunHandler.cs (4)
75message = @$"==== {LanguageServerResources.Summary} ===={Environment.NewLine}{state} - {string.Format(LanguageServerResources.Failed_0_Passed_1_Skipped_2_Total_3_Duration_4, stats?.TestsFailed, stats?.TestsPassed, stats?.TestsSkipped, stats?.TotalTests, RunTestsHandler.GetShortTimespan(testRunCompleteArgs.ElapsedTimeInRunningTests))}{Environment.NewLine}"; 192return text.Replace(Environment.NewLine, $"{Environment.NewLine}{indentation}").TrimEnd().Insert(0, indentation);
Microsoft.CodeAnalysis.LanguageServer.Protocol (10)
Extensions\ProtocolConversions.cs (1)
1060var content = markdownBuilder.Build(Environment.NewLine);
Features\DecompiledSource\AssemblyResolver.cs (1)
169=> _logger.AppendFormat(format + Environment.NewLine, args);
Features\DecompiledSource\CSharpCodeDecompilerDecompilationService.cs (2)
73text += "#if false // " + FeaturesResources.Decompilation_log + Environment.NewLine; 75text += "#endif" + Environment.NewLine;
Handler\Hover\HoverHandler.cs (1)
137.. info.Sections.SelectMany(static s => s.TaggedParts.Add(new TaggedText(TextTags.LineBreak, Environment.NewLine)))
RoslynLanguageServer.cs (1)
88Environment.Exit(ServerExitCodes.ClientProcessExited);
src\LanguageServer\Microsoft.CommonLanguageServerProtocol.Framework\AbstractLanguageServer.cs (4)
129throw new InvalidOperationException($"Language specific handlers for {methodGroup.Key} have mis-matched number of parameters:{Environment.NewLine}{string.Join(Environment.NewLine, methodGroup)}"); 134throw new InvalidOperationException($"Language specific handlers for {methodGroup.Key} have mis-matched number of returns:{Environment.NewLine}{string.Join(Environment.NewLine, methodGroup)}");
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (21)
Completion\CompletionFeaturesTests.cs (13)
157: new() { NewText = $"using System.Threading.Tasks;{Environment.NewLine}{Environment.NewLine}", Range = new() { Start = new(1, 0), End = new(1, 0) } }; 242var expectedAdditionalEdit = new TextEdit() { NewText = $"using NS2;{Environment.NewLine}{Environment.NewLine}", Range = new() { Start = new(1, 0), End = new(1, 0) } }; 308var expectedNewPosition = Environment.NewLine.Length == 2 ? 14 : 13; 731var expectedAdditionalEdit1 = new TextEdit() { NewText = $"using Namespace1;{Environment.NewLine}{Environment.NewLine}", Range = new() { Start = new(1, 0), End = new(1, 0) } }; 739var expectedAdditionalEdit2 = new TextEdit() { NewText = $"using Namespace2;{Environment.NewLine}{Environment.NewLine}", Range = new() { Start = new(1, 0), End = new(1, 0) } }; 1062var expectedEdit = new TextEdit { Range = new LSP.Range { Start = new(7, 4), End = new(7, 13) }, NewText = $"public override global::System.Boolean AbstractMethod(global::System.Int32 x){Environment.NewLine} {{{Environment.NewLine} throw new System.NotImplementedException();{Environment.NewLine} }}" }; 1066var expectedNewPosition = Environment.NewLine.Length == 2 ? 268 : 259;
Configuration\DidChangeConfigurationNotificationHandlerTest.cs (2)
158string.Join(Environment.NewLine, expectedNames), 159string.Join(Environment.NewLine, actualNames));
DocumentChanges\DocumentChangesTests.cs (3)
279await DidChange(testLspServer, locationTyped.DocumentUri, (4, 8, "// hi there"), (5, 0, $" // this builds on that{Environment.NewLine}")); 348await DidChange(testLspServer, locationTyped.DocumentUri, (5, 0, $" // this builds on that{Environment.NewLine}"), (4, 8, "// hi there")); 427await DidChange(testLspServer, locationTyped.DocumentUri, (5, 0, $" // this builds on that{Environment.NewLine}"));
SemanticTokens\SemanticTokensRangeTests.cs (1)
497var regexCommentLength = 7 + System.Environment.NewLine.Length;
SpellCheck\SpellCheckTests.cs (2)
78var markup = string.Join(Environment.NewLine, Enumerable.Range(0, 5500).Select(v => 83{{string.Join(Environment.NewLine, Enumerable.Repeat("", random.Next() % 5))}}
Microsoft.CodeAnalysis.LanguageServer.UnitTests (4)
FileBasedProgramsWorkspaceTests.cs (3)
463var textToInsert = $"""Console.WriteLine("Hello World!");{Environment.NewLine}"""; 774var textToInsert = $"#!/usr/bin/env dotnet{Environment.NewLine}"; 776sourceFile.WriteAllText($"#!/usr/bin/env dotnet{Environment.NewLine}{initialText}");
TelemetryReporterTests.cs (1)
24Environment.SetEnvironmentVariable("CommonPropertyBagPath", Path.GetTempFileName());
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (28)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (2)
99var parentPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
58if (Environment.OSVersion.Platform == PlatformID.Win32NT)
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\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
112: this(factory, Environment.ProcessorCount * 2, trimOnFree)
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\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (1)
173foreach (var line in child.ToString().Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingOptions2.cs (1)
47_ => Environment.NewLine
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\LineFormattingOptions.cs (1)
19[DataMember] public string NewLine { get; init; } = Environment.NewLine;
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
285: reason + Environment.NewLine + restString;
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.PooledObjects.Package (4)
ObjectPool`1.cs (1)
112: this(factory, Environment.ProcessorCount * 2, trimOnFree)
src\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
Microsoft.CodeAnalysis.PublicApiAnalyzers (28)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (2)
99var parentPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
58if (Environment.OSVersion.Platform == PlatformID.Win32NT)
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\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
112: this(factory, Environment.ProcessorCount * 2, trimOnFree)
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\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (1)
173foreach (var line in child.ToString().Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingOptions2.cs (1)
47_ => Environment.NewLine
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\LineFormattingOptions.cs (1)
19[DataMember] public string NewLine { get; init; } = Environment.NewLine;
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
285: reason + Environment.NewLine + restString;
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.PublicApiAnalyzers.CodeFixes (1)
PublicApiFixHelpers.cs (1)
93return Environment.NewLine;
Microsoft.CodeAnalysis.PublicApiAnalyzers.UnitTests (1)
DeclarePublicAPIAnalyzerTestsBase.cs (1)
1945""", @"", $"C", $"C{Environment.NewLine}C.Field1 -> int");
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.Razor.UnitTests (2)
DefaultTagHelperDescriptorFactoryTest.cs (2)
1522(Environment.NewLine, [whitespaceErrorString]), 1526(Environment.NewLine + " ", [whitespaceErrorString]),
Microsoft.CodeAnalysis.Razor.Workspaces (16)
CodeActions\Razor\ExtractToCssCodeActionResolver.cs (2)
72: Environment.NewLine + Environment.NewLine + cssContent)]
CodeActions\Razor\PromoteUsingCodeActionResolver.cs (1)
61textToInsert = Environment.NewLine + textToInsert;
CodeActions\Razor\WrapAttributesCodeActionResolver.cs (1)
37edits.Add(LspFactory.CreateTextEdit(start, end, Environment.NewLine + indentationString));
Completion\DirectiveCompletionItemProvider.cs (1)
155var snippetDescription = $"@{snippetTexts.DisplayText}{Environment.NewLine}{SR.DirectiveSnippetDescription}";
Formatting\FormattingContext.cs (1)
60public string NewLineString => Environment.NewLine;
Formatting\FormattingLoggerFactory.cs (1)
12private static string? BaseLogDir { get; } = Environment.GetEnvironmentVariable(LogDirEnvVar);
Formatting\UsingDirectiveHelper.cs (2)
123var newText = $"@using {newUsingNamespace}{Environment.NewLine}"; 168return LspFactory.CreateTextEdit(insertPosition, newText: $"@using {newUsingNamespace}{Environment.NewLine}");
LinkedEditingRange\LinkedEditingRangeHelper.cs (1)
18public static readonly string WordPattern = @"!?[^ <>!\/\?\[\]=""\\@" + Environment.NewLine + "]+";
Logging\LogMessageFormatter.FormattedMessageState.cs (1)
16private static readonly ReadOnlyMemory<char> s_newLine = Environment.NewLine.AsMemory();
Tooltip\ClassifiedTagHelperTooltipFactory.cs (4)
56private static readonly ClassifiedTextRun s_newLine = new(ClassificationTypeNames.WhiteSpace, Environment.NewLine); 378summaryContent = string.Join(Environment.NewLine, lines); 383summaryContent = summaryContent.Replace("<para>", Environment.NewLine); 384summaryContent = summaryContent.Replace("</para>", Environment.NewLine);
Tooltip\MarkupTagHelperTooltipFactory.cs (1)
196var finalSummaryContent = string.Join(Environment.NewLine, lines);
Microsoft.CodeAnalysis.Razor.Workspaces.UnitTests (19)
TagHelperFactsServiceTest.cs (5)
121var startTag = (MarkupTagHelperStartTagSyntax)root.FindInnermostNode(30 + Environment.NewLine.Length); 154var startTag = (MarkupTagHelperStartTagSyntax)root.FindInnermostNode(30 + Environment.NewLine.Length); 178var startTag = (MarkupStartTagSyntax)root.FindInnermostNode(30 + Environment.NewLine.Length); 202var startTag = (MarkupStartTagSyntax)root.FindInnermostNode(30 + Environment.NewLine.Length); 226var startTag = (MarkupStartTagSyntax)root.FindInnermostNode(30 + Environment.NewLine.Length);
TextDifferencing\SourceTextDifferTest.cs (1)
174=> input.Replace(Environment.NewLine, "\r\n");
Tooltip\ClassifiedTagHelperTooltipFactoryTest.cs (11)
211run => run.AssertExpectedClassification(Environment.NewLine, ClassificationTypeNames.WhiteSpace), 255run => run.AssertExpectedClassification(Environment.NewLine, ClassificationTypeNames.WhiteSpace), 295run => run.AssertExpectedClassification(Environment.NewLine, ClassificationTypeNames.WhiteSpace), 302run => run.AssertExpectedClassification(Environment.NewLine, ClassificationTypeNames.WhiteSpace), 303run => run.AssertExpectedClassification(Environment.NewLine, ClassificationTypeNames.WhiteSpace), 309run => run.AssertExpectedClassification(Environment.NewLine, ClassificationTypeNames.WhiteSpace), 361run => run.AssertExpectedClassification(Environment.NewLine, ClassificationTypeNames.WhiteSpace), 415run => run.AssertExpectedClassification(Environment.NewLine, ClassificationTypeNames.WhiteSpace), 422run => run.AssertExpectedClassification(Environment.NewLine, ClassificationTypeNames.WhiteSpace), 423run => run.AssertExpectedClassification(Environment.NewLine, ClassificationTypeNames.WhiteSpace), 436run => run.AssertExpectedClassification(Environment.NewLine, ClassificationTypeNames.WhiteSpace),
Utilities\MemoryCachePerfTest.cs (2)
30var tasks = Enumerable.Range(0, Environment.ProcessorCount) 33for (var i = 0; i < AccessCount / Environment.ProcessorCount; i++)
Microsoft.CodeAnalysis.Remote.Razor (2)
ProjectSystem\GeneratorRunResult.cs (2)
86throw new InvalidOperationException(SR.FormatRazor_source_generator_did_not_produce_a_host_output(project.Name, string.Join(Environment.NewLine, runResult.Diagnostics))); 97throw new InvalidOperationException(SR.FormatRazor_source_generator_host_output_is_not_RazorGeneratorResult(project.Name, string.Join(Environment.NewLine, runResult.Diagnostics)));
Microsoft.CodeAnalysis.Remote.ServiceHub (2)
Services\BrokeredServiceBase.cs (1)
215Environment.SetEnvironmentVariable("MICROSOFT_DIASYMREADER_NATIVE_ALT_LOAD_PATH", loadDir);
src\Compilers\Shared\ThrowingTraceListener.cs (1)
16(string.IsNullOrEmpty(detailMessage) ? "" : Environment.NewLine + detailMessage));
Microsoft.CodeAnalysis.Remote.Workspaces (4)
ExportProviderBuilder.cs (4)
73LogTrace($"Composing MEF catalog using:{Environment.NewLine}{string.Join($" {Environment.NewLine}", AssemblyPaths)}."); 125hashContents.Append(Environment.Version.Major.ToString(System.Globalization.CultureInfo.InvariantCulture)); 213LogError($"Encountered errors in the MEF composition:{Environment.NewLine}{ex.ErrorsAsString}", ex);
Microsoft.CodeAnalysis.ResxSourceGenerator (33)
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\Compilers\Core\Portable\FileSystem\PathUtilities.cs (2)
99var parentPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
58if (Environment.OSVersion.Platform == PlatformID.Win32NT)
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\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
112: this(factory, Environment.ProcessorCount * 2, trimOnFree)
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\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (1)
173foreach (var line in child.ToString().Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingOptions2.cs (1)
47_ => Environment.NewLine
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\LineFormattingOptions.cs (1)
19[DataMember] public string NewLine { get; init; } = Environment.NewLine;
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
285: reason + Environment.NewLine + restString;
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.ResxSourceGenerator.UnitTests (2)
Verifiers\CSharpVerifierHelper.cs (2)
27var commandLineArguments = CSharpCommandLineParser.Default.Parse(args, baseDirectory: Environment.CurrentDirectory, sdkDirectory: Environment.CurrentDirectory);
Microsoft.CodeAnalysis.Scripting (2)
Hosting\ObjectFormatter\CommonObjectFormatter.cs (2)
43newLine: Environment.NewLine, 74builder.Append(Environment.NewLine);
Microsoft.CodeAnalysis.Scripting.Desktop.UnitTests (6)
MetadataShadowCopyProviderTests.cs (6)
31FileUtilities.NormalizeDirectoryPath(Environment.GetFolderPath(Environment.SpecialFolder.Windows)), 32FileUtilities.NormalizeDirectoryPath(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)), 33FileUtilities.NormalizeDirectoryPath(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86)),
Microsoft.CodeAnalysis.Scripting.TestUtilities (5)
ObjectFormatterTestBase.cs (3)
21foreach (var line in str.Split(new[] { Environment.NewLine + " " }, StringSplitOptions.None)) 29Assert.Equal(expected[i] + Environment.NewLine + "}" + Environment.NewLine, line);
TestCSharpObjectFormatter.cs (1)
31newLine: Environment.NewLine,
TestVisualBasicObjectFormatter.cs (1)
32newLine: Environment.NewLine,
Microsoft.CodeAnalysis.Test.Utilities (80)
Assert\ArtifactUploadUtil.cs (1)
60var uploadDir = Environment.GetEnvironmentVariable("HELIX_WORKITEM_UPLOAD_ROOT");
Assert\AssertEx.cs (10)
137Assert.Fail("expected was null, but actual wasn't" + Environment.NewLine + message); 141Assert.Fail("actual was null, but expected wasn't" + Environment.NewLine + message); 160Assert.Fail(message + Environment.NewLine + expectedAndActual); 642private static readonly string s_diffToolPath = Environment.GetEnvironmentVariable("ROSLYN_DIFFTOOL"); 674itemSeparator = "," + Environment.NewLine; 779itemSeparator = "," + Environment.NewLine; 897itemSeparator: Environment.NewLine, 984var stack = ex.StackTrace.Split(new[] { Environment.NewLine }, StringSplitOptions.None); 1010Assert.Fail("Filter does not match any item in the collection: " + Environment.NewLine + 1011ToString(collection, itemSeparator ?? Environment.NewLine, itemInspector));
Assert\ConditionalFactAttribute.cs (1)
272public override bool ShouldSkip => !Environment.Is64BitProcess;
Assert\DiffUtil.cs (1)
99return DiffReport(exlines, aclines, separator: Environment.NewLine);
CommonTestBase.cs (1)
500=> source.Replace(Environment.NewLine, "\r\n");
Compilation\CompilationDifference.cs (1)
99Assert.True(sequencePointMarkers.Count > 0, $"No sequence points found in:{Environment.NewLine}{actualPdb}");
Compilation\CompilationExtensions.cs (4)
40!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("ROSLYN_TEST_IOPERATION")); 47!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("ROSLYN_TEST_USEDASSEMBLIES")); 246actualTextBuilder.Append(Environment.NewLine); 251actualTextBuilder.Append(Environment.NewLine);
Compilation\CompilationTestDataExtensions.cs (3)
71"Could not determine best match for method named: " + qualifiedMethodName + Environment.NewLine + 72string.Join(Environment.NewLine, keys.Select(s => " " + s)) + Environment.NewLine);
Compilation\OperationTreeVerifier.cs (5)
65char[] newLineChars = Environment.NewLine.ToCharArray(); 69expectedOperationTree = expectedOperationTree.Replace("\r\n", "\n").Replace(" \n", "\n").Replace("\n", Environment.NewLine); 163var text = syntax.ToString().Trim(Environment.NewLine.ToCharArray()); 164var lines = text.Split(new[] { Environment.NewLine, "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries).Select(l => l.Trim()).ToArray(); 191LogString(Environment.NewLine);
CompilationVerifier.cs (7)
37internal static string? DumpAssemblyLocation { get; set; } = Environment.GetEnvironmentVariable("ROSLYN_TEST_DUMP_PATH"); 127throw new Exception($"Didn't find method '{methodName}'. Available/distinguishable methods are: {Environment.NewLine}{string.Join(Environment.NewLine, map.Keys)}"); 373Environment.FailFast("Investigating flaky IL verification issue. Tracked by https://github.com/dotnet/roslyn/issues/63782"); 482$"IL Verify failed unexpectedly:{Environment.NewLine}{actualMessage}" : 524return string.Join(Environment.NewLine, result.Select(r => printMethod(r.Method, metadataReader) + r.Message + printErrorArguments(r.ErrorArguments))); 775throw new Exception($"Failed to extract PDB information. PdbToXmlConverter returned:{Environment.NewLine}{actualPdbXml}");
Diagnostics\CommonDiagnosticAnalyzers.cs (8)
157" + String.Join("," + Environment.NewLine + " ", Descriptor1.CustomTags.Select(s => $"\"{s}\"")) + @" 171" + String.Join("," + Environment.NewLine + " ", Descriptor2.CustomTags.Select(s => $"\"{s}\"")) + @" 234" + String.Join("," + Environment.NewLine + " ", Descriptor1.CustomTags.Select(s => $"\"{s}\"")) + @" 248" + String.Join("," + Environment.NewLine + " ", Descriptor2.CustomTags.Select(s => $"\"{s}\"")) + @" 376" + string.Join("," + Environment.NewLine + " ", suppressionKinds.Select(s => $"\"{s}\"")) + @" 474" + string.Join("," + Environment.NewLine + " ", Descriptor1.CustomTags.Select(s => $"\"{s}\"")) + @" 495" + String.Join("," + Environment.NewLine + " ", Descriptor2.CustomTags.Select(s => $"\"{s}\"")) + @" 1131Assert.True(Environment.ProcessorCount > 1, "This analyzer is intended to be used only in a concurrent environment.");
Diagnostics\DiagnosticDescription.cs (1)
541assertText.Append(DiffUtil.DiffReport(unmatchedExpectedText, unmatchedActualText, separator: Environment.NewLine));
Diagnostics\DiagnosticsHelper.cs (3)
21Assert.True(match.Success, "Could not find a match for \"" + pattern + "\" in:" + Environment.NewLine + source); 29Environment.NewLine + "Expected: " + string.Join(", ", expectedDiagnosticIds) + 30Environment.NewLine + "Actual: " + string.Join(", ", actualDiagnosticIds));
Diagnostics\ThrowingDiagnosticAnalyzer.cs (11)
99Assert.True(!handled.Any(h => h == false) && handled.Any(h => true), Environment.NewLine + 100" Exceptions thrown by analyzers in these members were *NOT* handled:" + Environment.NewLine + string.Join(Environment.NewLine, membersHandled.Where(mh => mh.Handled == false).Select(mh => mh.Member)) + Environment.NewLine + Environment.NewLine + 101" Exceptions thrown from these members were handled gracefully:" + Environment.NewLine + string.Join(Environment.NewLine, membersHandled.Where(mh => mh.Handled == true).Select(mh => mh.Member)) + Environment.NewLine + Environment.NewLine + 102" These members were not called/accessed by analyzer engine:" + Environment.NewLine + string.Join(Environment.NewLine, membersHandled.Where(mh => mh.Handled == null).Select(mh => mh.Member)));
Diagnostics\TrackingDiagnosticAnalyzer.cs (4)
167Environment.NewLine + "Expected: " + string.Join(", ", expected) + 168Environment.NewLine + "Actual: " + string.Join(", ", actual)); 177Environment.NewLine + "Missing: " + string.Join(", ", missingElements) + 178Environment.NewLine + "Present: " + string.Join(", ", presentElements));
DotNetCoreSdk.cs (2)
31var dotNetInstallDir = Environment.GetEnvironmentVariable("DOTNET_INSTALL_DIR"); 34dotNetInstallDir = Environment.GetEnvironmentVariable("PATH")!
FX\EnsureEnglishUICulture.cs (3)
35_threadId = Environment.CurrentManagedThreadId; 49Debug.Assert(_threadId == Environment.CurrentManagedThreadId); 51if (_needToRestore && _threadId == Environment.CurrentManagedThreadId)
FX\EnsureInvariantCulture.cs (3)
20_threadId = Environment.CurrentManagedThreadId; 28Debug.Assert(_threadId == Environment.CurrentManagedThreadId); 30if (_threadId == Environment.CurrentManagedThreadId)
FX\ProcessResult.cs (4)
32Environment.NewLine + 34Environment.NewLine + 36Environment.NewLine + 38Environment.NewLine +
Metadata\IlasmUtilities.cs (2)
128"The provided IL cannot be compiled." + Environment.NewLine + 129IlasmPath + " " + arguments + Environment.NewLine +
Platform\Custom\OSVersion.cs (1)
15System.Environment.OSVersion.Version.Build >= 9200;
src\Compilers\Shared\ThrowingTraceListener.cs (1)
16(string.IsNullOrEmpty(detailMessage) ? "" : Environment.NewLine + detailMessage));
TestBase.cs (3)
378resetVariables.Add(variable.Key, Environment.GetEnvironmentVariable(variable.Key)); 379Environment.SetEnvironmentVariable(variable.Key, variable.Value); 388Environment.SetEnvironmentVariable(variable.Key, variable.Value);
Microsoft.CodeAnalysis.TestAnalyzerReference (1)
NonSourceFileRefactoring.cs (1)
28var newText = SourceText.From(text.ToString() + Environment.NewLine + "# Refactored");
Microsoft.CodeAnalysis.Threading.Package (4)
src\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
112: this(factory, Environment.ProcessorCount * 2, trimOnFree)
Microsoft.CodeAnalysis.UnitTests (27)
Analyzers\AnalyzerConfigTests.cs (3)
203var config = ParseConfigFile(string.Join(Environment.NewLine, 351var config = ParseConfigFile(string.Join(Environment.NewLine, 362var config = ParseConfigFile(string.Join(Environment.NewLine,
Diagnostics\SuppressMessageAttributeCompilerTests.cs (3)
167exception.ToString().Substring(0, exception.ToString().IndexOf("---")) + "-----" + Environment.NewLine + Environment.NewLine + 168string.Format(CodeAnalysisResources.CompilerAnalyzerThrows, AnalyzerName, exception.GetType().ToString(), exception.Message, exception.ToString() + Environment.NewLine + "-----"))}")
FileSystem\PathUtilitiesTests.cs (2)
120var expectedParentPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
FileUtilitiesTests.cs (1)
58switch (Environment.OSVersion.Platform)
InvokeUtil.cs (2)
196Assert.Fail($"Test loaded unexpected assemblies into {contextName}:{Environment.NewLine}{string.Join(Environment.NewLine, unexpectedAssemblies)}");
MetadataReferences\ModuleMetadataTests.cs (4)
121char systemDrive = Environment.GetFolderPath(Environment.SpecialFolder.Windows)[0]; 126Assert.Throws<IOException>(() => ModuleMetadata.CreateFromFile(Environment.GetFolderPath(Environment.SpecialFolder.Windows)));
Text\LargeTextTests.cs (2)
198var newline = Environment.NewLine; 214var newlineLength = Environment.NewLine.Length;
Text\StringText_LineTest.cs (6)
18string newLine = Environment.NewLine; 30var text = SourceText.From("goo" + Environment.NewLine); 41var text = SourceText.From("goo" + Environment.NewLine + "bar"); 82var text = SourceText.From("goo" + Environment.NewLine); 97var text = SourceText.From(Environment.NewLine); 100Assert.Equal(Environment.NewLine.Length, line.SpanIncludingLineBreak.Length);
Text\StringTextDecodingTests.cs (1)
220var parallelOptions = new ParallelOptions { MaxDegreeOfParallelism = Environment.ProcessorCount * 2 };
Text\StringTextTest.cs (2)
151string newLine = Environment.NewLine; 167var newlineLength = Environment.NewLine.Length;
Text\StringTextTests_Default.cs (1)
57string newLine = Environment.NewLine;
Microsoft.CodeAnalysis.Workspaces (42)
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;
Remote\IRemoteKeepAliveService.cs (1)
221if (Environment.HasShutdownStarted)
Shared\TestHooks\AsynchronousOperationListenerProvider.cs (2)
207var enabled = Environment.GetEnvironmentVariable("RoslynWaiterEnabled"); 228var enabled = Environment.GetEnvironmentVariable("RoslynWaiterDiagnosticTokenEnabled");
src\Compilers\Core\Portable\DiagnosticAnalyzer\ProgramFilesAnalyzerPathResolver.cs (2)
34var programFilesPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (2)
99var parentPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
58if (Environment.OSVersion.Platform == PlatformID.Win32NT)
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\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
112: this(factory, Environment.ProcessorCount * 2, trimOnFree)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingOptions2.cs (1)
47_ => Environment.NewLine
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\LineFormattingOptions.cs (1)
19[DataMember] public string NewLine { get; init; } = Environment.NewLine;
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
285: reason + Environment.NewLine + restString;
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;
Storage\SQLite\v2\Interop\SqlConnection.cs (1)
449NativeMethods.sqlite3_errmsg(handle) + Environment.NewLine +
Workspace\Host\PersistentStorage\IPersistentStorageConfiguration.cs (3)
50var appDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData, Environment.SpecialFolderOption.Create);
Workspace\ProjectSystem\FileWatchedPortableExecutableReferenceFactory.cs (5)
85if (Environment.GetEnvironmentVariable("DOTNET_ROOT") is string dotnetRoot && !string.IsNullOrEmpty(dotnetRoot)) 92referenceDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "Reference Assemblies", "Microsoft", "Framework")); 93referenceDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "dotnet", "packs"));
Microsoft.CodeAnalysis.Workspaces.MSBuild (7)
MSBuild\BuildHostProcessManager.cs (4)
134throw 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); 177static string GetProcessPath() => Environment.ProcessPath ?? throw new InvalidOperationException("Unable to determine the path of the current process."); 537_logger.LogError("The BuildHost process is not responding. Process output:{newLine}{processLog}", Environment.NewLine, processLog); 539_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\Compilers\Core\Portable\FileSystem\PathUtilities.cs (2)
99var parentPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
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\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (4)
NetCoreTests.cs (2)
395Assert.True(actualNames.SetEquals(expectedNames), $"Project names differ!{Environment.NewLine}Actual: {{{actualNames.Join(",")}}}{Environment.NewLine}Expected: {{{expectedNames.Join(",")}}}");
NewlyCreatedProjectsFromDotNetNew.cs (2)
238if (Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER") is string helixDumpFolder && !string.IsNullOrEmpty(helixDumpFolder)) 293throw new InvalidOperationException(string.Join(Environment.NewLine,
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (3)
MEF\ExportProviderCache.cs (1)
168"Failed to construct the MEF catalog for testing. Multiple exports were found for a part for which only one export is expected:" + Environment.NewLine
Workspaces\TestWorkspace`1.cs (2)
121: $"{title}:{Environment.NewLine}{Environment.NewLine}{message}";
Microsoft.CodeAnalysis.Workspaces.UnitTests (4)
Formatter\FormatterTests.cs (1)
59var escapedNewLine = Environment.NewLine.Replace("\r", @"\r").Replace("\n", @"\n");
WorkspaceServiceTests\TemporaryStorageServiceTests.cs (3)
148if (Environment.Is64BitOperatingSystem && !Environment.Is64BitProcess) 245var random = new Random(Environment.TickCount);
Microsoft.CommonLanguageServerProtocol.Framework.Example (3)
src\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
Microsoft.CommonLanguageServerProtocol.Framework.Package (7)
AbstractLanguageServer.cs (4)
129throw new InvalidOperationException($"Language specific handlers for {methodGroup.Key} have mis-matched number of parameters:{Environment.NewLine}{string.Join(Environment.NewLine, methodGroup)}"); 134throw new InvalidOperationException($"Language specific handlers for {methodGroup.Key} have mis-matched number of returns:{Environment.NewLine}{string.Join(Environment.NewLine, methodGroup)}");
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.DotNet.Arcade.Sdk (2)
src\GenerateResxSource.cs (1)
248namespaceStart = $@"namespace {namespaceName}{Environment.NewLine}{{";
src\LocateDotNet.cs (1)
48var paths = Environment.GetEnvironmentVariable("PATH");
Microsoft.DotNet.ArcadeAzureIntegration (15)
AzureCliCredentialWithAzNoUpdateWrapper.cs (7)
30public static string? EnvProgramFilesX86 => GetNonEmptyStringOrNull(Environment.GetEnvironmentVariable("ProgramFiles(x86)")); 31public static string? EnvProgramFiles => GetNonEmptyStringOrNull(Environment.GetEnvironmentVariable("ProgramFiles")); 32public static string? EnvPath => GetNonEmptyStringOrNull(Environment.GetEnvironmentVariable("PATH")); 35private static readonly string DefaultWorkingDirWindows = Environment.GetFolderPath(Environment.SpecialFolder.System); 62fileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "cmd.exe");
DefaultIdentityTokenCredential.cs (8)
119string? servicePrincipalId = Environment.GetEnvironmentVariable("servicePrincipalId"); 120string? idToken = Environment.GetEnvironmentVariable("idToken"); 121string? tenantId = Environment.GetEnvironmentVariable("tenantId"); 151string? systemAccessToken = Environment.GetEnvironmentVariable("SYSTEM_ACCESSTOKEN"); 152string? clientId = Environment.GetEnvironmentVariable("AZURESUBSCRIPTION_CLIENT_ID"); 153string? tenantId = Environment.GetEnvironmentVariable("AZURESUBSCRIPTION_TENANT_ID"); 154string? serviceConnectionId = Environment.GetEnvironmentVariable("AZURESUBSCRIPTION_SERVICE_CONNECTION_ID"); 160!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("SYSTEM_OIDCREQUESTURI")))
Microsoft.DotNet.Baselines.Tasks (1)
CreateUpdatePR.cs (1)
74public string? GitHubToken { get; set; } = Environment.GetEnvironmentVariable("GH_TOKEN");
Microsoft.DotNet.Build.Tasks.Feed (24)
src\ConfigureInputFeed.cs (12)
33string nugetConfigBody = $"<?xml version=\"1.0\" encoding=\"utf-8\"?>{Environment.NewLine}<configuration>{Environment.NewLine}"; 34nugetConfigBody += $"<!--Don't use any higher level config files.{Environment.NewLine}Our builds need to be isolated from user/ machine state-->{Environment.NewLine}"; 35nugetConfigBody += $"<fallbackPackageFolders>{Environment.NewLine}<clear />{Environment.NewLine}</fallbackPackageFolders>{Environment.NewLine}<packageSources>{Environment.NewLine}<clear />{Environment.NewLine}"; 38nugetConfigBody += $"<add key=\"inputFeed{i}\" value=\"{ EnableFeeds[i].ItemSpec }\" />{Environment.NewLine}"; 40nugetConfigBody += $"</packageSources>{Environment.NewLine}"; 41nugetConfigBody += $"</configuration>{Environment.NewLine}";
src\GetEnvProxy.cs (1)
17var value = Environment.GetEnvironmentVariable(key);
src\PublishArtifactsInManifestBase.cs (9)
622$"Publishing Symbols to Symbol server:" + Environment.NewLine + 623$"\tTemp symbol org: {TempSymbolsAzureDevOpsOrg}" + Environment.NewLine + 624$"\tFinal symbol visibility: {publishVisibility}" + Environment.NewLine + 625$"\tRequest Name: {requestName}" + Environment.NewLine + 626$"\tSymbol packages ({symbolPackagesToPublish.Count}):{Environment.NewLine}\t\t{string.Join($"{Environment.NewLine}\t\t", symbolPackagesToPublish.Select(s => s.Id))}" + Environment.NewLine + 627$"\tLoose symbol files ({looseFiles.Count()}): {Environment.NewLine}\t\t{string.Join($"{Environment.NewLine}\t\t", looseFiles)}");
src\PublishBuildToMaestro.cs (2)
187if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("BUILD_BUILDID"))) 533if (Environment.GetEnvironmentVariable("GITHUB_TOKEN") is string envGitHubToken)
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.Helix.JobSender (5)
JobDefinition.cs (5)
205if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("BUILD_REPOSITORY_NAME")) && !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("BUILD_SOURCEBRANCH"))) 213string repoName = Environment.GetEnvironmentVariable("BUILD_REPOSITORY_NAME"); 214string branchName = Environment.GetEnvironmentVariable("BUILD_SOURCEBRANCH"); 299return Environment.GetEnvironmentVariable(name) ?? throw new ArgumentException("Missing required environment variable", name);
Microsoft.DotNet.Helix.Sdk (4)
AzureDevOpsTask.cs (2)
24private bool InAzurePipeline => !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("BUILD_BUILDNUMBER")); 28var result = Environment.GetEnvironmentVariable(name);
InstallDotNetTool.cs (1)
175Environment.NewLine + (string.IsNullOrEmpty(result.StdErr) ? result.StdOut : result.StdErr));
SendHelixJob.cs (1)
271var value = Environment.GetEnvironmentVariable(envName);
Microsoft.DotNet.Helix.Sdk.Tests (5)
HelpersTests.cs (5)
48string target = Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT") ?? Environment.GetEnvironmentVariable("TEMP") ?? Environment.GetEnvironmentVariable("TMPDIR"), "my-test-file-123456.snt"); 52if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DOCKER_ENTRYPOINT"))) 54target = Path.Combine(Environment.GetEnvironmentVariable("HELIX_WORKITEM_PAYLOAD"), "my-test-file-123456.snt");
Microsoft.DotNet.NuGetRepack.Tests (1)
TestHelpers\DiffUtil.cs (1)
96return DiffReport(exlines, aclines, separator: Environment.NewLine);
Microsoft.DotNet.Open.Api.Tools.Tests (1)
OpenApiAddURLTests.cs (1)
428"indicating failure. The url might be wrong, or there might be a networking issue." + Environment.NewLine, _error.ToString());
Microsoft.DotNet.RemoteExecutor (7)
Program.cs (2)
26Environment.Exit(-1); 113Environment.Exit(exitCode);
RemoteExecutor.cs (4)
95Environment.Version.Major >= 5 || RuntimeInformation.FrameworkDescription.StartsWith(".NET Core", StringComparison.OrdinalIgnoreCase); 104int.TryParse(Environment.GetEnvironmentVariable("DOTNET_TEST_TIMEOUT_MULTIPLIER"), out int failWaitTimeoutMultiplier); 118Environment.GetEnvironmentVariable("DOTNET_REMOTEEXECUTOR_SUPPORTED") != "0"; 538"," + Environment.NewLine,
RemoteInvokeHandle.cs (1)
152string uploadPath = Environment.GetEnvironmentVariable("HELIX_WORKITEM_UPLOAD_ROOT");
Microsoft.DotNet.SharedFramework.Sdk (1)
src\ValidateFileVersions.cs (1)
86string.Concat(versionlessFiles.Select(f => Environment.NewLine + f)));
Microsoft.DotNet.SignCheckLibrary (1)
Utils.cs (1)
166workingDirectory = Environment.CurrentDirectory;
Microsoft.DotNet.SignCheckTask (3)
src\SignCheck.cs (2)
21private static readonly string _appData = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "SignCheck");
src\SignCheckTask.cs (1)
125ArtifactFolder = ArtifactFolder ?? Environment.CurrentDirectory;
Microsoft.DotNet.SignTool (6)
src\BatchSignUtil.cs (1)
47_repackParallelism = repackParallelism != 0 ? repackParallelism : Environment.ProcessorCount;
src\Telemetry.cs (5)
17{ "BUILD_REPOSITORY_URI", Environment.GetEnvironmentVariable("BUILD_REPOSITORY_URI") }, 18{ "BUILD_SOURCEBRANCH", Environment.GetEnvironmentVariable("BUILD_SOURCEBRANCH") }, 19{ "BUILD_BUILDNUMBER", Environment.GetEnvironmentVariable("BUILD_BUILDNUMBER") }, 20{ "BUILD_SOURCEVERSION", Environment.GetEnvironmentVariable("BUILD_SOURCEVERSION") } 29(!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("SIGNTOOL_DISABLE_TELEMETRY")));
Microsoft.DotNet.SignTool.Tests (1)
SignToolTests.cs (1)
364var actualXmlElementsPerSigningRound = buildEngine.FilesToSign.Select(round => string.Join(Environment.NewLine, round));
Microsoft.DotNet.SwaggerGenerator.CmdLine (1)
Program.cs (1)
24Environment.Exit(-1);
Microsoft.DotNet.VersionTools.Cli (1)
Program.cs (1)
16RootCommand rootCommand = new("Microsoft.DotNet.VersionTools.Cli v" + Environment.Version.ToString(2))
Microsoft.DotNet.XUnitExtensions (8)
src\Microsoft.DotNet.XUnitExtensions.Shared\CoreClrConfigurationDetection.cs (2)
54Environment.GetEnvironmentVariable("DOTNET_" + name) ?? Environment.GetEnvironmentVariable("COMPlus_" + name) ?? defaultValue;
src\Microsoft.DotNet.XUnitExtensions.Shared\DesktopTraceListener.cs (1)
26base(message + Environment.NewLine + detailMessage)
src\Microsoft.DotNet.XUnitExtensions.Shared\DiscovererHelpers.cs (2)
17public static bool IsRunningOnNetCoreApp { get; } = (Environment.Version.Major >= 5 || !RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework", StringComparison.OrdinalIgnoreCase)); 32(platforms.HasFlag(TestPlatforms.LinuxBionic) && RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("ANDROID_STORAGE"))) ||
src\Microsoft.DotNet.XUnitExtensions.Shared\Discoverers\SkipOnCIDiscoverer.cs (3)
21if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DOTNET_CI")) || 22!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT")) || 23!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("AGENT_OS")))
Microsoft.DotNet.XUnitV3Extensions (8)
src\Microsoft.DotNet.XUnitExtensions.Shared\Attributes\SkipOnCIAttribute.cs (3)
27if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DOTNET_CI")) || 28!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT")) || 29!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("AGENT_OS")))
src\Microsoft.DotNet.XUnitExtensions.Shared\CoreClrConfigurationDetection.cs (2)
54Environment.GetEnvironmentVariable("DOTNET_" + name) ?? Environment.GetEnvironmentVariable("COMPlus_" + name) ?? defaultValue;
src\Microsoft.DotNet.XUnitExtensions.Shared\DesktopTraceListener.cs (1)
26base(message + Environment.NewLine + detailMessage)
src\Microsoft.DotNet.XUnitExtensions.Shared\DiscovererHelpers.cs (2)
17public static bool IsRunningOnNetCoreApp { get; } = (Environment.Version.Major >= 5 || !RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework", StringComparison.OrdinalIgnoreCase)); 32(platforms.HasFlag(TestPlatforms.LinuxBionic) && RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("ANDROID_STORAGE"))) ||
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.ApiDescription.Client.Tests (5)
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
48if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
src\Shared\Process\ProcessEx.cs (4)
124if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 126startInfo.EnvironmentVariables["NUGET_FALLBACK_PACKAGES"] = Environment.GetEnvironmentVariable("NUGET_FALLBACK_PACKAGES"); 228private static string GetNugetPackagesRestorePath() => (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("NUGET_RESTORE"))) 233: Environment.GetEnvironmentVariable("NUGET_RESTORE");
Microsoft.Extensions.Caching.Hybrid.Tests (2)
HybridCacheEventSourceTests.cs (2)
226log.WriteLine($".NET {Environment.Version} on {Environment.OSVersion}, {IntPtr.Size * 8}-bit");
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (5)
Infrastructure\RedisTestConfig.cs (5)
131return (Environment.GetEnvironmentVariable("STARTED_OWN_REDIS_SERVER") != null); 136var configFilePath = Environment.GetEnvironmentVariable("USERPROFILE"); 142var configFilePath = Environment.GetEnvironmentVariable("DOTNET_PACKAGES"); 185+ tempRedisServerFullPath + " with Arguments '" + serverArgs + "', working dir = " + tempPath + Environment.NewLine 186+ _redisServerProcess.StandardError.ReadToEnd() + Environment.NewLine
Microsoft.Extensions.Configuration.EnvironmentVariables (1)
EnvironmentVariablesConfigurationProvider.cs (1)
56Load(Environment.GetEnvironmentVariables());
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.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\libraries\Common\src\System\Net\Http\UriRedactionHelper.cs (1)
20string? envVar = Environment.GetEnvironmentVariable("DOTNET_SYSTEM_NET_HTTP_DISABLEURIREDACTION");
Microsoft.Extensions.Logging.AzureAppServices (4)
BatchingLoggerProvider.cs (1)
103_currentBatch.Add(new LogMessage(DateTimeOffset.Now, $"{messagesDropped} message(s) dropped because of queue size limit. Increase the queue size or decrease logging verbosity to avoid this.{Environment.NewLine}"));
WebAppContext.cs (3)
21public string HomeFolder { get; } = Environment.GetEnvironmentVariable("HOME"); 24public string SiteName { get; } = Environment.GetEnvironmentVariable("WEBSITE_SITE_NAME"); 27public string SiteInstanceId { get; } = Environment.GetEnvironmentVariable("WEBSITE_INSTANCE_ID");
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\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.SecretManager.Tools.Tests (8)
InitCommandTest.cs (2)
106var lineCountWithoutSecret = projectDocumentWithoutSecret.ToString().Split(Environment.NewLine).Length; 111var lineCountWithSecret = projectDocumentWithSecret.ToString().Split(Environment.NewLine).Length;
ListCommandTest.cs (6)
133$"Expected output to contain '{beginMarker}' marker, but it was not found.{Environment.NewLine}Actual output:{Environment.NewLine}{output}"); 137$"Expected output to contain '{endMarker}' marker, but it was not found.{Environment.NewLine}Actual output:{Environment.NewLine}{output}"); 141$"Expected '{beginMarker}' marker to appear before '{endMarker}' marker.{Environment.NewLine}Actual output:{Environment.NewLine}{output}");
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.Extensions.Validation.GeneratorTests (3)
ValidationsGeneratorTestBase.cs (3)
78throw new InvalidOperationException($"Failed to compile Program.cs: {string.Join(Environment.NewLine, programEmitResult.Diagnostics)}"); 86.UseDirectory(SkipOnHelixAttribute.OnHelix() && Environment.GetEnvironmentVariable("HELIX_WORKITEM_ROOT") is { } workItemRoot 249if (uint.TryParse(Environment.GetEnvironmentVariable(TimeoutEnvironmentKey), out uint timeoutInSeconds))
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.Sdk.Razor.SourceGenerators.UnitTests (2)
RazorSourceGeneratorTestsBase.cs (2)
143Assert.True(emitResult.Success, string.Join(Environment.NewLine, emitResult.Diagnostics)); 153var availableTypes = string.Join(Environment.NewLine, assembly.GetTypes()
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\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.Private.Windows.Polyfills.Tests (3)
System\OperatingSystemExtensionsTests.cs (3)
30Version current = Environment.OSVersion.Version; 41Version current = Environment.OSVersion.Version; 48Version current = Environment.OSVersion.Version;
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.VisualBasic.Tests (5)
Microsoft\VisualBasic\ApplicationServices\ApplicationBaseTests.cs (1)
66var vars = Environment.GetEnvironmentVariables();
Microsoft\VisualBasic\ApplicationServices\ConsoleApplicationBaseTests.cs (1)
12string[] expected = Environment.GetCommandLineArgs().Skip(1).ToArray();
Microsoft\VisualBasic\Devices\ComputerInfoTests.cs (2)
16Environment.OSVersion.Platform.ToString().Should().Be(info.OSPlatform); 17Environment.OSVersion.Version.ToString().Should().Be(info.OSVersion);
Microsoft\VisualBasic\Devices\ServerComputerTests.cs (1)
13Assert.Equal(Environment.MachineName, computer.Name);
Microsoft.VisualStudio.Extensibility.Testing.Xunit (10)
src\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\VisualStudio\IntegrationTest\Harness\XUnitShared\Harness\DataCollectionService.cs (2)
253if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("XUNIT_LOGS"))) 255return Path.GetFullPath(Path.Combine(Environment.GetEnvironmentVariable("XUNIT_LOGS"), "Screenshots"));
src\VisualStudio\IntegrationTest\Harness\XUnitShared\Harness\VisualStudioInstanceFactory.cs (3)
219var vsInstallDir = Environment.GetEnvironmentVariable("__UNITTESTEXPLORER_VSINSTALLPATH__") 220?? Environment.GetEnvironmentVariable("VSAPPIDDIR"); 227vsInstallDir = Environment.GetEnvironmentVariable("VSInstallDir");
src\VisualStudio\IntegrationTest\Harness\XUnitShared\InProcess\VisualStudio_InProc.cs (2)
120vsActivityLogBuilder.Insert(0, $"<{VisualStudioActivityLogRoot}>{Environment.NewLine}"); 121vsActivityLogBuilder.AppendLine($"{Environment.NewLine}</{VisualStudioActivityLogRoot}>");
Microsoft.VisualStudio.IntegrationTest.Setup (4)
TestTraceListener.cs (4)
71Debugger.Log(0, null, o?.ToString() + Environment.NewLine); 79Debugger.Log(0, category, o?.ToString() + Environment.NewLine); 87Debugger.Log(0, null, message + Environment.NewLine); 95Debugger.Log(0, category, message + Environment.NewLine);
Microsoft.VisualStudio.LanguageServices (32)
ErrorReporting\VisualStudioErrorReportingService.cs (1)
101string.Join(Environment.NewLine, message, detailedError));
ErrorReporting\VisualStudioErrorReportingService.ExceptionFormatting.cs (5)
40text = $"{text}{Environment.NewLine}---> (Inner Exception #{i}) {GetFormattedExceptionStack(aggregate.InnerExceptions[i])} <--- {Environment.NewLine}"; 66stackText += " ---> " + GetFormattedExceptionStack(innerException) + Environment.NewLine + 71return stackText + Environment.NewLine + GetAsyncStackTrace(exception); 89return string.Join(Environment.NewLine, stackFrameLines);
Log\VisualStudioErrorLogger.cs (1)
38=> exception.Message + Environment.NewLine + exception.StackTrace;
PdbSourceDocument\PdbSourceDocumentOutputWindowLogger.cs (2)
68noPumpPane.OutputStringNoPump(message + Environment.NewLine); 72pane.OutputStringThreadSafe(message + Environment.NewLine);
PreviewPane\PreviewPane.xaml.cs (2)
32private static readonly string s_dummyThreeLineTitle = "A" + Environment.NewLine + "A" + Environment.NewLine + "A";
ProjectSystem\FileChangeTracker.cs (1)
66if (!Environment.HasShutdownStarted)
ProjectSystem\InvisibleEditor.cs (1)
193=> Debug.Assert(Environment.HasShutdownStarted, GetType().Name + " was leaked without Dispose being called.");
ProjectSystem\Logging\RoslynWorkspaceStructureLogger.cs (2)
277return ReplacePathComponent(s, Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "%USERPROFILE%");
ProjectSystem\MetadataReferences\VisualStudioMetadataReferenceManager.cs (10)
139yield return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), @"Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5"); 140yield return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), @"Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0"); 148Environment.GetFolderPath(Environment.SpecialFolder.Windows), 149Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), 150Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86),
ProjectSystem\SdkAnalyzerAssemblyRedirector.cs (1)
36var enable = Environment.GetEnvironmentVariable("DOTNET_ANALYZER_REDIRECTING");
Snippets\SnippetExpansionClient.cs (4)
1114string.Format(ServicesVSResources.The_following_references_were_not_found_0_Please_locate_and_add_them_manually, Environment.NewLine) 1115+ Environment.NewLine + Environment.NewLine 1116+ string.Join(Environment.NewLine, failedReferenceAdditions),
Venus\ContainedLanguageCodeSupport.cs (2)
241if (!newMemberText.EndsWith(Environment.NewLine, StringComparison.Ordinal)) 243newMemberText += Environment.NewLine;
Microsoft.VisualStudio.LanguageServices.CSharp (3)
Interactive\CSharpVsInteractiveWindowProvider.cs (2)
76Environment.GetFolderPath(Environment.SpecialFolder.UserProfile));
SemanticSearch\SemanticSearchToolWindowImpl.cs (1)
412pane.OutputStringThreadSafe(message + Environment.NewLine);
Microsoft.VisualStudio.LanguageServices.Implementation (3)
SolutionExplorer\AnalyzersCommandHandler.cs (3)
398var totalMessage = string.Join(Environment.NewLine, notificationMessages); 638notificationService.SendNotification(message1 + Environment.NewLine + Environment.NewLine + message2, severity: NotificationSeverity.Error);
Microsoft.VisualStudio.LanguageServices.Razor (3)
Logging\OutputWindowLoggerProvider.cs (2)
124noPumpPane.OutputStringNoPump(value + Environment.NewLine); 128pane.OutputStringThreadSafe(value + Environment.NewLine);
Logging\RazorActivityLog.cs (1)
75$"Info:{Environment.NewLine}{message}");
Microsoft.VisualStudio.LanguageServices.Razor.UnitTests (9)
Cohost\CohostInlineCompletionEndpointTest.cs (1)
131var currentDirectory = Environment.CurrentDirectory;
Cohost\CohostWrapWithTagEndpointTest.cs (2)
123LspFactory.CreateTextEdit(position: (0, 0), $"<div>{Environment.NewLine} "), 126LspFactory.CreateTextEdit(position: (2, 6), $"{Environment.NewLine}</div>")
Cohost\Formatting\FormattingTestBase.cs (1)
99var delta = lastLine - firstLine + changes.Count(e => e.NewText.AssumeNotNull().Contains(Environment.NewLine));
LanguageConfigurationTest.cs (1)
135var currentDirectory = Environment.CurrentDirectory;
RazorLanguageService_IVsLanguageDebugInfoTest.cs (1)
206editorAdaptersFactory ??= new MockRepository(MockBehavior.Strict).OneOf<IVsEditorAdaptersFactoryService>(service => service.GetDataBuffer(It.IsAny<IVsTextBuffer>()) == new TestTextBuffer(new StringTextSnapshot(Environment.NewLine), /* contentType */ null));
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\CodeActions\CohostCodeActionsEndpointTestBase.cs (1)
115{string.Join(Environment.NewLine + " ", result.Select(e => ((RazorVSInternalCodeAction)e.Value!).Name))}
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\CodeActions\ExtractToCssTests.cs (1)
407""".Replace(Environment.NewLine, "\n");
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostSemanticTokensRangeEndpointTest.cs (1)
455.Replace("\r\n", Environment.NewLine);
Microsoft.VisualStudio.Razor.IntegrationTests (15)
AbstractIntegrationTest.cs (1)
51{string.Join(Environment.NewLine, fails)}
AbstractRazorEditorTest.cs (1)
159var localAppData = Environment.GetEnvironmentVariable("LocalAppData");
ManualRunOnlyIdeFactAttribute.cs (1)
14if (Environment.GetEnvironmentVariable("_IntegrationTestsRunningInCI") is not null)
MEFComponentTests.cs (1)
54Assert.True(errors.Length == 0, $"Unexpected MEF failures: {Environment.NewLine}{errors}");
ProjectTests.cs (1)
40await TestServices.Editor.InsertTextAsync(tfElement + Environment.NewLine, ControlledHangMitigatingCancellationToken);
RazorDebug.cs (2)
42if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 52Environment.FailFast(message);
Semantic\RazorSemanticTokensTests.cs (1)
128var strArray = semanticStr.Split(new[] { Separator.ToString(), Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
StressTests\RCLStressTests.cs (3)
30await TestServices.Editor.InsertTextAsync($"<h1>Iteration {index}</h1>{Environment.NewLine}", cancellationToken); 54await TestServices.Editor.InsertTextAsync($"<Component />{Environment.NewLine}", cancellationToken); 66await TestServices.Editor.InsertTextAsync($"<h1>Iteration {index}</h1>{Environment.NewLine}", cancellationToken);
VisualStudioLogging.cs (4)
155var localAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); 170Assert.True(hiveDirectories.Count == 1, $"Could not find the hive path for InstallationID '{installationId}'. Found instead:{Environment.NewLine}{string.Join(Environment.NewLine, hiveDirectories)}");
Microsoft.VisualStudioCode.Razor.IntegrationTests (5)
Services\VSCodeIntegrationTestBase.cs (2)
56TestServices.Logger.Log($"Environment: DISPLAY={Environment.GetEnvironmentVariable("DISPLAY") ?? "(not set)"}"); 57TestServices.Logger.Log($"OS: {Environment.OSVersion}");
Services\VSCodeService.Installer.cs (3)
111var display = Environment.GetEnvironmentVariable("DISPLAY"); 182var display = Environment.GetEnvironmentVariable("DISPLAY"); 272var display = Environment.GetEnvironmentVariable("DISPLAY");
Microsoft.VisualStudioCode.RazorExtension.UnitTests (3)
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\CodeActions\CohostCodeActionsEndpointTestBase.cs (1)
115{string.Join(Environment.NewLine + " ", result.Select(e => ((RazorVSInternalCodeAction)e.Value!).Name))}
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\CodeActions\ExtractToCssTests.cs (1)
407""".Replace(Environment.NewLine, "\n");
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Endpoints\CohostSemanticTokensRangeEndpointTest.cs (1)
455.Replace("\r\n", Environment.NewLine);
MinimalSampleOwin (4)
Program.cs (4)
13app.Logger.LogInformation($"Current process ID: {Environment.ProcessId}"); 21Operating System: {Environment.OSVersion} 22.NET version: {Environment.Version} 23Username: {Environment.UserName}
MSBuild (37)
CommandLine\CommandLineParser.cs (1)
387argsFromResponseFile.AddRange(QuotingUtilities.SplitUnquoted(Environment.ExpandEnvironmentVariables(responseFileLine)));
CommandLine\CommandLineSwitchException.cs (1)
75return base.Message + Environment.NewLine + ResourceUtilities.FormatResourceStringStripCodeAndKeyword("InvalidSwitchIndicator", commandLineArg);
DebugUtils.cs (3)
178builder.Append(Environment.NewLine); 181builder.Append(Environment.NewLine); 183builder.Append(Environment.NewLine);
InitializationException.cs (3)
80return base.Message + Environment.NewLine + ResourceUtilities.FormatResourceStringStripCodeAndKeyword("InvalidSwitchIndicator", invalidSwitch); 149errorMessage += Environment.NewLine + e.ToString(); 176errorMessage += Environment.NewLine + e.ToString();
LogMessagePacketBase.cs (2)
260private static readonly int s_defaultPacketVersion = (Environment.Version.Major * 10) + Environment.Version.Minor;
OutOfProcTaskHostNode.cs (1)
1238if (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 ");
XMake.cs (24)
291args = QuotingUtilities.SplitUnquoted(Environment.CommandLine).ToArray(); 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"); 1066if (Environment.GetEnvironmentVariable("MSBUILDDONOTLAUNCHDEBUGGER") != "1") 1183Environment.Exit(1); // the process will now be terminated rudely 1238Environment.Exit(0); // the process can now be terminated as everything has already been gracefully cancelled. 1502if (!string.Equals(Environment.GetEnvironmentVariable("MSBUILDLOGASYNC"), "1", StringComparison.Ordinal)) 1547string memoryUseLimit = Environment.GetEnvironmentVariable("MSBUILDMEMORYUSELIMIT"); 1794Environment.CurrentDirectory), 1922(Environment.OSVersion.Platform != PlatformID.Win32NT || 1923Environment.OSVersion.Version.Major < 6 || 1924(Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor < 1))) // Windows 7 is minimum 2098Environment.SetEnvironmentVariable("_MSBUILDTLENABLED", useTerminalLogger ? "1" : "0"); 2467string dotnetCliEnvVar = Environment.GetEnvironmentVariable("DOTNET_CLI_CONFIGURE_MSBUILD_TERMINAL_LOGGER"); 2502string liveLoggerArg = Environment.GetEnvironmentVariable("MSBUILDLIVELOGGER"); 2503terminalLoggerArg = Environment.GetEnvironmentVariable("MSBUILDTERMINALLOGGER"); 2616return automatedEnvironmentVariables.Any(envVar => !string.IsNullOrEmpty(Environment.GetEnvironmentVariable(envVar))); 2762if (Environment.GetEnvironmentVariable("MSBUILDDISABLENODEREUSE") == "1") // For example to disable node reuse in a gated checkin, without using the flag
MSBuildTaskHost (16)
BackEnd\LogMessagePacketBase.cs (2)
134private static readonly int s_defaultPacketVersion = (Environment.Version.Major * 10) + Environment.Version.Minor;
CommunicationsUtilities.cs (3)
211string handshakeSalt = Environment.GetEnvironmentVariable("MSBUILDNODEHANDSHAKESALT") ?? ""; 627string environmentValue = Environment.GetEnvironmentVariable(environmentVariable); 650s_debugDumpPath ??= Environment.GetEnvironmentVariable("MSBUILDDEBUGPATH");
Exceptions\InternalErrorException.cs (3)
92if (Environment.GetEnvironmentVariable("MSBUILDLAUNCHDEBUGGER") != null) 99if (Environment.GetEnvironmentVariable("MSBUILDDONOTLAUNCHDEBUGGER") == null 100&& Environment.GetEnvironmentVariable("_NTROOT") == null)
OutOfProcTaskHost.cs (1)
80switch (Environment.GetEnvironmentVariable("MSBUILDDEBUGONSTART"))
OutOfProcTaskHostNode.cs (1)
489if (Environment.GetEnvironmentVariable("MSBUILDTASKHOSTABORTTASKONCANCEL") == "1")
Traits.cs (4)
19DebugEngine = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBuildDebugEngine")); 20DebugNodeCommunication = DebugEngine || !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDDEBUGCOMM")); 34public readonly bool ReuseTaskHostNodes = Environment.GetEnvironmentVariable("MSBUILDREUSETASKHOSTNODES") == "1"; 39public readonly bool DisableLongPaths = Environment.GetEnvironmentVariable("MSBUILDDISABLELONGPATHS") == "1";
Utilities\ExceptionHandling.cs (1)
30string debugPath = Environment.GetEnvironmentVariable("MSBUILDDEBUGPATH");
Utilities\NativeMethods.cs (1)
78int numberOfCpus = Environment.ProcessorCount;
mscorlib (1)
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";
NativeIISSample (47)
Startup.cs (47)
37await context.Response.WriteAsync("Hello World - " + DateTimeOffset.Now + Environment.NewLine); 38await context.Response.WriteAsync(Environment.NewLine); 40await context.Response.WriteAsync("Address:" + Environment.NewLine); 41await context.Response.WriteAsync("Scheme: " + context.Request.Scheme + Environment.NewLine); 42await context.Response.WriteAsync("Host: " + context.Request.Headers["Host"] + Environment.NewLine); 43await context.Response.WriteAsync("PathBase: " + context.Request.PathBase.Value + Environment.NewLine); 44await context.Response.WriteAsync("Path: " + context.Request.Path.Value + Environment.NewLine); 45await context.Response.WriteAsync("Query: " + context.Request.QueryString.Value + Environment.NewLine); 46await context.Response.WriteAsync(Environment.NewLine); 48await context.Response.WriteAsync("Connection:" + Environment.NewLine); 49await context.Response.WriteAsync("RemoteIp: " + context.Connection.RemoteIpAddress + Environment.NewLine); 50await context.Response.WriteAsync("RemotePort: " + context.Connection.RemotePort + Environment.NewLine); 51await context.Response.WriteAsync("LocalIp: " + context.Connection.LocalIpAddress + Environment.NewLine); 52await context.Response.WriteAsync("LocalPort: " + context.Connection.LocalPort + Environment.NewLine); 53await context.Response.WriteAsync("ClientCert: " + context.Connection.ClientCertificate + Environment.NewLine); 54await context.Response.WriteAsync(Environment.NewLine); 59await context.Response.WriteAsync(Environment.NewLine); 60await context.Response.WriteAsync("TLS Information:" + Environment.NewLine); 61await context.Response.WriteAsync($"Protocol: {handshakeFeature.Protocol}" + Environment.NewLine); 65await context.Response.WriteAsync($"Cipher Suite: {handshakeFeature.NegotiatedCipherSuite.Value}" + Environment.NewLine); 69await context.Response.WriteAsync("User: " + context.User.Identity.Name + Environment.NewLine); 73await context.Response.WriteAsync("DisplayName: " + scheme?.DisplayName + Environment.NewLine); 76await context.Response.WriteAsync(Environment.NewLine); 78await context.Response.WriteAsync("Headers:" + Environment.NewLine); 81await context.Response.WriteAsync(header.Key + ": " + header.Value + Environment.NewLine); 83await context.Response.WriteAsync(Environment.NewLine); 85await context.Response.WriteAsync("Environment Variables:" + Environment.NewLine); 86var vars = Environment.GetEnvironmentVariables(); 90await context.Response.WriteAsync(key + ": " + value + Environment.NewLine); 92await context.Response.WriteAsync(Environment.NewLine); 95await context.Response.WriteAsync("Server Variables:" + Environment.NewLine); 99await context.Response.WriteAsync(varName + ": " + context.GetServerVariable(varName) + Environment.NewLine); 102await context.Response.WriteAsync(Environment.NewLine); 112await context.Response.WriteAsync(Environment.NewLine); 118await context.Response.WriteAsync(key + Environment.NewLine); 123await context.Response.WriteAsync(Environment.NewLine); 124await context.Response.WriteAsync("IIS Environment Information:" + Environment.NewLine); 125await context.Response.WriteAsync("IIS Version: " + envFeature.IISVersion + Environment.NewLine); 126await context.Response.WriteAsync("ApplicationId: " + envFeature.ApplicationId + Environment.NewLine); 127await context.Response.WriteAsync("Application Path: " + envFeature.ApplicationPhysicalPath + Environment.NewLine); 128await context.Response.WriteAsync("Application Virtual Path: " + envFeature.ApplicationVirtualPath + Environment.NewLine); 129await context.Response.WriteAsync("Application Config Path: " + envFeature.AppConfigPath + Environment.NewLine); 130await context.Response.WriteAsync("AppPool ID: " + envFeature.AppPoolId + Environment.NewLine); 131await context.Response.WriteAsync("AppPool Config File: " + envFeature.AppPoolConfigFile + Environment.NewLine); 132await context.Response.WriteAsync("Site ID: " + envFeature.SiteId + Environment.NewLine); 133await context.Response.WriteAsync("Site Name: " + envFeature.SiteName + Environment.NewLine); 137await context.Response.WriteAsync($"No {nameof(IIISEnvironmentFeature)} available." + Environment.NewLine);
netstandard (1)
netstandard.cs (1)
781[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Environment))]
PhotinoTestApp (2)
Program.cs (2)
29"Fatal exception" + Environment.NewLine + 30error.ExceptionObject.ToString() + 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)
PresentationCore.Tests (2)
System\Windows\Media\ColorConverter.Tests.cs (1)
137string? homeDrive = Environment.GetEnvironmentVariable("HOMEDRIVE");
System\Windows\Media\Generated\BrushConverter.Tests.cs (1)
123string? homeDrive = Environment.GetEnvironmentVariable("HOMEDRIVE");
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);
ProjectCachePlugin (1)
AssemblyMockCache.cs (1)
70var errorKind = Environment.GetEnvironmentVariable(errorLocation);
Razor.Diagnostics.Analyzers.UnitTests (2)
Verifiers\CSharpVerifierHelper.cs (2)
25var commandLineArguments = CSharpCommandLineParser.Default.Parse(args, baseDirectory: Environment.CurrentDirectory, sdkDirectory: Environment.CurrentDirectory);
RazorBuildWebSite (2)
UpdateableFileProvider.cs (2)
27new TestFileInfo("@page" + Environment.NewLine + "Original content") 112var file = new TestFileInfo("@page" + Environment.NewLine + "Original content")
Replay (16)
Replay.cs (1)
103foreach (DictionaryEntry entry in Environment.GetEnvironmentVariables())
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\Compilers\Shared\BuildServerConnection.cs (4)
212var originalThreadId = Environment.CurrentManagedThreadId; 273var releaseThreadId = Environment.CurrentManagedThreadId; 554var environmentVariables = GetServerEnvironmentVariables(Environment.GetEnvironmentVariables(), logger); 674var userName = Environment.UserName;
src\Compilers\Shared\CompilerServerLogger.cs (3)
120loggingFilePath = Environment.GetEnvironmentVariable(EnvironmentVariableName); 153var threadId = Environment.CurrentManagedThreadId; 155string output = prefix + message + Environment.NewLine;
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\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
RepoTasks (19)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
1042return string.Join(Environment.NewLine, description);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
25private static readonly string MacOSUserKeychain = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + "/Library/Keychains/login.keychain-db"; 33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https");
src\Shared\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);
Roslyn.Compilers.Extension (2)
CompilerPackage.cs (2)
175var localAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
Roslyn.Diagnostics.Analyzers (28)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (2)
99var parentPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
58if (Environment.OSVersion.Platform == PlatformID.Win32NT)
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\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
112: this(factory, Environment.ProcessorCount * 2, trimOnFree)
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\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (1)
173foreach (var line in child.ToString().Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingOptions2.cs (1)
47_ => Environment.NewLine
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\LineFormattingOptions.cs (1)
19[DataMember] public string NewLine { get; init; } = Environment.NewLine;
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
285: reason + Environment.NewLine + restString;
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxTriviaExtensions.cs (1)
91var newLine = Environment.NewLine;
Roslyn.Test.PdbUtilities (6)
EditAndContinue\EditAndContinueTest.GenerationVerifier.cs (3)
91itemSeparator: "," + Environment.NewLine, 108itemSeparator: "," + Environment.NewLine, 125itemSeparator: "," + Environment.NewLine,
Reader\PdbValidation.cs (3)
144$"PDB format: {format}{Environment.NewLine}", 312$"PDB format: {(isPortable ? "Portable" : "Windows")}{Environment.NewLine}", 353$"PDB format: {(originalIsPortable ? "Windows" : "Portable")} converted from {(originalIsPortable ? "Portable" : "Windows")}{Environment.NewLine}",
Roslyn.Test.Performance.Utilities (5)
Benchview.cs (1)
43var sasToken = Environment.GetEnvironmentVariable(s_sasEnvironmentVar);
RelativeDirectory.cs (1)
61var tempDirectory = Environment.ExpandEnvironmentVariables(@"%SYSTEMDRIVE%\PerfTemp");
TestUtilities.cs (1)
46return Environment.ExpandEnvironmentVariables(@"%SYSTEMDRIVE%\CPC");
VsPerfTest.cs (2)
24private static readonly string _nugetPackagesPath = System.Environment.GetEnvironmentVariable("NUGET_PACKAGES") ?? 25Path.Combine(System.Environment.GetEnvironmentVariable("UserProfile"), ".nuget", "packages");
Roslyn.VisualStudio.DiagnosticsWindow (5)
Loggers\OutputWindowLogger.cs (4)
35OutputPane.WriteLine(string.Format("[{0}] {1} - {2}", Environment.CurrentManagedThreadId, functionId.ToString(), logMessage.GetMessage())); 40OutputPane.WriteLine(string.Format("[{0}] Start({1}) : {2} - {3}", Environment.CurrentManagedThreadId, uniquePairId, functionId.ToString(), logMessage.GetMessage())); 46OutputPane.WriteLine(string.Format("[{0}] End({1}) : [{2}ms] {3}", Environment.CurrentManagedThreadId, uniquePairId, delta, functionString)); 81pane.OutputStringThreadSafe(value + Environment.NewLine);
Panels\WorkspacePanel.xaml.cs (1)
112: $"{Environment.NewLine}{outOfDateCount} documents out of date.");
Roslyn.VisualStudio.Next.UnitTests (1)
Services\VisualStudioDiagnosticAnalyzerExecutorTests.cs (1)
118var random = new Random(Environment.TickCount);
RoutingSandbox (1)
Program.cs (1)
61.UseContentRoot(Environment.CurrentDirectory)
RoutingWebSite (1)
Program.cs (1)
63.UseContentRoot(Environment.CurrentDirectory)
RulesetToEditorconfigConverter (1)
Program.cs (1)
18Path.Combine(Environment.CurrentDirectory, ".editorconfig");
RunTests (16)
ConsoleUtil.cs (1)
18Logger.Log(message + Environment.NewLine);
HelixTestRunner.cs (4)
267if (Environment.GetEnvironmentVariable(knownEnvironmentVariable) is string { Length: > 0 } value) 367if (Environment.GetEnvironmentVariable(name) is { } value) 378if (Environment.GetEnvironmentVariable(name) is { } value) 384Environment.SetEnvironmentVariable(name, defaultValue);
ProcessTestExecutor.cs (2)
180var standardOutput = string.Join(Environment.NewLine, xunitProcessResult.OutputLines) ?? ""; 181var errorOutput = string.Join(Environment.NewLine, xunitProcessResult.ErrorLines) ?? "";
Program.cs (7)
39ConsoleUtil.WriteLine(string.Join(Environment.NewLine, dotnetResult.OutputLines)); 40ConsoleUtil.WriteLine(ConsoleColor.Red, string.Join(Environment.NewLine, dotnetResult.ErrorLines)); 243ConsoleUtil.WriteLine(string.Join(Environment.NewLine, processOutput.OutputLines)); 259ConsoleUtil.WriteLine(string.Join(Environment.NewLine, output.OutputLines)); 260ConsoleUtil.WriteLine(string.Join(Environment.NewLine, output.ErrorLines)); 323var message = $"Multiple unit test assemblies found in '{targetFrameworkDirectory}'. Please adjust the build to prevent this. Matches:{Environment.NewLine}{string.Join(Environment.NewLine, matches)}";
TestHistoryManager.cs (1)
130var envVar = Environment.GetEnvironmentVariable(envVarName);
TestRunner.cs (1)
77var max = _options.Sequential ? 1 : (int)(Environment.ProcessorCount * 1.5);
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);
SemanticSearch.BuildTask (7)
GenerateFilteredReferenceAssembliesTask.cs (3)
100Log.LogError($"GenerateFilteredReferenceAssembliesTask failed with exception:{Environment.NewLine}{e}"); 174var newContent = $"# Generated, do not update manually{Environment.NewLine}" + 175string.Join(Environment.NewLine, apis);
src\Compilers\Shared\ThrowingTraceListener.cs (1)
16(string.IsNullOrEmpty(detailMessage) ? "" : Environment.NewLine + detailMessage));
src\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
ServerComparison.TestSites (1)
Program.cs (1)
42Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"),
Shared.Tests (1)
JsonSchemaExporter\SchemaTestHelpers.cs (1)
47{string.Join(Environment.NewLine, errors)}
SocialSample (1)
Startup.cs (1)
220context.Failure.Message.Split(Environment.NewLine).Select(s => HtmlEncoder.Default.Encode(s) + "<br>").Aggregate((s1, s2) => s1 + s2));
Sockets.BindTests (7)
src\Servers\Kestrel\shared\test\StreamBackedTestConnection.cs (7)
119throw new TimeoutException($"Did not receive a complete response within {Timeout}.{Environment.NewLine}{Environment.NewLine}" + 120$"Expected:{Environment.NewLine}{expected}{Environment.NewLine}{Environment.NewLine}" + 121$"Actual:{Environment.NewLine}{new string(actual, 0, offset)}{Environment.NewLine}",
Sockets.FunctionalTests (7)
src\Servers\Kestrel\shared\test\StreamBackedTestConnection.cs (7)
119throw new TimeoutException($"Did not receive a complete response within {Timeout}.{Environment.NewLine}{Environment.NewLine}" + 120$"Expected:{Environment.NewLine}{expected}{Environment.NewLine}{Environment.NewLine}" + 121$"Actual:{Environment.NewLine}{new string(actual, 0, offset)}{Environment.NewLine}",
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");
Swaggatherer (4)
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
48if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
Template.cs (3)
132string.Join(Environment.NewLine, setupEndpointsLines), 133string.Join(Environment.NewLine, setupRequestsLines), 134string.Join(Environment.NewLine, setupMatcherLines),
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.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\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\libraries\Common\src\System\Text\EncodingHelper.Unix.cs (1)
39locale = Environment.GetEnvironmentVariable(envVar);
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\libraries\Common\src\System\LocalAppContextSwitches.Common.cs (1)
60if (Environment.GetEnvironmentVariable(envVariable) is string str)
System.Data.Odbc (4)
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.Diagnostics.DiagnosticSource (7)
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.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.Protocols (1)
src\libraries\Common\src\System\LocalAppContextSwitches.Common.cs (1)
60if (Environment.GetEnvironmentVariable(envVariable) is string str)
System.Drawing.Common.Tests (4)
mono\System.Drawing\BitmapTests.cs (1)
295sSub = Environment.GetEnvironmentVariable("MSNet") is null ? "mono/" : "MSNet/";
System\Drawing\IconTests.cs (1)
359string bitmapUncPath = $"\\\\{Environment.MachineName}\\{bitmapPath[..bitmapPathRoot.IndexOf(':')]}$\\{bitmapPath.Replace(bitmapPathRoot, "")}";
System\Drawing\ImageAnimator.ManualTests.cs (1)
10public static string OutputFolder { get; } = Path.Join(Environment.CurrentDirectory, "ImageAnimatorManualTests", DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss"));
System\Drawing\PenTests.cs (1)
39if (Environment.OSVersion.Platform != PlatformID.Win32NT || CultureInfo.InstalledUICulture.TwoLetterISOLanguageName == "en")
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.Net.Http (36)
src\libraries\Common\src\System\LocalAppContextSwitches.Common.cs (1)
60if (Environment.GetEnvironmentVariable(envVariable) is string str)
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)
890return connection.GetLifetimeTicks(Environment.TickCount64) > pooledConnectionLifetime.TotalMilliseconds; 901return lifetime == TimeSpan.Zero || connection.GetLifetimeTicks(Environment.TickCount64) > lifetime.TotalMilliseconds; 979long 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; 2129_nextPingRequestTimestamp = Environment.TickCount64 + _keepAlivePingDelay; 2163long 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; 103if (GlobalHttpSettings.MetricsHandler.IsGloballyEnabled) _connectionMetrics?.ConnectionClosed(durationMs: Environment.TickCount64 - _creationTickCount); 119_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.HttpListener (1)
src\libraries\Common\src\System\LocalAppContextSwitches.Common.cs (1)
60if (Environment.GetEnvironmentVariable(envVariable) is string str)
System.Net.NameResolution (1)
src\libraries\Common\src\System\LocalAppContextSwitches.Common.cs (1)
60if (Environment.GetEnvironmentVariable(envVariable) is string str)
System.Net.NetworkInformation (21)
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\libraries\Common\src\System\LocalAppContextSwitches.Common.cs (1)
60if (Environment.GetEnvironmentVariable(envVariable) is string str)
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\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeX509Handles.Unix.cs (1)
14Environment.GetEnvironmentVariable("DEBUG_SAFEX509HANDLE_FINALIZATION") != null;
src\libraries\Common\src\System\LocalAppContextSwitches.Common.cs (1)
60if (Environment.GetEnvironmentVariable(envVariable) is string str)
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 (5)
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (1)
124string? value = AppContext.GetData(TlsCacheSizeCtxName) as string ?? Environment.GetEnvironmentVariable(TlsCacheSizeEnvironmentVariable);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeX509Handles.Unix.cs (1)
14Environment.GetEnvironmentVariable("DEBUG_SAFEX509HANDLE_FINALIZATION") != null;
src\libraries\Common\src\System\LocalAppContextSwitches.Common.cs (1)
60if (Environment.GetEnvironmentVariable(envVariable) is string str)
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\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 (212)
src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\ExceptionHandling.cs (1)
94Environment.FailFast(reason.ToString());
src\libraries\Common\src\System\LocalAppContextSwitches.Common.cs (1)
60if (Environment.GetEnvironmentVariable(envVariable) is string str)
src\libraries\System.Private.CoreLib\src\Internal\Console.cs (3)
18Write(s + Environment.NewLineConst); 22Write(Environment.NewLineConst); 28Write(Environment.NewLineConst);
src\libraries\System.Private.CoreLib\src\System\AggregateException.cs (1)
376text.Append(Environment.NewLineConst + InnerExceptionPrefix);
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\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\libraries\System.Private.CoreLib\src\System\ArgumentOutOfRangeException.cs (1)
81return s + Environment.NewLineConst + valueMessage;
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.ReplaceLineEndings()); 110s += Environment.NewLineConst + StackTrace; 115s += Environment.NewLineConst + Environment.NewLineConst + _fusionLog;
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\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentDictionary.cs (1)
2054private static int DefaultConcurrencyLevel => Environment.ProcessorCount;
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\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\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\ActivityTracker.cs (1)
492sumPtr[3] = (sumPtr[0] + sumPtr[1] + sumPtr[2] + 0x599D99AD) ^ (uint)Environment.ProcessId;
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\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\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\RuntimeEventSourceHelper.Unix.cs (1)
11Interop.Sys.GetCpuUtilization(ref s_cpuInfo) / Environment.ProcessorCount;
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\libraries\System.Private.CoreLib\src\System\Globalization\CultureNotFoundException.cs (1)
103return s + Environment.NewLineConst + valueMessage;
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\libraries\System.Private.CoreLib\src\System\Globalization\GlobalizationMode.Unix.cs (1)
31Environment.FailFast(GetIcuLoadFailureMessage());
src\libraries\System.Private.CoreLib\src\System\IO\Directory.cs (2)
260public static string GetCurrentDirectory() => Environment.CurrentDirectory; 266Environment.CurrentDirectory = Path.GetFullPath(path);
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\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.ReplaceLineEndings()); 62s += Environment.NewLineConst + InnerExceptionPrefix + InnerException.ToString(); 65s += Environment.NewLineConst + StackTrace; 70s += Environment.NewLineConst + Environment.NewLineConst + FusionLog;
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.ReplaceLineEndings()); 85s += Environment.NewLineConst + InnerExceptionPrefix + InnerException.ToString(); 88s += Environment.NewLineConst + StackTrace; 93s += Environment.NewLineConst + Environment.NewLineConst + FusionLog;
src\libraries\System.Private.CoreLib\src\System\IO\Iterator.cs (2)
21_threadId = Environment.CurrentManagedThreadId; 42if (state == 0 && _threadId == Environment.CurrentManagedThreadId)
src\libraries\System.Private.CoreLib\src\System\IO\Path.Unix.cs (1)
88string? path = Environment.GetEnvironmentVariable(TempEnvVar);
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (1)
54string? userHomeDirectory = Environment.GetEnvironmentVariable("HOME");
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\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\libraries\System.Private.CoreLib\src\System\ObjectDisposedException.cs (1)
100return base.Message + Environment.NewLineConst + objectDisposed;
src\libraries\System.Private.CoreLib\src\System\OperatingSystem.cs (1)
354Version current = Environment.OSVersion.Version;
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\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\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncProfiler.cs (1)
75string? eventBufferSizeEnv = System.Environment.GetEnvironmentVariable("DOTNET_AsyncProfilerEventSource_EventBufferSize");
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\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\SwitchExpressionException.cs (1)
63return base.Message + Environment.NewLine + valueMessage;
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\COMException.cs (1)
65s.Append(Environment.NewLineConst + InnerExceptionPrefix).Append(innerException.ToString());
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ExternalException.cs (2)
64s += Environment.NewLineConst + InnerExceptionPrefix + innerException.ToString(); 68s += Environment.NewLineConst + StackTrace;
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NativeLibrary.Unix.cs (2)
51_errorMessage ??= Environment.NewLine; 54_errorMessage += message + Environment.NewLine;
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\SafeHandle.cs (5)
19private static readonly bool s_logFinalization = Environment.GetEnvironmentVariable("DEBUG_SAFEHANDLE_FINALIZATION") == "1"; 71_ctorStackTrace = Environment.StackTrace; 111Internal.Console.WriteLine($"{Environment.NewLine}*** #{count} {GetType()} (0x{handle.ToInt64():x}) finalized! Ctor stack:{Environment.NewLine}{_ctorStackTrace}{Environment.NewLine}");
src\libraries\System.Private.CoreLib\src\System\Runtime\MemoryFailPoint.cs (2)
194long now = Environment.TickCount; // Handle wraparound. 370_stackTrace = Environment.StackTrace;
src\libraries\System.Private.CoreLib\src\System\Runtime\Versioning\VersioningHelper.cs (1)
53safeName.Append(Environment.ProcessId);
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\libraries\System.Private.CoreLib\src\System\SR.cs (1)
71Environment.FailFast(message);
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\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (2)
910public StringBuilder AppendLine() => Append(Environment.NewLine); 915return Append(Environment.NewLine);
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\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\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs (1)
452Environment.FailFast(
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\libraries\System.Private.CoreLib\src\System\Threading\LowLevelLifoSemaphore.cs (3)
68uint spinCount = Environment.IsSingleProcessor ? 0 : _spinCount; 123int startWaitTicks = timeoutMs != -1 ? Environment.TickCount : 0; 131int endWaitTicks = timeoutMs != -1 ? Environment.TickCount : 0;
src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelSpinWaiter.cs (1)
23int processorCount = Environment.ProcessorCount;
src\libraries\System.Private.CoreLib\src\System\Threading\ManualResetEventSlim.cs (2)
199SpinCount = Environment.IsSingleProcessor ? DEFAULT_SPIN_SP : spinCount; 516startTime = Environment.TickCount64;
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\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.Blocking.cs (1)
320int processorCount = Environment.ProcessorCount;
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.cs (2)
137_minThreads = HasForcedMinThreads ? ForcedMinWorkerThreads : (short)Environment.ProcessorCount; 402int currentTicks = Environment.TickCount;
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\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.HillClimbing.cs (1)
410entry.tickCount = Environment.TickCount;
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.Unix.cs (1)
18Interop.Sys.GetCpuUtilization(ref _cpuInfo) / Environment.ProcessorCount;
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WaitThread.cs (2)
207int currentTimeMs = Environment.TickCount; 272currentTimeMs = Environment.TickCount;
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WorkerThread.cs (1)
144threadPoolInstance.NotifyDispatchProgress(Environment.TickCount);
src\libraries\System.Private.CoreLib\src\System\Threading\ProcessorIdCache.cs (1)
38currentProcessorId = Environment.CurrentManagedThreadId;
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\libraries\System.Private.CoreLib\src\System\Threading\RegisteredWaitHandle.Portable.cs (1)
90TimeoutTimeMs = Environment.TickCount + TimeoutDurationMs;
src\libraries\System.Private.CoreLib\src\System\Threading\SemaphoreSlim.cs (1)
328startTime = Environment.TickCount64;
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\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\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (1)
64private static int DefaultMaxConcurrencyLevel => Environment.ProcessorCount;
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (2)
3219uint startTimeTicks = infiniteWait ? 0 : (uint)Environment.TickCount; 3263uint elapsedTimeTicks = ((uint)Environment.TickCount) - startTimeTicks;
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TplEventSource.cs (1)
572int pid = Environment.ProcessId;
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (4)
420Environment.ProcessorCount <= 32 ? 0 : 421(Environment.ProcessorCount + (ProcessorsPerAssignableWorkItemQueue - 1)) / ProcessorsPerAssignableWorkItemQueue; 893int startTickCount = Environment.TickCount; 968int currentTickCount = Environment.TickCount;
src\libraries\System.Private.CoreLib\src\System\Threading\TimeoutHelper.cs (1)
24ulong elapsedMilliseconds = (ulong)(Environment.TickCount64 - startTime);
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\libraries\System.Private.CoreLib\src\System\Threading\TimerQueue.Portable.cs (2)
53long dueTimeMs = Environment.TickCount64 + (int)actualDuration; 95long currentTimeMs = Environment.TickCount64;
src\libraries\System.Private.CoreLib\src\System\Threading\WaitSubsystem.ThreadWaitInfo.Unix.cs (2)
341int startTimeMilliseconds = Environment.TickCount; 357elapsedMilliseconds = Environment.TickCount - startTimeMilliseconds;
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.NonAndroid.cs (2)
226string? result = Environment.GetEnvironmentVariable(TimeZoneEnvironmentVariable); 507string? tzDirectory = Environment.GetEnvironmentVariable(TimeZoneDirectoryEnvironmentVariable);
src\System\Exception.CoreCLR.cs (1)
110_remoteStackTraceString = tmpStackTraceString + Environment.NewLineConst;
src\System\RuntimeType.ActivatorCache.cs (2)
158+ Environment.NewLineConst + "Expected: " + (_originalRuntimeType ?? (object)"<null>") 159+ Environment.NewLineConst + "Actual: " + (rt ?? (object)"<null>"));
src\System\RuntimeType.BoxCache.cs (2)
65+ Environment.NewLineConst + "Expected: " + (_originalRuntimeType ?? (object)"<null>") 66+ Environment.NewLineConst + "Actual: " + (rt ?? (object)"<null>"));
src\System\RuntimeType.CreateUninitializedCache.CoreCLR.cs (2)
47+ Environment.NewLineConst + "Expected: " + (_originalRuntimeType ?? (object)"<null>") 48+ Environment.NewLineConst + "Actual: " + (rt ?? (object)"<null>"));
System.Private.DataContractSerialization (1)
System\Runtime\Serialization\DataContractSet.cs (1)
594errorMessage.AppendFormat("{0}\"{1}\" ", Environment.NewLine, conflictingType.AssemblyQualifiedName);
System.Private.Windows.Core (17)
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);
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);
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);
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\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)
artifacts\obj\System.Runtime\Debug\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.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 (4)
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeX509Handles.Unix.cs (1)
14Environment.GetEnvironmentVariable("DEBUG_SAFEX509HANDLE_FINALIZATION") != null;
src\libraries\Common\src\System\IO\MemoryMappedFiles\MemoryMappedFileMemoryManager.cs (1)
32Environment.FailFast("MemoryMappedFileMemoryManager was finalized.");
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (1)
54string? userHomeDirectory = Environment.GetEnvironmentVariable("HOME");
System\Security\Cryptography\X509Certificates\X500NameEncoder.cs (1)
53dnSeparator = Environment.NewLine;
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.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.Text.Json (6)
System\Text\Json\Serialization\JsonSerializerOptions.cs (2)
773/// The default is the value of <see cref="Environment.NewLine"/>. 788return _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.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.Analyzers.CSharp.Tests (2)
Verifiers\CSharpVerifierHelper.cs (2)
24var commandLineArguments = CSharpCommandLineParser.Default.Parse(args, baseDirectory: Environment.CurrentDirectory, sdkDirectory: Environment.CurrentDirectory);
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.Design.Tests (5)
System\Windows\Forms\Design\EmbeddedResourceTests.cs (5)
85new(ExpectedIconNamesString.Split(Environment.NewLine).Where(item => !item.EndsWith(".bmp", StringComparison.Ordinal))); 88new(ExpectedBitmapNamesString.Split(Environment.NewLine)); 138string[] expected = $"{ExpectedIconNamesString}{Environment.NewLine}{ExpectedBitmapNamesString}{Environment.NewLine}{ExpectedResourceNames}".Split(Environment.NewLine);
System.Windows.Forms.Primitives (14)
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.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);
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);
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);
Windows\Win32\UI\Shell\FolderBrowserHelper.cs (1)
27PInvoke.SHGetSpecialFolderLocation((int)Environment.SpecialFolder.Desktop, out rootFolderId);
System.Windows.Forms.Primitives.Tests (29)
Interop\ComCtl32\MCGRIDINFOTests.cs (8)
14if (Environment.Is64BitProcess) 25if (Environment.Is64BitProcess) 36if (Environment.Is64BitProcess) 61if (Environment.Is64BitProcess) 83if (!Environment.Is64BitProcess) 94if (!Environment.Is64BitProcess) 105if (!Environment.Is64BitProcess) 131if (!Environment.Is64BitProcess)
Interop\ComCtl32\TASKDIALOG_BUTTONTests.cs (4)
13if (Environment.Is64BitProcess) 24if (Environment.Is64BitProcess) 39if (!Environment.Is64BitProcess) 50if (!Environment.Is64BitProcess)
Interop\ComCtl32\TASKDIALOGCONFIGIconUnionTests.cs (4)
13if (Environment.Is64BitProcess) 24if (Environment.Is64BitProcess) 39if (!Environment.Is64BitProcess) 50if (!Environment.Is64BitProcess)
Interop\ComCtl32\TASKDIALOGCONFIGTests.cs (4)
13if (Environment.Is64BitProcess) 24if (Environment.Is64BitProcess) 64if (!Environment.Is64BitProcess) 75if (!Environment.Is64BitProcess)
Interop\Comdlg32\PRINTDLGWTests.cs (4)
13if (Environment.Is64BitProcess) 24if (Environment.Is64BitProcess) 56if (!Environment.Is64BitProcess) 67if (!Environment.Is64BitProcess)
Interop\Oleaut32\SAFEARRAYTests.cs (2)
20if (Environment.Is64BitProcess) 32if (!Environment.Is64BitProcess)
Interop\Oleaut32\VARIANTTests.cs (2)
37if (Environment.Is64BitProcess) 49if (!Environment.Is64BitProcess)
Interop\PARAMTests.cs (1)
32if (Environment.Is64BitProcess)
System.Windows.Forms.Primitives.TestUtilities (11)
Extensions\AssertExtensions.cs (7)
413throw new XunitException($"Expected: {string.Join(", ", expected)}{Environment.NewLine}Actual: {string.Join(", ", actual)}"); 449throw new XunitException($"Expected count: {expectedCount}{Environment.NewLine}Actual count: {actualCount}"); 462throw new XunitException($"Collections are not equal.{Environment.NewLine}Totally {countInfo.Original} {currentExpectedItem} in actual collection but expect more {currentExpectedItem}"); 483throw new XunitException($"Expected: Span of length {expected.Length}{Environment.NewLine}Actual: Span of length {actual.Length}"); 490string message = $"Showing first {MaxDiffsToShow} differences{Environment.NewLine}"; 500message += $" Position {i}: Expected: {expected[i]}, Actual: {actual[i]}{Environment.NewLine}"; 533throw new XunitException($"Expected: {expected1} || {expected2}{Environment.NewLine}Actual: {value}");
PlatformDetection.Windows.cs (4)
55File.Exists(Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "System32", "httpapi.dll")); 192Assert.True(GetProductInfo(Environment.OSVersion.Version.Major, Environment.OSVersion.Version.Minor, 0, 0, out int productType));
System.Windows.Forms.Tests (104)
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObjectTests.cs (1)
865Assert.Equal(Environment.ProcessId, actual);
System\Windows\Forms\AccessibleObjects\ListViewLabelEditAccessibleObjectTests.cs (1)
29Assert.Equal(Environment.ProcessId, (int)accessibilityObject.GetPropertyValue(UIA_PROPERTY_ID.UIA_ProcessIdPropertyId));
System\Windows\Forms\AccessibleObjects\TreeViewLabelEditAccessibleObjectTests.cs (1)
28Assert.Equal(Environment.ProcessId, (int)accessibilityObject.GetPropertyValue(UIA_PROPERTY_ID.UIA_ProcessIdPropertyId));
System\Windows\Forms\ControlTests_InvokeAsync.cs (20)
23int? originalThread = Environment.CurrentManagedThreadId; 31newTaskThread = Environment.CurrentManagedThreadId; 44Assert.Equal(originalThread.Value, Environment.CurrentManagedThreadId); 49invokeThread = Environment.CurrentManagedThreadId; 64int? originalThread = Environment.CurrentManagedThreadId; 73newTaskThread = Environment.CurrentManagedThreadId; 89invokeThread = Environment.CurrentManagedThreadId; 101int? originalThread = Environment.CurrentManagedThreadId; 110newTaskThread = Environment.CurrentManagedThreadId; 125invokeThreadBeforeAwaitInInvokeDelegate = Environment.CurrentManagedThreadId; 129invokeThreadAfterAwaitInInvokeDelegate = Environment.CurrentManagedThreadId; 134invokeThreadAfterAwaitInInvokeDelegate = Environment.CurrentManagedThreadId; 145int? originalThread = Environment.CurrentManagedThreadId; 153newTaskThread = Environment.CurrentManagedThreadId; 168invokeThreadInInvokeDelegate = Environment.CurrentManagedThreadId; 187int? originalThread = Environment.CurrentManagedThreadId; 197newTaskThread = Environment.CurrentManagedThreadId; 213invokeThreadBeforeAwaitInInvokeDelegate = Environment.CurrentManagedThreadId; 217invokeThreadAfterAwaitInInvokeDelegate = Environment.CurrentManagedThreadId; 222invokeThreadAfterAwaitInInvokeDelegate = Environment.CurrentManagedThreadId;
System\Windows\Forms\EmbeddedResourceTests.cs (5)
200public static TheoryData<string> ExpectedIconNames() => new(ExpectedIconNamesString.Split(Environment.NewLine)); 229public static TheoryData<string> ExpectedCursorNames() => new(ExpectedCursorNamesString.Split(Environment.NewLine)); 256string allNames = $"{ExpectedIconNamesString}{Environment.NewLine}{ExpectedCursorNamesString}{Environment.NewLine}{ExpectedResourceNames}"; 257string[] expected = allNames.Split(Environment.NewLine);
System\Windows\Forms\FolderBrowserDialogTests.cs (6)
18Assert.Equal(Environment.SpecialFolder.Desktop, dialog.RootFolder); 126[InlineData(Environment.SpecialFolder.Desktop)] 127[InlineData(Environment.SpecialFolder.StartMenu)] 128public void FolderBrowserDialog_RootFolder_Set_GetReturnsExpected(Environment.SpecialFolder value) 279RootFolder = Environment.SpecialFolder.CommonAdminTools, 296Assert.Equal(Environment.SpecialFolder.Desktop, dialog.RootFolder);
System\Windows\Forms\HtmlElementTests.cs (12)
542Assert.Equal($"InnerText{Environment.NewLine}MoreText", element.InnerText); 823Assert.Equal($"{Environment.NewLine}<DIV id=id></DIV>", element.OuterHtml); 838Assert.Equal($"{Environment.NewLine}<DIV id=id><P>OuterText</P></DIV>", element.OuterHtml); 843yield return new object[] { null, $"{Environment.NewLine}<DIV id=id></DIV>" }; 844yield return new object[] { "", $"{Environment.NewLine}<DIV id=id></DIV>" }; 845yield return new object[] { "OuterText", $"{Environment.NewLine}<DIV id=id>OuterText</DIV>" }; 846yield return new object[] { "<p>OuterText</p>", $"{Environment.NewLine}<DIV id=id><P>OuterText</P></DIV>" }; 874yield return new object[] { null, $"{Environment.NewLine}<DIV id=id></DIV>" }; 875yield return new object[] { "", $"{Environment.NewLine}<DIV id=id></DIV>" }; 876yield return new object[] { "OuterText", $"{Environment.NewLine}<DIV id=id></DIV>" }; 877yield return new object[] { "<p>OuterText</p>", $"{Environment.NewLine}<DIV id=id></DIV>" }; 954Assert.Equal($"OuterText{Environment.NewLine}MoreText", element.OuterText);
System\Windows\Forms\SpecialFolderEnumConverterTests.cs (56)
19Assert.Equal(Environment.SpecialFolder.CommonDocuments, converter.ConvertFrom("CommonDocuments")); 26var expected = new Environment.SpecialFolder[] 28Environment.SpecialFolder.AdminTools, 29Environment.SpecialFolder.ApplicationData, 30Environment.SpecialFolder.CDBurning, 31Environment.SpecialFolder.CommonAdminTools, 32Environment.SpecialFolder.CommonApplicationData, 33Environment.SpecialFolder.CommonDesktopDirectory, 34Environment.SpecialFolder.CommonDocuments, 35Environment.SpecialFolder.CommonMusic, 36Environment.SpecialFolder.CommonOemLinks, 37Environment.SpecialFolder.CommonPictures, 38Environment.SpecialFolder.CommonProgramFiles, 39Environment.SpecialFolder.CommonProgramFilesX86, 40Environment.SpecialFolder.CommonPrograms, 41Environment.SpecialFolder.CommonStartMenu, 42Environment.SpecialFolder.CommonStartup, 43Environment.SpecialFolder.CommonTemplates, 44Environment.SpecialFolder.CommonVideos, 45Environment.SpecialFolder.Cookies, 46Environment.SpecialFolder.Desktop, 47Environment.SpecialFolder.DesktopDirectory, 48Environment.SpecialFolder.Favorites, 49Environment.SpecialFolder.Fonts, 50Environment.SpecialFolder.History, 51Environment.SpecialFolder.InternetCache, 52Environment.SpecialFolder.LocalApplicationData, 53Environment.SpecialFolder.LocalizedResources, 54Environment.SpecialFolder.MyComputer, 55Environment.SpecialFolder.MyDocuments, 56Environment.SpecialFolder.MyMusic, 57Environment.SpecialFolder.MyPictures, 58Environment.SpecialFolder.MyVideos, 59Environment.SpecialFolder.NetworkShortcuts, 60Environment.SpecialFolder.PrinterShortcuts, 61Environment.SpecialFolder.ProgramFiles, 62Environment.SpecialFolder.ProgramFilesX86, 63Environment.SpecialFolder.Programs, 64Environment.SpecialFolder.Recent, 65Environment.SpecialFolder.Resources, 66Environment.SpecialFolder.SendTo, 67Environment.SpecialFolder.StartMenu, 68Environment.SpecialFolder.Startup, 69Environment.SpecialFolder.System, 70Environment.SpecialFolder.SystemX86, 71Environment.SpecialFolder.Templates, 72Environment.SpecialFolder.UserProfile, 73Environment.SpecialFolder.Windows 75Assert.Equal(expected, converter.GetStandardValues(null).Cast<Environment.SpecialFolder>()); 80.Setup(p => p.GetReflectionType(typeof(Environment.SpecialFolder), null)) 83TypeDescriptor.AddProvider(mockProvider.Object, typeof(Environment.SpecialFolder)); 84Assert.Equal(new Environment.SpecialFolder[] { Environment.SpecialFolder.Personal }, converter.GetStandardValues(null).Cast<Environment.SpecialFolder>()); 85TypeDescriptor.RemoveProvider(mockProvider.Object, typeof(Environment.SpecialFolder)); 99return (TypeConverter)Activator.CreateInstance(descriptor.Converter.GetType(), new Type[] { typeof(Environment.SpecialFolder) });
System\Windows\Forms\SystemInformationTests.cs (1)
729Assert.Equal(Environment.UserDomainName, domainName);
System\Windows\Forms\WindowsFormsSynchronizationContextTests.cs (1)
159context.Send(_ => { stackTrace = Environment.StackTrace; }, null);
System.Windows.Forms.UI.IntegrationTests (2)
Infra\DataCollectionService.cs (1)
241if (Environment.GetEnvironmentVariable("XUNIT_LOGS") is { Length: > 0 } baseLogDirectory)
Infra\SendInput.cs (1)
89if (PInvokeCore.GetWindowThreadProcessId(window, out uint processId) == 0 || processId != Environment.ProcessId)
System.Xaml (1)
System\Xaml\XamlSchemaContext.cs (1)
77if (_assemblyLoadHandler is not null && !Environment.HasShutdownStarted)
SystemdTestApp (2)
Startup.cs (2)
29+ $"{Environment.NewLine}" 32var response = $"hello, world{Environment.NewLine}";
Templates.Blazor.Tests (42)
BlazorTemplateTest.cs (2)
33Environment.SetEnvironmentVariable("EnableDefaultScopedCssItems", "true"); 34Environment.SetEnvironmentVariable("AllowMissingPrunePackageData", "true");
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
240{string.Join(Environment.NewLine, buffer)}");
src\ProjectTemplates\Shared\BlazorTemplateTest.cs (1)
47Environment.SetEnvironmentVariable("EnableDefaultScopedCssItems", "true");
src\ProjectTemplates\Shared\DevelopmentCertificate.cs (3)
19Path.Combine(Environment.CurrentDirectory, "aspnetcore-https.json"), 24?? throw new InvalidOperationException($"The aspnetcore-https.json file does not exist. Searched locations: {Environment.NewLine}{string.Join(Environment.NewLine, locations)}");
src\ProjectTemplates\Shared\Project.cs (7)
27var helixWorkItemUploadRoot = Environment.GetEnvironmentVariable("HELIX_WORKITEM_UPLOAD_ROOT"); 42public static string DotNetEfFullPath => (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DotNetEfFullPath"))) 46: Environment.GetEnvironmentVariable("DotNetEfFullPath"); 246if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DIR"))) 283$"Couldn't find listening url:\n{string.Join(Environment.NewLine, buffer.Append(process.Error))}"); 292if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DotNetEfFullPath"))) 312if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DotNetEfFullPath")))
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (2)
88(string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DIR"))) 92: Path.Combine(Environment.GetEnvironmentVariable("HELIX_DIR"), "Templates", "BaseFolder");
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (2)
45public static string CustomHivePath { get; } = Path.GetFullPath((string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 82if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
src\Shared\CertificateGeneration\CertificateManager.cs (1)
1042return string.Join(Environment.NewLine, description);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
25private static readonly string MacOSUserKeychain = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + "/Library/Keychains/login.keychain-db"; 33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https");
src\Shared\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);
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
48if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
src\Shared\Process\ProcessEx.cs (4)
124if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 126startInfo.EnvironmentVariables["NUGET_FALLBACK_PACKAGES"] = Environment.GetEnvironmentVariable("NUGET_FALLBACK_PACKAGES"); 228private static string GetNugetPackagesRestorePath() => (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("NUGET_RESTORE"))) 233: Environment.GetEnvironmentVariable("NUGET_RESTORE");
Templates.Blazor.WebAssembly.Auth.Tests (47)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
240{string.Join(Environment.NewLine, buffer)}");
src\ProjectTemplates\Shared\BlazorTemplateTest.cs (1)
47Environment.SetEnvironmentVariable("EnableDefaultScopedCssItems", "true");
src\ProjectTemplates\Shared\DevelopmentCertificate.cs (3)
19Path.Combine(Environment.CurrentDirectory, "aspnetcore-https.json"), 24?? throw new InvalidOperationException($"The aspnetcore-https.json file does not exist. Searched locations: {Environment.NewLine}{string.Join(Environment.NewLine, locations)}");
src\ProjectTemplates\Shared\Project.cs (7)
27var helixWorkItemUploadRoot = Environment.GetEnvironmentVariable("HELIX_WORKITEM_UPLOAD_ROOT"); 42public static string DotNetEfFullPath => (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DotNetEfFullPath"))) 46: Environment.GetEnvironmentVariable("DotNetEfFullPath"); 246if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DIR"))) 283$"Couldn't find listening url:\n{string.Join(Environment.NewLine, buffer.Append(process.Error))}"); 292if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DotNetEfFullPath"))) 312if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DotNetEfFullPath")))
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (2)
88(string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DIR"))) 92: Path.Combine(Environment.GetEnvironmentVariable("HELIX_DIR"), "Templates", "BaseFolder");
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (2)
45public static string CustomHivePath { get; } = Path.GetFullPath((string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 82if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
src\Shared\CertificateGeneration\CertificateManager.cs (1)
1042return string.Join(Environment.NewLine, description);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
25private static readonly string MacOSUserKeychain = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + "/Library/Keychains/login.keychain-db"; 33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https");
src\Shared\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);
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
48if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
src\Shared\E2ETesting\BrowserAssertFailedException.cs (2)
40.AppendJoin(Environment.NewLine, logs); 47.AppendJoin(Environment.NewLine, networkDetails);
src\Shared\E2ETesting\BrowserFixture.cs (4)
53var environmentOverride = Environment 164!string.Equals(Environment.GetEnvironmentVariable("E2E_TEST_VISIBLE"), "true", StringComparison.OrdinalIgnoreCase)) 183var binaryLocation = Environment.GetEnvironmentVariable("TEST_CHROME_BINARY"); 244var chromeDriverPathEnvVar = Environment.GetEnvironmentVariable("CHROMEWEBDRIVER");
src\Shared\E2ETesting\SauceConnectServer.cs (1)
184{string.Join(Environment.NewLine, logOutput.GetConsumingEnumerable())}.";
src\Shared\Process\ProcessEx.cs (4)
124if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 126startInfo.EnvironmentVariables["NUGET_FALLBACK_PACKAGES"] = Environment.GetEnvironmentVariable("NUGET_FALLBACK_PACKAGES"); 228private static string GetNugetPackagesRestorePath() => (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("NUGET_RESTORE"))) 233: Environment.GetEnvironmentVariable("NUGET_RESTORE");
Templates.Blazor.WebAssembly.Tests (47)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
240{string.Join(Environment.NewLine, buffer)}");
src\ProjectTemplates\Shared\BlazorTemplateTest.cs (1)
47Environment.SetEnvironmentVariable("EnableDefaultScopedCssItems", "true");
src\ProjectTemplates\Shared\DevelopmentCertificate.cs (3)
19Path.Combine(Environment.CurrentDirectory, "aspnetcore-https.json"), 24?? throw new InvalidOperationException($"The aspnetcore-https.json file does not exist. Searched locations: {Environment.NewLine}{string.Join(Environment.NewLine, locations)}");
src\ProjectTemplates\Shared\Project.cs (7)
27var helixWorkItemUploadRoot = Environment.GetEnvironmentVariable("HELIX_WORKITEM_UPLOAD_ROOT"); 42public static string DotNetEfFullPath => (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DotNetEfFullPath"))) 46: Environment.GetEnvironmentVariable("DotNetEfFullPath"); 246if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DIR"))) 283$"Couldn't find listening url:\n{string.Join(Environment.NewLine, buffer.Append(process.Error))}"); 292if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DotNetEfFullPath"))) 312if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DotNetEfFullPath")))
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (2)
88(string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DIR"))) 92: Path.Combine(Environment.GetEnvironmentVariable("HELIX_DIR"), "Templates", "BaseFolder");
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (2)
45public static string CustomHivePath { get; } = Path.GetFullPath((string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 82if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
src\Shared\CertificateGeneration\CertificateManager.cs (1)
1042return string.Join(Environment.NewLine, description);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
25private static readonly string MacOSUserKeychain = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + "/Library/Keychains/login.keychain-db"; 33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https");
src\Shared\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);
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
48if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
src\Shared\E2ETesting\BrowserAssertFailedException.cs (2)
40.AppendJoin(Environment.NewLine, logs); 47.AppendJoin(Environment.NewLine, networkDetails);
src\Shared\E2ETesting\BrowserFixture.cs (4)
53var environmentOverride = Environment 164!string.Equals(Environment.GetEnvironmentVariable("E2E_TEST_VISIBLE"), "true", StringComparison.OrdinalIgnoreCase)) 183var binaryLocation = Environment.GetEnvironmentVariable("TEST_CHROME_BINARY"); 244var chromeDriverPathEnvVar = Environment.GetEnvironmentVariable("CHROMEWEBDRIVER");
src\Shared\E2ETesting\SauceConnectServer.cs (1)
184{string.Join(Environment.NewLine, logOutput.GetConsumingEnumerable())}.";
src\Shared\Process\ProcessEx.cs (4)
124if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 126startInfo.EnvironmentVariables["NUGET_FALLBACK_PACKAGES"] = Environment.GetEnvironmentVariable("NUGET_FALLBACK_PACKAGES"); 228private static string GetNugetPackagesRestorePath() => (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("NUGET_RESTORE"))) 233: Environment.GetEnvironmentVariable("NUGET_RESTORE");
Templates.Mvc.Tests (47)
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
240{string.Join(Environment.NewLine, buffer)}");
src\ProjectTemplates\Shared\BlazorTemplateTest.cs (1)
47Environment.SetEnvironmentVariable("EnableDefaultScopedCssItems", "true");
src\ProjectTemplates\Shared\DevelopmentCertificate.cs (3)
19Path.Combine(Environment.CurrentDirectory, "aspnetcore-https.json"), 24?? throw new InvalidOperationException($"The aspnetcore-https.json file does not exist. Searched locations: {Environment.NewLine}{string.Join(Environment.NewLine, locations)}");
src\ProjectTemplates\Shared\Project.cs (7)
27var helixWorkItemUploadRoot = Environment.GetEnvironmentVariable("HELIX_WORKITEM_UPLOAD_ROOT"); 42public static string DotNetEfFullPath => (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DotNetEfFullPath"))) 46: Environment.GetEnvironmentVariable("DotNetEfFullPath"); 246if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DIR"))) 283$"Couldn't find listening url:\n{string.Join(Environment.NewLine, buffer.Append(process.Error))}"); 292if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DotNetEfFullPath"))) 312if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DotNetEfFullPath")))
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (2)
88(string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DIR"))) 92: Path.Combine(Environment.GetEnvironmentVariable("HELIX_DIR"), "Templates", "BaseFolder");
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (2)
45public static string CustomHivePath { get; } = Path.GetFullPath((string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 82if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
src\Shared\CertificateGeneration\CertificateManager.cs (1)
1042return string.Join(Environment.NewLine, description);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
25private static readonly string MacOSUserKeychain = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + "/Library/Keychains/login.keychain-db"; 33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https");
src\Shared\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);
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
48if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
src\Shared\E2ETesting\BrowserAssertFailedException.cs (2)
40.AppendJoin(Environment.NewLine, logs); 47.AppendJoin(Environment.NewLine, networkDetails);
src\Shared\E2ETesting\BrowserFixture.cs (4)
53var environmentOverride = Environment 164!string.Equals(Environment.GetEnvironmentVariable("E2E_TEST_VISIBLE"), "true", StringComparison.OrdinalIgnoreCase)) 183var binaryLocation = Environment.GetEnvironmentVariable("TEST_CHROME_BINARY"); 244var chromeDriverPathEnvVar = Environment.GetEnvironmentVariable("CHROMEWEBDRIVER");
src\Shared\E2ETesting\SauceConnectServer.cs (1)
184{string.Join(Environment.NewLine, logOutput.GetConsumingEnumerable())}.";
src\Shared\Process\ProcessEx.cs (4)
124if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 126startInfo.EnvironmentVariables["NUGET_FALLBACK_PACKAGES"] = Environment.GetEnvironmentVariable("NUGET_FALLBACK_PACKAGES"); 228private static string GetNugetPackagesRestorePath() => (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("NUGET_RESTORE"))) 233: Environment.GetEnvironmentVariable("NUGET_RESTORE");
Templates.Tests (48)
GrpcTemplateTest.cs (1)
98var isWindowsOld = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && Environment.OSVersion.Version < new Version(6, 2);
src\ProjectTemplates\Shared\AspNetProcess.cs (1)
240{string.Join(Environment.NewLine, buffer)}");
src\ProjectTemplates\Shared\BlazorTemplateTest.cs (1)
47Environment.SetEnvironmentVariable("EnableDefaultScopedCssItems", "true");
src\ProjectTemplates\Shared\DevelopmentCertificate.cs (3)
19Path.Combine(Environment.CurrentDirectory, "aspnetcore-https.json"), 24?? throw new InvalidOperationException($"The aspnetcore-https.json file does not exist. Searched locations: {Environment.NewLine}{string.Join(Environment.NewLine, locations)}");
src\ProjectTemplates\Shared\Project.cs (7)
27var helixWorkItemUploadRoot = Environment.GetEnvironmentVariable("HELIX_WORKITEM_UPLOAD_ROOT"); 42public static string DotNetEfFullPath => (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DotNetEfFullPath"))) 46: Environment.GetEnvironmentVariable("DotNetEfFullPath"); 246if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DIR"))) 283$"Couldn't find listening url:\n{string.Join(Environment.NewLine, buffer.Append(process.Error))}"); 292if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DotNetEfFullPath"))) 312if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DotNetEfFullPath")))
src\ProjectTemplates\Shared\ProjectFactoryFixture.cs (2)
88(string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DIR"))) 92: Path.Combine(Environment.GetEnvironmentVariable("HELIX_DIR"), "Templates", "BaseFolder");
src\ProjectTemplates\Shared\TemplatePackageInstaller.cs (2)
45public static string CustomHivePath { get; } = Path.GetFullPath((string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 82if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
src\Shared\CertificateGeneration\CertificateManager.cs (1)
1042return string.Join(Environment.NewLine, description);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (4)
25private static readonly string MacOSUserKeychain = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + "/Library/Keychains/login.keychain-db"; 33private static readonly string MacOSUserHttpsCertificateLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".aspnet", "dev-certs", "https");
src\Shared\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);
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
48if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
src\Shared\E2ETesting\BrowserAssertFailedException.cs (2)
40.AppendJoin(Environment.NewLine, logs); 47.AppendJoin(Environment.NewLine, networkDetails);
src\Shared\E2ETesting\BrowserFixture.cs (4)
53var environmentOverride = Environment 164!string.Equals(Environment.GetEnvironmentVariable("E2E_TEST_VISIBLE"), "true", StringComparison.OrdinalIgnoreCase)) 183var binaryLocation = Environment.GetEnvironmentVariable("TEST_CHROME_BINARY"); 244var chromeDriverPathEnvVar = Environment.GetEnvironmentVariable("CHROMEWEBDRIVER");
src\Shared\E2ETesting\SauceConnectServer.cs (1)
184{string.Join(Environment.NewLine, logOutput.GetConsumingEnumerable())}.";
src\Shared\Process\ProcessEx.cs (4)
124if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix"))) 126startInfo.EnvironmentVariables["NUGET_FALLBACK_PACKAGES"] = Environment.GetEnvironmentVariable("NUGET_FALLBACK_PACKAGES"); 228private static string GetNugetPackagesRestorePath() => (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("NUGET_RESTORE"))) 233: Environment.GetEnvironmentVariable("NUGET_RESTORE");
Test.Utilities (26)
CodeMetricsTestsBase.cs (2)
88var actualMetricsTextLines = actualMetricsText.Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries); 89var expectedMetricsTextLines = expectedMetricsText.Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries);
CSharpCodeFixVerifier`2+Test.cs (2)
53var commandLineArguments = CSharpCommandLineParser.Default.Parse(args, baseDirectory: Environment.CurrentDirectory, sdkDirectory: Environment.CurrentDirectory);
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (2)
99var parentPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
58if (Environment.OSVersion.Platform == PlatformID.Win32NT)
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\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
112: this(factory, Environment.ProcessorCount * 2, trimOnFree)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingOptions2.cs (1)
47_ => Environment.NewLine
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\LineFormattingOptions.cs (1)
19[DataMember] public string NewLine { get; init; } = Environment.NewLine;
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
285: reason + Environment.NewLine + restString;
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;
TestPassApp (1)
CommonControl2.cs (1)
14string executable = Environment.ProcessPath;
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);
Text.Analyzers (28)
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (2)
99var parentPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
src\Compilers\Core\Portable\InternalUtilities\CompilerOptionParseUtilities.cs (1)
42if (Environment.GetEnvironmentVariable(CachePathEnvironmentVariable) is not { Length: > 0 } cachePath)
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (2)
60if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("HELIX_DUMP_FOLDER"))) 70Environment.FailFast(message);
src\Compilers\Core\Portable\InternalUtilities\NoMessagePumpSyncContext.cs (1)
58if (Environment.OSVersion.Platform == PlatformID.Win32NT)
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\Dependencies\Contracts\ErrorReporting\FailFast.cs (3)
44Environment.FailFast(exception.ToString(), exception); 54Environment.FailFast(message); 110Fail("ASSERT FAILED" + Environment.NewLine + message);
src\Dependencies\PooledObjects\ObjectPool`1.cs (1)
112: this(factory, Environment.ProcessorCount * 2, trimOnFree)
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\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (1)
173foreach (var line in child.ToString().Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\FormattingOptions2.cs (1)
47_ => Environment.NewLine
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\LineFormattingOptions.cs (1)
19[DataMember] public string NewLine { get; init; } = Environment.NewLine;
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
285: reason + Environment.NewLine + restString;
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;
Text.Analyzers.UnitTests (2)
IdentifiersShouldBeSpelledCorrectlyTests.cs (2)
750string.Join(Environment.NewLine, words?.Select(x => $"<Word>{x}</Word>") ?? Enumerable.Empty<string>()); 755var contents = string.Join(Environment.NewLine, recognizedWords);
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\Compilers\Shared\BuildClient.cs (1)
151var libDirectory = Environment.GetEnvironmentVariable("LIB");
src\Compilers\Shared\BuildServerConnection.cs (4)
212var originalThreadId = Environment.CurrentManagedThreadId; 273var releaseThreadId = Environment.CurrentManagedThreadId; 554var environmentVariables = GetServerEnvironmentVariables(Environment.GetEnvironmentVariables(), logger); 674var userName = Environment.UserName;
src\Compilers\Shared\CompilerServerLogger.cs (3)
120loggingFilePath = Environment.GetEnvironmentVariable(EnvironmentVariableName); 153var threadId = Environment.CurrentManagedThreadId; 155string output = prefix + message + Environment.NewLine;
src\Compilers\Shared\ExitingTraceListener.cs (1)
58Environment.FailFast(message);
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\Compilers\Shared\Vbc.cs (1)
18: base(VisualBasicCommandLineParser.Default, responseFile, args, buildPaths, Environment.GetEnvironmentVariable("LIB"), analyzerLoader)
VBCSCompiler (15)
src\Compilers\Server\VBCSCompiler\ClientConnectionHandler.cs (1)
85if (!Environment.Is64BitProcess && !MemoryHelper.IsMemoryAvailable(Logger))
src\Compilers\Server\VBCSCompiler\CompilationCache.cs (1)
269logger.Log($"Cache miss {dllName} [{hashKey}] diff vs entry [{entryName}]:{Environment.NewLine}{diff}");
src\Compilers\Server\VBCSCompiler\NamedPipeClientConnectionHost.cs (1)
69var listenCount = Math.Min(4, Environment.ProcessorCount);
src\Compilers\Shared\BuildClient.cs (1)
151var libDirectory = Environment.GetEnvironmentVariable("LIB");
src\Compilers\Shared\BuildServerConnection.cs (4)
212var originalThreadId = Environment.CurrentManagedThreadId; 273var releaseThreadId = Environment.CurrentManagedThreadId; 554var environmentVariables = GetServerEnvironmentVariables(Environment.GetEnvironmentVariables(), logger); 674var userName = Environment.UserName;
src\Compilers\Shared\CompilerServerLogger.cs (3)
120loggingFilePath = Environment.GetEnvironmentVariable(EnvironmentVariableName); 153var threadId = Environment.CurrentManagedThreadId; 155string output = prefix + message + Environment.NewLine;
src\Compilers\Shared\ExitingTraceListener.cs (1)
58Environment.FailFast(message);
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") ?? "";
VBCSCompiler.UnitTests (6)
BuildServerConnectionTests.cs (3)
146var currentEnvironment = Environment.GetEnvironmentVariables(); 162Assert.Equal(originalDotNetRoot, Environment.GetEnvironmentVariable(RuntimeHostInfo.DotNetRootEnvironmentName)); 180foreach (System.Collections.DictionaryEntry entry in Environment.GetEnvironmentVariables())
CompilationCacheBehaviorTests.cs (1)
421Assert.True(emitResult.Success, string.Join(Environment.NewLine, emitResult.Diagnostics));
RunKeepAliveTests.cs (1)
14public override bool ShouldSkip => Environment.GetEnvironmentVariable("RunKeepAliveTests") == null;
TouchedFileLoggingTests.cs (1)
26private static readonly string s_libDirectory = Environment.GetEnvironmentVariable("LIB");
VisualBasicRuntimeTest (1)
Program.cs (1)
61Environment.Exit(2);
Wasm.Performance.ConsoleHost (1)
src\Shared\CommandLineUtils\Utilities\DotNetMuxer.cs (1)
48if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
Wasm.Performance.Driver (2)
Program.cs (2)
101exceptionMessage += Environment.NewLine + "Browser state: " + Environment.NewLine + innerHtml;
WinFormsControlsTest (5)
DragDrop.cs (2)
216? Environment.NewLine + Environment.NewLine + asciiCat
FormShowInTaskbar.cs (1)
40Text = $"Click here to test ShowInTaskbar.{Environment.NewLine}If the test result is failed, this dialog will automatically close, or it will throw an exception.",
Program.cs (2)
27Environment.Exit(-1); 30Environment.Exit(0);
WithDockerfile.AppHost (1)
Program.cs (1)
44var baseImage = Environment.GetEnvironmentVariable("BASE_IMAGE") ?? "mcr.microsoft.com/oss/go/microsoft/golang:1.23";
xunit.console (7)
common\AssemblyResolution\Microsoft.DotNet.PlatformAbstractions\RuntimeEnvironment.cs (1)
29Environment.GetEnvironmentVariable(OverrideEnvironmentVariableName) ??
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\EnvironmentWrapper.cs (1)
14return Environment.GetEnvironmentVariable(name);
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\Resolution\PackageCompilationAssemblyResolver.cs (2)
59string basePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
common\AssemblyResolution\XunitPackageCompilationAssemblyResolver.cs (3)
42var packageDirectory = Environment.GetEnvironmentVariable("NUGET_PACKAGES"); 47string basePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);