diff --git a/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildACrossTargetedLibrary.cs b/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildACrossTargetedLibrary.cs
index f84909d4f14d..131369564cb4 100644
--- a/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildACrossTargetedLibrary.cs
+++ b/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildACrossTargetedLibrary.cs
@@ -142,5 +142,46 @@ public void OutputPathDoesNotHaveDuplicatedBackslashesInOuterBuild()
string outputPathValue = File.ReadAllText(Path.Combine(testAsset.TestRoot, testProject.Name, "OutputPathValue.txt"));
outputPathValue.Trim().Should().NotContain("\\\\");
}
+
+ [Fact]
+ public void OuterBuildImportsUserFile()
+ {
+ var testProject = new TestProject()
+ {
+ TargetFrameworks = $"{ToolsetInfo.CurrentTargetFramework};net7.0"
+ };
+
+ testProject.ProjectChanges.Add(xml =>
+ {
+ var target = """
+
+
+
+ """;
+
+ xml.Root.Add(XElement.Parse(target));
+ });
+
+ string temp = $"{testProject.Name}.csproj.user";
+ testProject.SourceFiles[temp] = """
+
+
+ A User defined value
+
+
+ """;
+
+ var testAsset = _testAssetsManager.CreateTestProject(testProject);
+
+ new BuildCommand(testAsset)
+ .Execute()
+ .Should()
+ .Pass();
+
+ string outputPathValue = File.ReadAllText(Path.Combine(testAsset.TestRoot, testProject.Name, "OutputPathValue.txt"));
+ outputPathValue.Should().Contain("User value is: A User defined value");
+ }
}
}