diff --git a/src/Templates/src/templates/maui-aspire-servicedefaults/MauiAspire.1.ServiceDefaults.csproj b/src/Templates/src/templates/maui-aspire-servicedefaults/MauiAspire.1.ServiceDefaults.csproj index d011350b2f8d..f77b00466a57 100644 --- a/src/Templates/src/templates/maui-aspire-servicedefaults/MauiAspire.1.ServiceDefaults.csproj +++ b/src/Templates/src/templates/maui-aspire-servicedefaults/MauiAspire.1.ServiceDefaults.csproj @@ -5,6 +5,7 @@ enable enable true + true diff --git a/src/TestUtils/src/Microsoft.Maui.IntegrationTests/SimpleTemplateTest.cs b/src/TestUtils/src/Microsoft.Maui.IntegrationTests/SimpleTemplateTest.cs index 85898ea1df33..9311104e0b38 100644 --- a/src/TestUtils/src/Microsoft.Maui.IntegrationTests/SimpleTemplateTest.cs +++ b/src/TestUtils/src/Microsoft.Maui.IntegrationTests/SimpleTemplateTest.cs @@ -340,9 +340,15 @@ public void AspireServiceDefaultsTemplateUsesCorrectProjectName(string projectNa Assert.IsTrue(File.Exists(Path.Combine(projectDir, "Extensions.cs")), "Expected Extensions.cs file was not created."); - // Verify we can build it (even if restore fails due to placeholder tokens, the project structure should be valid) + // Verify the project file contains required properties var projectContent = File.ReadAllText(expectedProjectFile); Assert.IsTrue(projectContent.Contains("true", StringComparison.Ordinal), "Project file should contain Aspire-specific properties."); + Assert.IsTrue(projectContent.Contains("true", StringComparison.Ordinal), + "Project file should contain UseMauiCore property."); + + // Verify the project actually builds + Assert.IsTrue(DotnetInternal.Build(expectedProjectFile, "Debug", properties: BuildProps, msbuildWarningsAsErrors: true), + $"Project {Path.GetFileName(expectedProjectFile)} failed to build. Check test output/attachments for errors."); } }