Version number mismatch between existing nuget reference

Ive added references to autofac 3.5.2 and autofac.extras.nlog 2.0.0-rc

I get a warning

Dependency Autofac:4.3.0: Version number mismatch between existing NuGet reference Autofac:3.5.2.

but shouldn’t that be an error ?

says it supports autofac >=4.3.0 (957.6 KB)



the problem is that you ask for autofac:[3.5.2], with the ] stating that you absolutely do not want a higher version.

autofac.extras.nlog 2.0.0-rc asks for <dependency id="Autofac" version="4.3.0" exclude="Build,Analyzers" /> which is higher — hence the conflict.

drop the ] and you should be good?

Yes that is the solution but what Im asking for here is that the warning to be turned into an error.

I had a project referencing an older version of autofac. I added the latest version of the extras assembly not noticing the version incompatibility, I ran the app and it failed at runtime with a method missing exception.

When I changed the version of autofac it ran without issue.

Well, I could it to an error an then set the stopwatch to wait how long it is going to take for someone to complain that it fails. Technically, this is not always a showstopper problem, and there’s cases where it’ll always mismatch on paper (because some reference has a dependency with a hard ]) that would would not be a able to work around.

With a warning, you get notified of the potential problem, and can be aware if it.

There’s plenty precedent of warnings indicating something that will crash at runtime, without qualifying as errors.

Did the warning get removed ?

I added a nuget to a project which references a specific version of microsoft.extensions.logging. The project already references [3.1.3]. I would expect a warning for this ? It just seems to have silently changed it to the version that my nuget is using

Screenshot 2023-02-12 at 1.22.27 PM

Can i get a test case for this? (265.3 KB)