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 @@ -82,7 +82,7 @@ Copyright (c) .NET Foundation. All rights reserved.

<Target Name="GenerateBuildDependencyFile"
DependsOnTargets="_DefaultMicrosoftNETPlatformLibrary;_HandlePackageFileConflicts"
BeforeTargets="_CheckForCompileOutputs"
BeforeTargets="CopyFilesToOutputDirectory"
Condition=" '$(GenerateDependencyFile)' == 'true'"
Inputs="$(ProjectAssetsFile)"
Outputs="$(ProjectDepsFilePath)">
Expand Down Expand Up @@ -126,7 +126,7 @@ Copyright (c) .NET Foundation. All rights reserved.

<Target Name="GenerateBuildRuntimeConfigurationFiles"
DependsOnTargets="_DefaultMicrosoftNETPlatformLibrary"
BeforeTargets="_CheckForCompileOutputs"
BeforeTargets="CopyFilesToOutputDirectory"
Condition=" '$(GenerateRuntimeConfigurationFiles)' == 'true'"
Inputs="$(ProjectAssetsFile);$(UserRuntimeConfig)"
Outputs="$(ProjectRuntimeConfigFilePath);$(ProjectRuntimeConfigDevFilePath)">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

using static Microsoft.NET.TestFramework.Commands.MSBuildTest;
using Xunit.Abstractions;
using System.Text.RegularExpressions;

namespace Microsoft.NET.Build.Tests
{
Expand Down Expand Up @@ -312,6 +313,43 @@ public static void Main(string [] args)

}

[Fact]
public void It_reports_a_single_failure_if_reference_assemblies_are_not_found()
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return;
}

var testProject = new TestProject()
{
Name = "MissingReferenceAssemblies",
// A version of .NET we don't expect to exist
TargetFrameworks = "net469",
IsSdkProject = true,
IsExe = true
};

var testAsset = _testAssetsManager.CreateTestProject(testProject, testProject.Name)
.Restore(Log, testProject.Name);

var buildCommand = new BuildCommand(Log, Path.Combine(testAsset.TestRoot, testProject.Name));

// Pass "/clp:summary" so that we can check output for string "1 Error(s)"
var result = buildCommand.Execute("/clp:summary");

result.Should().Fail();

// Error code for reference assemblies not found
result.StdOut.Should().Contain("MSB3644");

// Error code for exception generated from task
result.StdOut.Should().NotContain("MSB4018");

// Ensure no other errors are generated
result.StdOut.Should().Contain("1 Error(s)");
}

[Fact]
public void It_does_not_report_conflicts_if_the_same_framework_assembly_is_referenced_multiple_times()
{
Expand Down