Skip to content

ApiCompat flags introduction of a base exception type for exceptions previously inheriting from System.Exception #32922

Closed
@JanKrivanek

Description

@JanKrivanek

Describe the bug

ApiCompat check flags introduction of exception hierarchy:

was:
<Our Exceptions> --> System.Exception
proposed:
<Our Exceptions> --> Microsoft.Build.BackEnd.BuildExceptionBase --> System.Exception

error:

Microsoft.NET.ApiCompat.ValidatePackage.targets(39,5): error CP0007: (NETCORE_ENGINEERING_TELEMETRY=Build) Type 'Microsoft.Build.Exceptions.BuildAbortedException' does not inherit from base type 'System.Exception' on ref/net472/Microsoft.Build.dll but it does on [Baseline] ref/net472/Microsoft.Build.dll

More details on the scenario: dotnet/msbuild#8779 (comment)
Build with failure: https://dev.azure.com/dnceng-public/public/_build/results?buildId=287532&view=results

The new base was introduced in assembly Microsoft.Build.Framework. The exceptions in the same assembly that underwent same refactors are not flaged. The change is flaged only in assembly Microsoft.Build. However Microsoft.Build references Microsoft.Build.Framework and the dependency is properly captured in the packages as well:

image

To Reproduce

Introduce new base exception type that is defined in the referenced assembly

Further technical details

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions