Package validation does not report any compatibility errors if package name != assembly name
See original GitHub issueHi team,
We’re migrating our existing backward compatibility NuGet package to package validation feature introduced in .NET 6 SDK (baseline version validation).
It works fine in one repo, but we found out it didn’t work in another repo - build is not reporting any compatibility errors. I had to do a pretty tough investigation that involved digging into SDK code and creating a test app referencing SDK assemblies, and finally I found out that RunPackageValidation
target expects the same package and assembly names:
https://github.com/dotnet/sdk/blob/209d1385a6a7650510509413d9a42819651861c8/src/Compatibility/Microsoft.DotNet.PackageValidation/NupkgParser.cs#L47
So, if PackageId
and AssemblyName
are different in the project file, package validation will not report any compatibility errors and build will succeed.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:11 (7 by maintainers)
Top GitHub Comments
Unless I’m mistaken, I believe 6.0.3xx SDK should ship along 6.0.5 release, which should be shipping on the first couple of weeks of May.
If you want to use the prerelease package, then you can do so by connecting to our dotnet6 feed and getting the latest Microsoft.DotNet.Compatibility package (which as of now, it’s 1.1.0-preview.22210.6). That link I shared has instructions on how to connect to this feed, but basically what you want is to make sure to include the following feed in your NuGet.config:
Working on these issues now to get a fix for 6.0.3.