9 writes to AppHost
aspire (2)
Configuration\AspireConfigFile.cs (1)
405config.AppHost = new AspireConfigAppHost
Scaffolding\ScaffoldingService.cs (1)
259config.AppHost ??= new AspireConfigAppHost();
Aspire.Cli.Tests (7)
Configuration\AspireConfigFileTests.cs (2)
180AppHost = new AspireConfigAppHost { Path = "src/AppHost/AppHost.csproj" }, 426AppHost = new AspireConfigAppHost { Path = "App.csproj" },
Projects\ProjectLocatorTests.cs (5)
1665AppHost = new AspireConfigAppHost 3070var config = new AspireConfigFile { AppHost = new AspireConfigAppHost { Path = "MyAppHost/MyAppHost.csproj" } }; 3091var config1 = new AspireConfigFile { AppHost = new AspireConfigAppHost { Path = "AppHost1.csproj" } }; 3097var config2 = new AspireConfigFile { AppHost = new AspireConfigAppHost { Path = "AppHost2.csproj" } }; 3123var config = new AspireConfigFile { AppHost = new AspireConfigAppHost { Path = "NonexistentAppHost/NonexistentAppHost.csproj" } };
44 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)
196if (config.AppHost?.Path is { Length: > 0 } migratedPath && !Path.IsPathRooted(migratedPath)) 201config.AppHost.Path = PathNormalizer.NormalizePathForStorage(
Projects\DotNetAppHostProject.cs (2)
2280if (!string.IsNullOrEmpty(config.AppHost?.Path)) 2282var resolvedAppHostPath = Path.GetFullPath(Path.Combine(directoryName, config.AppHost.Path));
Projects\ProjectLocator.cs (2)
705if (aspireConfig?.AppHost?.Path is { } configAppHostPath) 1237if (existingConfig?.AppHost?.Path is { } existingPath &&
Scaffolding\ScaffoldingService.cs (2)
260config.AppHost.Path ??= appHostRelativePath; 261config.AppHost.Language = language.LanguageId;
Aspire.Cli.Tests (32)
Configuration\AspireConfigFileTests.cs (19)
37Assert.Equal("MyApp/MyApp.csproj", result.AppHost?.Path); 108Assert.Equal("MyApp/MyApp.csproj", result.AppHost?.Path); 128Assert.Equal("MyApp/MyApp.csproj", result.AppHost?.Path); 169Assert.Null(result.AppHost); 444Assert.Equal("App.csproj", loaded.AppHost?.Path); 469Assert.Equal("src/apphost.ts", config.AppHost?.Path); 489Assert.Equal("apphost.ts", config.AppHost?.Path); 511Assert.Equal("MyApp.AppHost/MyApp.AppHost.csproj", config.AppHost?.Path); 536Assert.Equal("src/apphost.ts", saved.AppHost?.Path); 557Assert.Equal(absolutePath, config.AppHost?.Path); 579Assert.Equal("src/apphost.ts", config.AppHost?.Path); 598Assert.Equal("deeply/nested/path/apphost.ts", config.AppHost?.Path); 599Assert.DoesNotContain("\\", config.AppHost?.Path); 619Assert.Equal("", config.AppHost?.Path); 638Assert.Null(config.AppHost?.Path); 658Assert.Equal("MyApp.AppHost/apphost.ts", config.AppHost?.Path); 678Assert.Equal("MyApp.AppHost/MyApp.AppHost.csproj", config.AppHost?.Path); 696Assert.Equal("/path/apphost.ts", config.AppHost?.Path); 717Assert.Equal("c:\\path\\apphost.ts", config.AppHost?.Path);
Projects\ProjectLocatorTests.cs (13)
1475Assert.Equal("apphost.mts", updatedConfig?.AppHost?.Path); 1476Assert.Equal(KnownLanguageId.TypeScript, updatedConfig?.AppHost?.Language); 1513Assert.NotNull(settings!.AppHost?.Path); 1514Assert.DoesNotContain('\\', settings.AppHost.Path); // Ensure no backslashes 1515Assert.Contains('/', settings.AppHost.Path); // Ensure forward slashes 1576Assert.Equal("apphost.ts", adjacentConfig?.AppHost?.Path); 1577Assert.Equal(KnownLanguageId.TypeScript, adjacentConfig?.AppHost?.Language); 1645Assert.Null(appHost1Config?.AppHost?.Path); 1650Assert.Equal("apphost.ts", appHost2Config?.AppHost?.Path); 1651Assert.Equal(KnownLanguageId.TypeScript, appHost2Config?.AppHost?.Language); 1698Assert.Equal("apphost.ts", healedConfig?.AppHost?.Path); 1699Assert.Equal(KnownLanguageId.TypeScript, healedConfig?.AppHost?.Language); 1744Assert.NotNull(migratedConfig?.AppHost?.Path);