diff --git a/src/Controls/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.SingleProject.targets b/src/Controls/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.SingleProject.targets index c8183a8997d5..6f4069e6d36d 100644 --- a/src/Controls/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.SingleProject.targets +++ b/src/Controls/src/Build.Tasks/nuget/buildTransitive/netstandard2.0/Microsoft.Maui.Controls.SingleProject.targets @@ -61,6 +61,24 @@ + + + + <_MauiOld_ResourcePrefix>$(_ResourcePrefix) + <_ResourcePrefix>Resources;$(_ResourcePrefix) + + + + + <_ResourcePrefix>$(_MauiOld_ResourcePrefix) + + + $(MSBuildExtensionsPath)\Microsoft\VisualStudio\Maui\Maui.DesignTime.targets diff --git a/src/TestUtils/src/Microsoft.Maui.IntegrationTests/TemplateTests.cs b/src/TestUtils/src/Microsoft.Maui.IntegrationTests/TemplateTests.cs index 178eaa01bdb1..6e50454f3948 100644 --- a/src/TestUtils/src/Microsoft.Maui.IntegrationTests/TemplateTests.cs +++ b/src/TestUtils/src/Microsoft.Maui.IntegrationTests/TemplateTests.cs @@ -342,6 +342,37 @@ public void BuildWindowsRidGraph(string id, bool useridgraph, string packageType $"Project {Path.GetFileName(projectFile)} failed to build. Check test output/attachments for errors."); } + [Test] + [TestCase("maui", "ios")] + [TestCase("maui", "maccatalyst")] + [TestCase("maui-blazor", "ios")] + [TestCase("maui-blazor", "maccatalyst")] + public void BuildWithCustomBundleResource(string id, string framework) + { + var projectDir = TestDirectory; + var projectFile = Path.Combine(projectDir, $"{Path.GetFileName(projectDir)}.csproj"); + + Assert.IsTrue(DotnetInternal.New(id, projectDir, DotNetCurrent), + $"Unable to create template {id}. Check test output for errors."); + + File.WriteAllText(Path.Combine(projectDir, "Resources", "testfile.txt"), "Something here :)"); + + FileUtilities.ReplaceInFile(projectFile, + "", + $""" + + + + + """); + + var extendedBuildProps = BuildProps; + extendedBuildProps.Add($"TargetFramework={DotNetCurrent}-{framework}"); + + Assert.IsTrue(DotnetInternal.Build(projectFile, "Debug", properties: extendedBuildProps, msbuildWarningsAsErrors: true), + $"Project {Path.GetFileName(projectFile)} failed to build. Check test output/attachments for errors."); + } + [Test] [TestCase("maui", $"{DotNetCurrent}-ios", "ios-arm64")] [TestCase("maui", $"{DotNetCurrent}-ios", "iossimulator-arm64")]