dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.14k stars 4.71k forks source link

Inconsistent AssemblyVersion of Microsoft.Extensions.Logging.Abstractions between .NET and .NET462 #109044

Open newbienewbie opened 5 hours ago

newbienewbie commented 5 hours ago

The latest stable Microsoft.Extensions.Logging.Abstractions.8.0.2.nupkg has an AssemblyVerion of 8.0.0.0 for .NET8 while attributing anther AssemblyVersion (8.0.0.2) for .NET462.)

This may lead confusing runtime error in some scenario.

Background

unable to load one of requested types, unable to load file or assembly "Microsoft.Extensions.Logging.Abstractions, Version=8.0.0.2"

Troubleshooting

The version 8.0.0. is suspicious. After inspecting the dlls in the debug folder, I find this dll AssemblyVersion is inconsistent between .NET and .NET462.

Image

So I guess here's the reason why my app B crash at runtime:

Is it better to make the AssemblyVersion the same regardless of .NET or .NET Framework ?

dotnet-policy-service[bot] commented 4 hours ago

Tagging subscribers to this area: @dotnet/area-extensions-logging See info in area-owners.md if you want to be subscribed.