2 implementations of IEnvironment
aspire (1)
HostEnvironment.cs (1)
13public sealed class HostEnvironment : IEnvironment
Aspire.Cli.Tests (1)
Utils\TestEnvironment.cs (1)
12internal sealed class TestEnvironment : IEnvironment
273 references to IEnvironment
aspire (179)
Acquisition\IdentityResolver.cs (3)
29/// depend on <see cref="IEnvironment"/> independently, avoiding a circular 63private readonly IEnvironment _environment; 73IEnvironment environment)
Acquisition\InstallationDiscovery.cs (2)
30private readonly IEnvironment _environment; 39IEnvironment environment,
Acquisition\InstallSourceDetector.cs (1)
17IEnvironment environment,
Agents\AgentPath.cs (2)
13public static string GetManagedSettingsDirectory(CliExecutionContext context, IEnvironment environment, string productName, string unixName) 75public static string? GetOverride(string variable, CliExecutionContext executionContext, IEnvironment environment)
Agents\ClaudeCode\ClaudeCodeAgentClient.cs (1)
14CliExecutionContext context, IEnvironment environment, ILogger<ClaudeCodeAgentClient> logger)
Agents\ClaudeCode\ClaudeCodePaths.cs (3)
10public static string GetConfigDirectory(CliExecutionContext executionContext, IEnvironment environment) 14public static string GetGlobalMcpConfigPath(CliExecutionContext executionContext, IEnvironment environment) 23private static string? GetConfigDirectoryOverride(CliExecutionContext executionContext, IEnvironment environment)
Agents\Copilot\CopilotAgentClient.cs (1)
14CliExecutionContext context, IEnvironment environment, ILogger<CopilotAgentClient> logger)
Agents\Copilot\CopilotAgentEnvironmentScanner.cs (1)
14IEnvironment environment,
Agents\Copilot\CopilotAppInstallationDetector.cs (1)
24IEnvironment environment,
Agents\Copilot\CopilotPaths.cs (1)
20public static string GetConfigDirectory(DirectoryInfo homeDirectory, IEnvironment environment)
Agents\Hooks\AgentTelemetryHook.cs (2)
15internal sealed class AgentTelemetryHook(IEnvironment environment) 103internal static string[]? Classify(string payload, IEnvironment environment, int maxPayloadCharacters)
Agents\OpenCode\OpenCodeAgentClient.cs (1)
13internal sealed class OpenCodeAgentClient(CliExecutionContext context, IEnvironment environment)
Agents\OpenCode\OpenCodePaths.cs (4)
29public static string GetConfigDirectory(CliExecutionContext context, IEnvironment environment) 34public static string GetManagedSettingsDirectory(CliExecutionContext context, IEnvironment environment) 42public static string GetGlobalMcpConfigPath(CliExecutionContext executionContext, IEnvironment environment) 56public static string? GetOverride(string name, CliExecutionContext executionContext, IEnvironment environment)
Agents\VsCode\VsCodeAgentEnvironmentScanner.cs (1)
14IEnvironment environment,
Backchannel\AppHostCliBackchannel.cs (1)
35IEnvironment environment,
Bundles\BundleService.cs (2)
24IEnvironment environment, 886internal static async Task ExtractPayloadAsync(Stream payloadStream, string destinationPath, IEnvironment environment, CancellationToken cancellationToken)
Caching\AppHostInfoDiskCache.cs (5)
31/// Tracked inputs (see <see cref="ComputeKeyAsync(FileInfo, IEnvironment, in DotNetAppHostProject.AppHostImportDependencies)"/>): 111private readonly IEnvironment _environment; 113public AppHostInfoDiskCache(ILogger<AppHostInfoDiskCache> logger, CliExecutionContext executionContext, IConfigurationService configurationService, IEnvironment environment) 289internal static string ComputeKeyAsync(FileInfo projectFile, IEnvironment environment) 292internal static string ComputeKeyAsync(FileInfo projectFile, IEnvironment environment, in DotNetAppHostProject.AppHostImportDependencies importDependencies)
Certificates\CertificateGeneration\CertificateManager.cs (1)
52public static CertificateManager Create(ILogger logger, IEnvironment environment, CertificateConfiguration.NssDbOverride? nssDbOverride) => environment.IsWindows() ?
Certificates\CertificateGeneration\UnixCertificateManager.cs (3)
45private readonly IEnvironment _environment; 49public UnixCertificateManager(ILogger logger, IEnvironment environment, CertificateConfiguration.NssDbOverride? nssDbOverride) : base(logger) 57IEnvironment environment,
Certificates\CertificateHelpers.cs (1)
47internal static string GetDevCertsTrustPath(IEnvironment environment)
Certificates\CertificateService.cs (1)
55IEnvironment environment,
Certificates\NativeCertificateToolRunner.cs (1)
19IEnvironment environment,
Commands\AgentTelemetryCommand.cs (2)
37private readonly IEnvironment _environment; 93AgentTelemetryHook hook, IEnvironment environment, ConsoleEnvironment console)
Commands\CompletionsCommand.cs (3)
14public CompletionsCommand(IEnvironment environment, CommonCommandServices services) 28private readonly IEnvironment _environment; 30public ScriptCommand(IEnvironment environment, CommonCommandServices services)
Commands\DashboardRunCommand.cs (8)
36private readonly IEnvironment _environment; 82IEnvironment environment, 183private static void AddOptionArgs(ParseResult parseResult, List<string> args, IReadOnlyList<string> unmatchedTokens, IEnvironment environment) 204IEnvironment environment, Option<string?> option, string envVarName, string? defaultValue) 222IEnvironment environment, Option<bool> option, string envVarName, bool? defaultValue = null) 246internal static bool ConfigSettingHasValue(IReadOnlyList<string> unmatchedTokens, IEnvironment environment, string envVarName) 277internal static DashboardInfo ResolveDashboardInfo(List<string> dashboardArgs, IReadOnlyList<string> unmatchedTokens, IEnvironment environment, string? browserToken) 298internal static string? ResolveSettingValue(List<string> args, IReadOnlyList<string> unmatchedTokens, IEnvironment environment, string key)
Commands\DeployCommand.cs (1)
23public DeployCommand(IDotNetCliRunner runner, IProjectLocator projectLocator, IFeatures features, ICliHostEnvironment hostEnvironment, IAppHostProjectFactory projectFactory, IConfiguration configuration, IEnvironment environment, AspireSecretsStoreResolver aspireSecretsStoreResolver, ILogger<DeployCommand> logger, IAnsiConsole ansiConsole,
Commands\DestroyCommand.cs (1)
23public DestroyCommand(IDotNetCliRunner runner, IProjectLocator projectLocator, IFeatures features, ICliHostEnvironment hostEnvironment, IAppHostProjectFactory projectFactory, IConfiguration configuration, IEnvironment environment, AspireSecretsStoreResolver aspireSecretsStoreResolver, ILogger<DestroyCommand> logger, IAnsiConsole ansiConsole,
Commands\DoCommand.cs (1)
23public DoCommand(IDotNetCliRunner runner, IProjectLocator projectLocator, IFeatures features, ICliHostEnvironment hostEnvironment, IAppHostProjectFactory projectFactory, IConfiguration configuration, IEnvironment environment, AspireSecretsStoreResolver aspireSecretsStoreResolver, ILogger<DoCommand> logger, IAnsiConsole ansiConsole,
Commands\PipelineCommandBase.cs (2)
52private readonly IEnvironment _environment; 115protected PipelineCommandBase(string name, string description, IDotNetCliRunner runner, IProjectLocator projectLocator, IFeatures features, ICliHostEnvironment hostEnvironment, IAppHostProjectFactory projectFactory, IConfiguration configuration, IEnvironment environment, AspireSecretsStoreResolver aspireSecretsStoreResolver, ILogger logger, IAnsiConsole ansiConsole, CommonCommandServices services)
Commands\PsCommand.cs (2)
77private readonly IEnvironment _environment; 100IEnvironment environment,
Commands\PublishCommand.cs (1)
42public PublishCommand(IDotNetCliRunner runner, IProjectLocator projectLocator, IPublishCommandPrompter prompter, IFeatures features, ICliHostEnvironment hostEnvironment, IAppHostProjectFactory projectFactory, IConfiguration configuration, IEnvironment environment, AspireSecretsStoreResolver aspireSecretsStoreResolver, ILogger<PublishCommand> logger, IAnsiConsole ansiConsole,
Commands\RenderCommand.cs (2)
568_serviceProvider.GetRequiredService<IEnvironment>(), 818IEnvironment environment,
Commands\SecretSetCommand.cs (2)
35private readonly IEnvironment _environment; 39IEnvironment environment,
Commands\StopCommand.cs (2)
28private readonly IEnvironment _environment; 69IEnvironment environment,
Commands\TrayCommand.cs (1)
15public TrayCommand(TrayStartCommand startCommand, TrayStopCommand stopCommand, IEnvironment environment, CommonCommandServices services)
Commands\TrayLifecycleService.cs (1)
23IEnvironment environment,
Commands\UpdateCommand.cs (3)
40private readonly IEnvironment _environment; 78IEnvironment environment, 1002private static bool IsInPath(string directory, IEnvironment environment)
Completions\CompletionScripts.cs (1)
10internal static string? DetectShell(IEnvironment environment)
Configuration\ConfigSourceService.cs (1)
27IEnvironment environment,
DotNet\DotNetCliRunner.cs (1)
219IEnvironment environment) : IDotNetCliRunner
DotNet\DotNetSdkInstaller.cs (3)
14internal sealed class DotNetSdkInstaller(IConfiguration configuration, IEnvironment environment) : IDotNetSdkInstaller 18internal DotNetSdkInstaller(IConfiguration configuration, IEnvironment environment, Func<string, string, ProcessStartInfo> createProcessStartInfo) 114internal static string ResolveDotNetPath(IEnvironment environment) =>
DotNet\ProcessExecution.cs (1)
19IEnvironment hostEnvironment)
DotNet\ProcessExecutionFactory.cs (2)
41private readonly IEnvironment _environment; 44public ProcessExecutionFactory(IEnvironment environment, ILogger<ProcessExecutionFactory> logger)
Git\GitRepository.cs (1)
18internal sealed class GitRepository(CliExecutionContext executionContext, IEnvironment environment, ILogger<GitRepository> logger, ProfilingTelemetry profilingTelemetry) : IGitRepository
HostEnvironment.cs (1)
10/// Default <see cref="IEnvironment"/> that delegates to the process
Layout\LayoutDiscovery.cs (2)
40private readonly IEnvironment _environment; 42public LayoutDiscovery(ILogger<LayoutDiscovery> logger, IEnvironment environment)
Npm\NpmRunner.cs (2)
16internal sealed class NpmRunner(IEnvironment environment, ILogger<NpmRunner> logger, ProfilingTelemetry profilingTelemetry) : INpmRunner 214internal static ProcessStartInfo CreateNpmProcessStartInfo(string npmPath, string[] args, string workingDirectory, IEnvironment environment, SafeFileHandle? standardInput)
NuGet\NuGetClient.cs (2)
142IEnvironment environment, 1464public static void Initialize(NuGetOperationOutput output, INuGetLogger diagnosticLogger, IEnvironment environment)
NuGet\NuGetSignatureVerificationEnabler.cs (2)
26public static void Apply(Dictionary<string, string> environmentVariables, IFeatures features, IEnvironment environment) 55public static IDisposable ApplyToCurrentProcess(IFeatures features, IEnvironment environment)
Processes\ProcessTreeGracefulShutdownService.cs (1)
23IEnvironment environment,
Program.cs (6)
400builder.Services.AddSingleton<IEnvironment, HostEnvironment>(); 403var environment = sp.GetRequiredService<IEnvironment>(); 440sp.GetRequiredService<IEnvironment>()); 509var environment = sp.GetRequiredService<IEnvironment>();
Projects\AppHostCandidateFinder.cs (1)
54IEnvironment environment,
Projects\AppHostConfigurationProjector.cs (1)
12internal sealed class AppHostConfigurationProjector(IConfigurationService configurationService, IEnvironment environment)
Projects\AppHostRpcClient.cs (3)
41IEnvironment environment, 186private static async Task<Stream> ConnectToServerAsync(string socketPath, IEnvironment environment, CancellationToken cancellationToken) 255internal sealed class AppHostRpcClientFactory(IEnvironment environment) : IAppHostRpcClientFactory
Projects\AppHostServerProject.cs (1)
37IEnvironment environment,
Projects\AppHostServerSession.cs (4)
34private readonly IEnvironment _environment; 66IEnvironment environment, 479private readonly IEnvironment _environment; 483public AppHostServerSessionFactory(IEnvironment environment, ILogger<AppHostServerSession> logger, ProfilingTelemetry profilingTelemetry)
Projects\DotNetAppHostProject.cs (2)
56private readonly IEnvironment _environment; 88IEnvironment environment,
Projects\DotNetBasedAppHostServerProject.cs (3)
49private readonly IEnvironment _environment; 61IEnvironment environment, 726internal static (string Os, string Arch) GetBuildPlatform(IEnvironment environment)
Projects\GuestAppHostProject.cs (2)
63private readonly IEnvironment _environment; 89IEnvironment environment,
Projects\GuestRuntime.cs (3)
23private readonly IEnvironment _environment; 43IEnvironment environment, 62public GuestRuntime(RuntimeSpec spec, ILogger logger, Func<string, string?> commandResolver, IEnvironment environment, ProfilingTelemetry profilingTelemetry, IProcessExecutionFactory processExecutionFactory, FileLoggerProvider? fileLoggerProvider = null)
Projects\NativeAppHostServerProject.cs (1)
47IEnvironment environment, IProcessExecutionFactory processes, ILogger logger, CancellationToken cancellationToken)
Projects\PrebuiltAppHostServer.cs (2)
50private readonly IEnvironment _environment; 91IEnvironment environment,
Projects\ProjectLocator.cs (1)
141IEnvironment environment,
Projects\TypeScriptAppHostToolchainResolver.cs (4)
43public static TypeScriptAppHostToolchain Resolve(DirectoryInfo appHostDirectory, IEnvironment environment, ILogger? logger) 54internal static TypeScriptAppHostToolchainResolution ResolveWithReason(DirectoryInfo appHostDirectory, IEnvironment environment) 480private static IEnumerable<DirectoryInfo> EnumerateCandidateDirectories(DirectoryInfo appHostDirectory, IEnvironment environment) 493internal static bool ShouldSearchParentDirectory(DirectoryInfo parentDirectory, IEnvironment environment, string? homeDirectory = null)
Scaffolding\ScaffoldingService.cs (3)
46private readonly IEnvironment _environment; 58IEnvironment environment, 366internal static IReadOnlyList<string> AddRootTypeScriptAppHostDelegateScripts(JsonObject scripts, DirectoryInfo appHostDirectory, string relativeAppHostDirectory, IEnvironment environment, ILogger? logger)
Telemetry\CIEnvironmentDetector.cs (3)
11private readonly IEnvironment _environment; 13public CIEnvironmentDetector(IEnvironment environment) 22public static bool IsCIEnvironment(IEnvironment environment)
Telemetry\CodingAgentDetector.cs (3)
10internal sealed class CodingAgentDetector(IEnvironment environment) : ICodingAgentDetector 53private readonly IEnvironment _environment = environment; 83public bool IsMatch(IEnvironment environment)
Telemetry\TelemetryServiceCollectionExtensions.cs (2)
24sp.GetRequiredService<ILoggerFactory>(), sp.GetRequiredService<IEnvironment>())); 33sp.GetRequiredService<IEnvironment>(), sp.GetRequiredService<TimeProvider>(),
Templating\CliTemplateFactory.cs (2)
82private readonly IEnvironment _environment; 94IEnvironment environment,
Templating\DotNetTemplateFactory.cs (1)
30IEnvironment environment)
Utils\ArchiveHelper.cs (2)
18internal static async Task ExtractAsync(string archivePath, string destinationPath, IEnvironment environment, CancellationToken cancellationToken) 71private static async Task ExtractTarGzSafeAsync(string archivePath, string destinationPath, IEnvironment environment, CancellationToken cancellationToken)
Utils\CliDownloader.cs (1)
21IEnvironment environment,
Utils\CliPathHelper.cs (2)
91internal static string? GetNuGetPackagesEnvironmentPath(IEnvironment environment) 231internal static string NormalizePathCasing(string path, IEnvironment environment)
Utils\EnvironmentChecker\ContainerRuntimeCheck.cs (1)
14internal sealed class ContainerRuntimeCheck(ILogger<ContainerRuntimeCheck> logger, IEnvironment environment) : IEnvironmentCheck
Utils\EnvironmentChecker\DcpConnectionChecker.cs (3)
27IEnvironment environment, 224IEnvironment environment, 410private static void AddDeveloperCertificateArguments(List<string> arguments, CertificateManager certificateManager, IEnvironment environment)
Utils\EnvironmentChecker\DeprecatedWorkloadCheck.cs (2)
17internal sealed class DeprecatedWorkloadCheck(ILogger<DeprecatedWorkloadCheck> logger, IEnvironment environment) : IEnvironmentCheck 24internal DeprecatedWorkloadCheck(ILogger<DeprecatedWorkloadCheck> logger, IEnvironment environment, Func<ProcessStartInfo, CancellationToken, Task<ProcessTextOutput>> runProcess)
Utils\EnvironmentChecker\DevCertsCheck.cs (6)
20internal sealed class DevCertsCheck(ILogger<DevCertsCheck> logger, ICertificateToolRunner certificateToolRunner, IEnvironment environment, IProcessExecutionFactory processExecutionFactory) : IEnvironmentCheck 71IReadOnlyList<DevCertInfo> certInfos, IEnvironment environment) 219private async Task AddLinuxOpenSslCertificateCacheWarningsAsync(List<EnvironmentCheckResult> results, IReadOnlyList<DevCertInfo> certInfos, IEnvironment environment, CancellationToken cancellationToken) 491private static void AddLinuxCertificateToolWarnings(List<EnvironmentCheckResult> results, IEnvironment environment) 517private static Dictionary<string, string> GetEnvironmentVariables(IEnvironment environment) => 561private static string BuildSslCertDirFixCommand(string devCertsTrustPath, IEnvironment environment)
Utils\EnvironmentChecker\GoAppHostToolingCheck.cs (3)
41private readonly IEnvironment _environment; 50IEnvironment environment, 68IEnvironment environment,
Utils\EnvironmentChecker\OperatingSystemCheck.cs (2)
21public OperatingSystemCheck(IEnvironment environment) 56internal static OperatingSystemDetails GetCurrentOperatingSystemDetails(IEnvironment environment)
Utils\EnvironmentChecker\TypeScriptAppHostToolingCheck.cs (3)
23private readonly IEnvironment _environment; 32IEnvironment environment, 49IEnvironment environment,
Utils\EnvironmentChecker\VsCodeExtensionCheck.cs (8)
31private readonly IEnvironment _environment; 35public VsCodeExtensionCheck(IEnvironment environment, CliExecutionContext executionContext) 42internal VsCodeExtensionCheck(IEnvironment environment, CliExecutionContext executionContext, Func<string, string?> commandResolver) 100internal static VsCodeExtensionDetection Detect(IEnvironment environment, DirectoryInfo homeDirectory) 107internal static VsCodeExtensionDetection Detect(IEnvironment environment, DirectoryInfo homeDirectory, Func<string, string?> commandResolver) 119private static bool IsVsCodeInstalled(IEnvironment environment, Func<string, string?> commandResolver) 133private static bool IsExtensionInstalled(IEnvironment environment, DirectoryInfo homeDirectory) 146private static IEnumerable<string> GetExtensionDirectories(IEnvironment environment, DirectoryInfo homeDirectory)
Utils\EnvironmentChecker\WslEnvironmentCheck.cs (3)
19private readonly IEnvironment _environment; 22public WslEnvironmentCheck(IEnvironment environment) 28internal WslEnvironmentCheck(IEnvironment environment, Func<string?> readProcVersion)
Utils\EnvironmentVariableExtensions.cs (1)
8internal static bool IsFlagEnabled(this IEnvironment environment, string name)
Utils\FileSystemHelper.cs (1)
144internal static Dictionary<string, string> ShortenPaths(IReadOnlyList<string> paths, IEnvironment environment)
Utils\MissingJavaScriptToolWarning.cs (2)
35public static string GetMessage(DirectoryInfo directory, LanguageInfo? language, IEnvironment environment) 41private static (string InstallCommand, string InstallDisplayName) GetMessageParts(DirectoryInfo directory, LanguageInfo? language, IEnvironment environment)
Aspire.Cli.Tests (94)
Acquisition\InstallSourceDetectorTests.cs (1)
275private InstallSourceDetector CreateDetector(string? processPath, IEnvironment environment, IWindowsRegistryReader? registry = null)
Agents\AgentConfigurationTestContext.cs (1)
73services.AddSingleton<IEnvironment>(Environment);
Agents\CopilotAppInstallationDetectorTests.cs (1)
135IEnvironment environment,
BundleServiceIntegrationTests.cs (1)
611/// Verifies that the static <see cref="BundleService.ExtractPayloadAsync(Stream, string, IEnvironment, CancellationToken)"/>
Certificates\CertificateServiceTests.cs (9)
206services.AddSingleton<IEnvironment>(TestEnvironment.CreateWindows()); 361services.AddSingleton<IEnvironment>(TestEnvironment.CreateWindows()); 402services.AddSingleton<IEnvironment>(TestEnvironment.CreateWindows()); 493services.AddSingleton<IEnvironment>(TestEnvironment.CreateWindows()); 531services.AddSingleton<IEnvironment>(TestEnvironment.CreateWindows()); 577services.AddSingleton<IEnvironment>(TestEnvironment.CreateWindows(envVars)); 611services.AddSingleton<IEnvironment>(TestEnvironment.CreateWindows()); 624private ServiceProvider CreateServiceProvider(TemporaryWorkspace workspace, TestCertificateToolRunner toolRunner, bool nonInteractive = false, IEnvironment? environment = null) 641return new CertificateService(toolRunner, interactiveService, telemetry, hostEnvironment, environment ?? sp.GetRequiredService<IEnvironment>(), executionContext, logger);
Commands\AgentInitClientSelectionTests.cs (18)
646services.AddSingleton<IEnvironment>(environment); 770services.AddSingleton<IEnvironment>(new TestEnvironment(new Dictionary<string, string?> { [variable] = value })); 813services.AddSingleton<IEnvironment>(environment); 877services.AddSingleton<IEnvironment>(environment); 914services.AddSingleton<IEnvironment>(environment); 937services.AddSingleton<IEnvironment>(new TestEnvironment( 993services.AddSingleton<IEnvironment>(environment); 1032services.AddSingleton<IEnvironment>(environment); 1059services.AddSingleton<IEnvironment>(environment); 1084services.AddSingleton<IEnvironment>(environment); 1127services.AddSingleton<IEnvironment>(environment); 1156services.AddSingleton<IEnvironment>(environment); 1183services.AddSingleton<IEnvironment>(environment); 1234services.AddSingleton<IEnvironment>(environment); 1267services.AddSingleton<IEnvironment>(environment); 1314services.AddSingleton<IEnvironment>(environment); 1348services.AddSingleton<IEnvironment>(environment); 1435services.AddSingleton<IEnvironment>(context.Environment);
Commands\AgentTelemetryCommandTests.cs (1)
102services.AddSingleton<IEnvironment>(new TestEnvironment(new Dictionary<string, string?>
Commands\ConfigSourceCommandTests.cs (7)
739services.AddSingleton<IEnvironment>(new TestEnvironment(new Dictionary<string, string?> 1173services.AddSingleton<IEnvironment>(new TestEnvironment(new Dictionary<string, string?> 1270services.AddSingleton<IEnvironment>(new TestEnvironment(new Dictionary<string, string?> 1389services.AddSingleton<IEnvironment>(new TestEnvironment(new Dictionary<string, string?> 1445services.AddSingleton<IEnvironment>(new TestEnvironment(new Dictionary<string, string?> 1481services.AddSingleton<IEnvironment>(new TestEnvironment(new Dictionary<string, string?> 1504services.AddSingleton<IEnvironment>(new TestEnvironment(new Dictionary<string, string?>
Commands\DashboardRunCommandTests.cs (10)
101var environment = CreateEnvironment(new Dictionary<string, string?> 115var environment = CreateEnvironment(new Dictionary<string, string?>()); 126var environment = CreateEnvironment(new Dictionary<string, string?>()); 555var environment = CreateEnvironment(new Dictionary<string, string?>()); 568var environment = CreateEnvironment(new Dictionary<string, string?> 585var environment = CreateEnvironment(new Dictionary<string, string?>()); 599var environment = CreateEnvironment(new Dictionary<string, string?> 617var environment = CreateEnvironment(new Dictionary<string, string?> 633var environment = CreateEnvironment(new Dictionary<string, string?>()); 728private static IEnvironment CreateEnvironment(Dictionary<string, string?> envVars)
Commands\DeployCommandTests.cs (1)
432services.AddSingleton<IEnvironment>(new TestEnvironment(explicitFile
Commands\DoctorCommandTests.cs (2)
58services.AddSingleton<IEnvironment>(context.Environment); 101services.AddSingleton<IEnvironment>(context.Environment);
Commands\NewCommandLocalTemplateTests.InitConfig.cs (1)
254services.AddSingleton<IEnvironment>(new TestEnvironment(new Dictionary<string, string?>
Commands\NewCommandLocalTemplateTests.SourceList.cs (3)
306services.AddSingleton<IEnvironment>(new TestEnvironment(new Dictionary<string, string?> 343services.AddSingleton<IEnvironment>(new TestEnvironment()); 410services.AddSingleton<IEnvironment>(new TestEnvironment());
Commands\NewCommandLocalTemplateTests.SourceListGit.cs (1)
300services.AddSingleton<IEnvironment>(new TestEnvironment(new Dictionary<string, string?>
Commands\SecretCommandTests.cs (2)
952IEnvironment? environment = null, 961IEnvironment? environment = null,
Commands\TrayCommandTests.cs (7)
31services.AddSingleton<IEnvironment>(TestEnvironment.CreateLinux()); 52services.AddSingleton<IEnvironment>(TestEnvironment.CreateLinux()); 76services.AddSingleton<IEnvironment>(TestEnvironment.CreateLinux()); 271services.AddSingleton<IEnvironment>(platform switch 290services.AddSingleton<IEnvironment>(TestEnvironment.CreateLinuxMusl()); 627services.AddSingleton<IEnvironment>(TestEnvironment.CreateMacOS()); 633services.AddSingleton<IEnvironment>(TestEnvironment.CreateWindows());
DotNetSdkInstallerTests.cs (1)
304IEnvironment? environment = null,
NuGet\NuGetSignatureVerificationEnablerTests.cs (6)
13private static IEnvironment CreateEnvironment(Dictionary<string, string?>? envVars = null) 23var environment = CreateEnvironment(); 40var environment = CreateEnvironment(new Dictionary<string, string?>()); // empty env — no user override 58var environment = CreateEnvironment(new Dictionary<string, string?> 79var environment = CreateEnvironment(new Dictionary<string, string?> 100var environment = CreateEnvironment();
Processes\ProcessTreeGracefulShutdownServiceTests.cs (1)
397IEnvironment? environment = null)
Projects\DotNetAppHostProjectTests.cs (2)
4822IEnvironment? environment = null) 4840services.RemoveAll<IEnvironment>();
Projects\GuestAppHostProjectTests.cs (2)
2568IEnvironment? environment = null, 2574var effectiveEnvironment = environment ?? new TestEnvironment();
Projects\ProjectLocatorTests.cs (1)
4295IEnvironment? environment = null,
Telemetry\AspireCliTelemetryTests.cs (1)
816services.AddSingleton<IEnvironment>(new TestEnvironment(environmentVariables));
Telemetry\CIEnvironmentDetectorTests.cs (1)
163services.AddSingleton<IEnvironment>(environment);
TestServices\TestConfigSourceServices.cs (1)
31TimeProvider? clock = null, IEnvironment? environment = null, TestConfigSourceDetector? detector = null,
TestServices\TestProcessExecutionFactory.cs (1)
21internal static IProcessExecutionFactory CreateForCliGuardian(IEnvironment environment, ILogger<ProcessExecutionFactory> logger)
Utils\CliTestHelper.cs (9)
247services.AddSingleton<IEnvironment, TestEnvironment>(); 511var environment = serviceProvider.GetRequiredService<IEnvironment>(); 572var environment = serviceProvider.GetRequiredService<IEnvironment>(); 586return new ScaffoldingService(appHostServerProjectFactory, serverSessionFactory, languageDiscovery, interactionService, serviceProvider.GetRequiredService<IEnvironment>(), logger, executionContext, serviceProvider.GetRequiredService<ProfilingTelemetry>(), serviceProvider.GetRequiredService<IFeatures>(), serviceProvider.GetRequiredService<IProcessExecutionFactory>()); 630var environment = serviceProvider.GetRequiredService<IEnvironment>(); 699return new GitRepository(executionContext, serviceProvider.GetRequiredService<IEnvironment>(), logger, profilingTelemetry);
Utils\DevCertsCheckTests.cs (1)
57private static DevCertsCheck CreateCheck(TestCertificateToolRunner toolRunner, IEnvironment environment, TestProcessExecutionFactory? processExecutionFactory = null) =>
Utils\TestEnvironment.cs (1)
9/// Test <see cref="IEnvironment"/> backed by a dictionary so tests can inject