Skip to content

NU1511 warnings/errors for test projects with .NET 10 SDK #112729

Closed
@tmds

Description

@tmds

Some of our CI jobs that use a daily SDK build are failing. The SDK emits warnings for unused packages, and these warnings are then turned into errors.

See dotnet/core#9752 for info about the pruning warnings.

For example:

/home/tester/runtime/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/System.Text.RegularExpressions.Tests.csproj : error NU1510: Warning As Error: PackageReference Microsoft.VisualBasic will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. [/home/tester/runtime/Build.proj]
/home/tester/runtime/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/System.Text.RegularExpressions.Tests.csproj : error NU1510: Warning As Error: PackageReference System.Formats.Asn1 will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary. [/home/tester/runtime/Build.proj]
/home/tester/runtime/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/System.Text.Json.Tests.csproj : error NU1511: Warning As Error: A ProjectReference cannot be pruned, System.Text.Json. [/home/tester/runtime/Build.proj]
/home/tester/runtime/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/System.Text.Json.Tests.csproj : error NU1511: Warning As Error: A ProjectReference cannot be pruned, System.IO.Pipelines. [/home/tester/runtime/Build.proj]
/home/tester/runtime/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/System.Text.Json.Tests.csproj : error NU1511: Warning As Error: A ProjectReference cannot be pruned, System.Linq.AsyncEnumerable. [/home/tester/runtime/Build.proj]
/home/tester/runtime/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/System.Text.Json.SourceGeneration.Roslyn4.4.Unit.Tests.csproj : error NU1511: Warning As Error: A ProjectReference cannot be pruned, System.IO.Pipelines. [/home/tester/runtime/Build.proj]
/home/tester/runtime/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/System.Text.Json.SourceGeneration.Roslyn4.4.Unit.Tests.csproj : error NU1511: Warning As Error: A ProjectReference cannot be pruned, System.Reflection.Metadata. [/home/tester/runtime/Build.proj]
/home/tester/runtime/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/System.Text.Json.SourceGeneration.Roslyn4.4.Unit.Tests.csproj : error NU1511: Warning As Error: A ProjectReference cannot be pruned, System.Text.Json. [/home/tester/runtime/Build.proj]
/home/tester/runtime/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/System.Text.Json.SourceGeneration.Roslyn3.11.Unit.Tests.csproj : error NU1511: Warning As Error: A ProjectReference cannot be pruned, System.IO.Pipelines. [/home/tester/runtime/Build.proj]
/home/tester/runtime/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/System.Text.Json.SourceGeneration.Roslyn3.11.Unit.Tests.csproj : error NU1511: Warning As Error: A ProjectReference cannot be pruned, System.Reflection.Metadata. [/home/tester/runtime/Build.proj]
/home/tester/runtime/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/System.Text.Json.SourceGeneration.Roslyn3.11.Unit.Tests.csproj : error NU1511: Warning As Error: A ProjectReference cannot be pruned, System.Text.Json. [/home/tester/runtime/Build.proj]
/home/tester/runtime/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/System.Text.Json.SourceGeneration.Roslyn4.4.Tests.csproj : error NU1511: Warning As Error: A ProjectReference cannot be pruned, System.Text.Json. [/home/tester/runtime/Build.proj]
/home/tester/runtime/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/System.Text.Json.SourceGeneration.Roslyn3.11.Tests.csproj : error NU1511: Warning As Error: A ProjectReference cannot be pruned, System.Text.Json. [/home/tester/runtime/Build.proj]
/home/tester/runtime/src/libraries/System.Runtime/tests/System.Text.Encoding.Tests/System.Text.Encoding.Tests.csproj : error NU1511: Warning As Error: A ProjectReference cannot be pruned, System.IO.Pipelines. [/home/tester/runtime/Build.proj]
...

cc @ViktorHofer @nkolev92 @omajid

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions