Skip to content

[FEATURE] Fix RS0016 errors and enable correct PublicAPI file generation#557

Merged
marcin-krystianc merged 3 commits intoG-Research:masterfrom
MohamedM216:handle-RS0016
Feb 13, 2026
Merged

[FEATURE] Fix RS0016 errors and enable correct PublicAPI file generation#557
marcin-krystianc merged 3 commits intoG-Research:masterfrom
MohamedM216:handle-RS0016

Conversation

@MohamedM216
Copy link
Contributor

@MohamedM216 MohamedM216 commented Feb 10, 2026

Description

This PR resolves RS0016 errors by enabling clean Public API generation and separating API files per target framework.

I'm using ubuntu 22.04 and vs code, so I had to change the target framework in Consul.csproj to netstandard2.0 and run dotnet format ./Consul/Consul.csproj --diagnostics RS0016 then change it to net461 and run dotnet format ./Consul/Consul.csproj --diagnostics RS0016. That gave me a correct and clean build and correctly populated PublicAPI.Shipped.txt and PublicAPI.Unshipped.txt files.

Related Issues

#415

Additional Context

Checklist

Please make sure to check the following before submitting your pull request:

  • Did you read the contributing guidelines?
  • Did you update the docs?
  • Did you write any tests to validate this change?

Copy link
Contributor

@marcin-krystianc marcin-krystianc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the https://github.com/G-Research/ParquetSharp, we have a common Public.API files and also a framework specific ones. It would be nice if we also have similar structure here, so we avoid most of the duplications.

@MohamedM216
Copy link
Contributor Author

I'm not sure I fully understand. Could you please explain a bit more?

@marcin-krystianc
Copy link
Contributor

I'm not sure I fully understand. Could you please explain a bit more?

At the moment we have two framework specific API files (Consul/PublicAPI/net461/PublicAPI.Unshipped.txt and Consul/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt)
I guess it is possible to add a new common file (e.g.: Consul/PublicAPI/PublicAPI.Unshipped.txt) and move all common entries into the common file. The framework specific files should contain framework specific entries only (so we avoid duplicating entries)

@MohamedM216
Copy link
Contributor Author

I updated AdditionalFiles in Consul.csproj to include:

<ItemGroup>
    <AdditionalFiles Include="PublicAPI/PublicAPI.Shipped.txt" />
    <AdditionalFiles Include="PublicAPI/PublicAPI.Unshipped.txt" />
    <AdditionalFiles Include="PublicAPI/$(TargetFramework)/PublicAPI.Shipped.txt" />
    <AdditionalFiles Include="PublicAPI/$(TargetFramework)/PublicAPI.Unshipped.txt" />
  </ItemGroup>

However, it now only populates the common PublicAPI files even when I switch between target frameworks.

Copy link
Contributor

@marcin-krystianc marcin-krystianc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍
Thank you

@marcin-krystianc marcin-krystianc merged commit b08129d into G-Research:master Feb 13, 2026
118 checks passed
@MohamedM216 MohamedM216 deleted the handle-RS0016 branch February 13, 2026 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants