Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package validation not working when PackageId is used #23393

Closed
hudecekd opened this issue Jan 12, 2022 · 4 comments · Fixed by #27203
Closed

Package validation not working when PackageId is used #23393

hudecekd opened this issue Jan 12, 2022 · 4 comments · Fixed by #27203

Comments

@hudecekd
Copy link

Description

When I use PackageId in csproj to use different package name then package validation is not working but form build output diagnostics it seem it was executed without any problem.

Steps to reproduce

  1. Create project with some method
  2. Set version of package to 0.1.0
  3. Call dotnet pack
  4. Make it avilable in some directory where nuget.config is targeted.
  5. Add
    <EnablePackageValidation>true</EnablePackageValidation>
    <PackageValidationBaselineVersion>0.1.0</PackageValidationBaselineVersion>
  </PropertyGroup>
  1. Add some parameter to method
  2. Call dotnet pack
  3. Packing will fail which is expected with information that method without parameters is not found anymore and is in base package.

Now do same steps but use PackageId to rename package from beginning. Then step 6 will not fail.

Example project is available at PakcageValidationTestClassLibrary.zip.
Requires change in nuget.config to use local path of developer

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-ApiCompat untriaged Request triage from a team member labels Jan 12, 2022
@ericstj ericstj removed the untriaged Request triage from a team member label Jan 25, 2022
@ericstj
Copy link
Member

ericstj commented Jan 25, 2022

cc @joperezr @safern

@safern
Copy link
Member

safern commented Jan 26, 2022

Thanks, @hudecekd, I'll see what's going on.

@joperezr
Copy link
Member

joperezr commented Feb 3, 2022

As per the discussion offline, we should ensure that this works for cases where:

  • Package ID changed between baseline and current, but the assembly name was kept the same.
  • Package ID changed between baseline and current, and the assembly name was also changed.
  • Package ID remained the same between baseline and current, but the assembly name changed.

@safern
Copy link
Member

safern commented Feb 3, 2022

and the assembly name was also changed.

Assembly names between package version is a binary breaking change, and if fact we would warn if that happens.

The best scenario going forward is to support: #17364

Then if an assembly name changed we will detect it and emit warnings for the assembly name rule.

Adding: #18165 as a somewhat related issue to this one (this is what is causing this current scenario to not work).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants