question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Package validation does not report any compatibility errors if package name != assembly name

See original GitHub issue

Hi 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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
joperezrcommented, Apr 11, 2022

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:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    ...
    <add key="dotnet6" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json" />
  </packageSources>
</configuration>
1reaction
saferncommented, Feb 3, 2022

Working on these issues now to get a fix for 6.0.3.

Read more comments on GitHub >

github_iconTop Results From Across the Web

.NET NuGet Package Validation does not show any output ...
PackageValidation did not show any output in my case, because the PackageID is different than the AssemblyName. This is already fixed by MS....
Read more >
MSB3277: Found conflicts between different versions of ' ...
This error occurs during a build when more than one version of the same dependent assembly is referenced in a build of the...
Read more >
Unable to resolve dependencies of NuGet packages
All NuGet package, Visual Studio throws the following error: Unable to resolve dependencies. 'Progress.Sitefinity.Authentication 10.0.6421' is not ...
Read more >
How to resolve “Could not load file or assembly … or one of its ...
Thus, another solution is to update NuGet package in all root project and then in subsequent referred project (if required) where same package...
Read more >
Conflict between Asset's Newtonsoft and ...
I created a package that I use in multiple projects that depends on Newtonsoft Json. As far as I can tell, there's no...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found