Skip to content

ApiCompat incorrectly erroring out with ParameterModifiersCannotChange #7511

@utpilla

Description

@utpilla

ApiCompat tool is erroring out with the error ParameterModifiersCannotChange

Error ParameterModifiersCannotChange : Custom modifiers on parameter 'batch' on method 'OpenTelemetry.BaseExporter<T>.Export(OpenTelemetry.Batch<T>)' are 'System.Runtime.InteropServices.InAttribute' in the implementation but 'System.Runtime.InteropServices.InAttribute' in the contract.

I tried to debug this issue and I believe the issue is with the Union method in the code which is treating them as unique CustomModifiers.

I have attached the dlls here:

These were the parameters used for ApiCompat.exe:
--impl-dirs "C:\opentelemetry-dotnet\src\OpenTelemetry\obj\Debug\net452\,C:\opentelemetry-dotnet\src\OpenTelemetry.Api\bin\Debug\net452\,C:\Users\utpilla.REDMOND\.nuget\packages\microsoft.netframework.referenceassemblies.net452\1.0.0\build\.NETFramework\v4.5.2\,C:\Users\utpilla.REDMOND\.nuget\packages\system.buffers\4.5.1\ref\net45\,C:\Users\utpilla.REDMOND\.nuget\packages\system.collections.immutable\1.4.0\lib\portable-net45+win8+wp8+wpa81\,C:\Users\utpilla.REDMOND\.nuget\packages\system.diagnostics.diagnosticsource\5.0.1\lib\net45\,C:\Users\utpilla.REDMOND\.nuget\packages\system.memory\4.5.4\lib\netstandard1.1\,C:\Users\utpilla.REDMOND\.nuget\packages\system.runtime.compilerservices.unsafe\5.0.0\ref\netstandard1.0\,C:\Users\utpilla.REDMOND\.nuget\packages\microsoft.netframework.referenceassemblies.net452\1.0.0\build\.NETFramework\v4.5.2\Facades\,"

Please update the path accordingly in the command line argument.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Infrastructure-librariesArea maintained by .NET libraries team: APICompat, AsmDiff, GenAPI, GenFacades, PkgProj, etchelp wanted

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions