Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Copyright (c) .NET Foundation. All rights reserved.

<!-- User-facing configuration-agnostic defaults -->
<PropertyGroup>
<BuildProjectReferences Condition="'$(BuildProjectReferences)' == '' and '$(NoBuild)' == 'true'">false</BuildProjectReferences>
<OutputType Condition=" '$(OutputType)' == '' ">Library</OutputType>
<FileAlignment Condition=" '$(FileAlignment)' == '' ">512</FileAlignment>
<ErrorReport Condition=" '$(ErrorReport)' == '' ">prompt</ErrorReport>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,40 @@ public void It_copies_content_transitively()
File.Exists(contentPath).Should().BeTrue();
}

[TestMethod]
public void It_does_not_build_project_references_when_no_build_is_requested()
{
var referencedProject = new TestProject()
{
Name = "ReferencedProject",
TargetFrameworks = ToolsetInfo.CurrentTargetFramework,
};
var referencingProject = new TestProject()
{
Name = "ReferencingProject",
TargetFrameworks = ToolsetInfo.CurrentTargetFramework,
};
referencingProject.ReferencedProjects.Add(referencedProject);

var testAsset = TestAssetsManager.CreateTestProject(referencingProject);
var buildCommand = new BuildCommand(testAsset);
buildCommand.Execute().Should().Pass();

var resolveReferencesCommand = new MSBuildCommand(Log, "ResolveReferences", buildCommand.FullPathProjectFile);

resolveReferencesCommand
.Execute("/p:NoBuild=true")
.Should()
.Pass();

resolveReferencesCommand
.Execute("/p:NoBuild=true", "/p:BuildProjectReferences=true")
.Should()
.Fail()
.And
.HaveStdOutContaining("NETSDK1085");
}

[TestMethod]
public void It_conditionally_references_project_based_on_tfm()
{
Expand Down
Loading