10 writes to AppHost
aspire (2)
Configuration\AspireConfigFile.cs (1)
454config.AppHost = new AspireConfigAppHost
Scaffolding\ScaffoldingService.cs (1)
272config.AppHost ??= new AspireConfigAppHost();
Aspire.Cli.Tests (8)
Configuration\AspireConfigFileTests.cs (3)
238AppHost = new AspireConfigAppHost { Path = "src/AppHost/AppHost.csproj" }, 272AppHost = new AspireConfigAppHost { Path = "src/AppHost/AppHost.csproj" }, 663AppHost = new AspireConfigAppHost { Path = "App.csproj" },
Projects\ProjectLocatorTests.cs (5)
1729AppHost = new AspireConfigAppHost 3154var config = new AspireConfigFile { AppHost = new AspireConfigAppHost { Path = "MyAppHost/MyAppHost.csproj" } }; 3175var config1 = new AspireConfigFile { AppHost = new AspireConfigAppHost { Path = "AppHost1.csproj" } }; 3181var config2 = new AspireConfigFile { AppHost = new AspireConfigAppHost { Path = "AppHost2.csproj" } }; 3207var config = new AspireConfigFile { AppHost = new AspireConfigAppHost { Path = "NonexistentAppHost/NonexistentAppHost.csproj" } };
49 references to AppHost
aspire (12)
Commands\RestoreCommand.cs (4)
211if (!string.IsNullOrWhiteSpace(config.AppHost?.Path)) 216if (!string.IsNullOrWhiteSpace(config.AppHost?.Language)) 218var language = _languageDiscovery.GetLanguageById(config.AppHost.Language); 221_logger.LogDebug("Configured AppHost language '{Language}' is not available for config-only restore in {Directory}", config.AppHost.Language, searchDirectory.FullName);
Configuration\AspireConfigFile.cs (2)
247if (config.AppHost?.Path is { Length: > 0 } migratedPath && !Path.IsPathRooted(migratedPath)) 252config.AppHost.Path = PathNormalizer.NormalizePathForStorage(
Projects\DotNetAppHostProject.cs (2)
2334if (!string.IsNullOrEmpty(config.AppHost?.Path)) 2337Path.GetFullPath(Path.Combine(directoryName, config.AppHost.Path)));
Projects\ProjectLocator.cs (2)
697if (aspireConfig?.AppHost?.Path is { } configAppHostPath) 1263if (existingConfig?.AppHost?.Path is { } existingPath &&
Scaffolding\ScaffoldingService.cs (2)
273config.AppHost.Path ??= appHostRelativePath; 274config.AppHost.Language = language.LanguageId;
Aspire.Cli.Tests (37)
Commands\ConfigSourceCommandTests.cs (3)
989Assert.Equal(appHostConfig ? "Test.AppHost.csproj" : "Test.AppHost/Test.AppHost.csproj", configuration.AppHost!.Path); 1026Assert.Equal(configuration.AppHost.Path, refreshed.AppHost!.Path);
Commands\TemplateSourceStartupTests.cs (1)
331Assert.Equal("apphost.cs", migrated.AppHost?.Path);
Configuration\AspireConfigFileTests.cs (20)
38Assert.Equal("MyApp/MyApp.csproj", result.AppHost?.Path); 116Assert.Equal("apphost.cs", result.AppHost?.Path); 166Assert.Equal("MyApp/MyApp.csproj", result.AppHost?.Path); 186Assert.Equal("MyApp/MyApp.csproj", result.AppHost?.Path); 227Assert.Null(result.AppHost); 681Assert.Equal("App.csproj", loaded.AppHost?.Path); 706Assert.Equal("src/apphost.ts", config.AppHost?.Path); 726Assert.Equal("apphost.ts", config.AppHost?.Path); 748Assert.Equal("MyApp.AppHost/MyApp.AppHost.csproj", config.AppHost?.Path); 773Assert.Equal("src/apphost.ts", saved.AppHost?.Path); 794Assert.Equal(absolutePath, config.AppHost?.Path); 816Assert.Equal("src/apphost.ts", config.AppHost?.Path); 835Assert.Equal("deeply/nested/path/apphost.ts", config.AppHost?.Path); 836Assert.DoesNotContain("\\", config.AppHost?.Path); 856Assert.Equal("", config.AppHost?.Path); 875Assert.Null(config.AppHost?.Path); 895Assert.Equal("MyApp.AppHost/apphost.ts", config.AppHost?.Path); 915Assert.Equal("MyApp.AppHost/MyApp.AppHost.csproj", config.AppHost?.Path); 933Assert.Equal("/path/apphost.ts", config.AppHost?.Path); 954Assert.Equal("c:\\path\\apphost.ts", config.AppHost?.Path);
Projects\ProjectLocatorTests.cs (13)
1539Assert.Equal("apphost.mts", updatedConfig?.AppHost?.Path); 1540Assert.Equal(KnownLanguageId.TypeScript, updatedConfig?.AppHost?.Language); 1577Assert.NotNull(settings!.AppHost?.Path); 1578Assert.DoesNotContain('\\', settings.AppHost.Path); // Ensure no backslashes 1579Assert.Contains('/', settings.AppHost.Path); // Ensure forward slashes 1640Assert.Equal("apphost.ts", adjacentConfig?.AppHost?.Path); 1641Assert.Equal(KnownLanguageId.TypeScript, adjacentConfig?.AppHost?.Language); 1709Assert.Null(appHost1Config?.AppHost?.Path); 1714Assert.Equal("apphost.ts", appHost2Config?.AppHost?.Path); 1715Assert.Equal(KnownLanguageId.TypeScript, appHost2Config?.AppHost?.Language); 1762Assert.Equal("apphost.ts", healedConfig?.AppHost?.Path); 1763Assert.Equal(KnownLanguageId.TypeScript, healedConfig?.AppHost?.Language); 1808Assert.NotNull(migratedConfig?.AppHost?.Path);