AssemblyVersion inconsistant across TFMs
- Dominant language
- C#
- Stars
- 3.2k
- Forks
- 894
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 23
Description
### Description
I'm not sure if it is by design or not, but I recently tripped up because the `AssemblyVersion` was not consistent across the different TFMs for some of the Microsoft.Extensions.* packages.
Looking at e.g `Microsoft.Extensions.Logging.Abstractions` and `Microsoft.Extensions.FileProviders.Abstractions` specifically, but I imagine it applies to most if not all packages built this way.
When there are multiple dlls supplied for different TFMs (net8.0, net9.0, net10.0, netstandard2.0, net462) the `AssemblyVersion` attribute does not match between them.
e.g.
```cs
// S:\.nuget\packages\microsoft.extensions.logging.abstractions\10.0.5\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll
// Microsoft.Extensions.Logging.Abstractions, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
[assembly: AssemblyFileVersion("10.0.526.15411")]
[assembly: AssemblyInformationalVersion("10.0.5+a612c2a1056fe3265387ae3ff7c94eba1505caf9")]
[assembly: AssemblyTitle("Microsoft.Extensions.Logging.Abstractions")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/dotnet")]
[assembly: AssemblyVersion("10.0.0.0")]
```
```cs
// S:\.nuget\packages\microsoft.extensions.logging.abstractions\10.0.5\lib\net10.0\Microsoft.Extensions.Logging.Abstractions.dll
// Microsoft.Extensions.Logging.Abstractions, Version=10.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
[assembly: AssemblyFileVersion("10.0.526.15411")]
[assembly: AssemblyInformationalVersion("10.0.5+a612c2a1056fe3265387ae3ff7c94eba1505caf9")]
[assembly: AssemblyTitle("Microsoft.Extensions.Logging.Abstractions")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/dotnet")]
[assembly: AssemblyVersion("10.0.0.0")]
```
```cs
// S:\.nuget\packages\microsoft.extensions.logging.abstractions\10.0.5\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll
// Microsoft.Extensions.Logging.Abstractions, Version=10.0.0.5, Culture=neutral, PublicKeyToken=adb9793829ddae60
[assembly: AssemblyFileVersion("10.0.526.15411")]
[assembly: AssemblyInformationalVersion("10.0.5+a612c2a1056fe3265387ae3ff7c94eba1505caf9")]
[assembly: AssemblyTitle("Microsoft.Extensions.Logging.Abstractions")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/dotnet")]
[assembly: AssemblyVersion("10.0.0.5")]
```
### Reproduction Steps
Use ILSpy or similar to decompile the .dll file from the nuget file downloaded from nuget.org.
Check the assembly name, and the AssemblyVersion attribute.
### Expected behavior
I would expect the AssemblyVersion to be consistent across all the DLLs and only be incremented if the assembly has changes per SemVer rules.
### Actual behavior
The AssemblyVersion in net4x appears to reflect the release - e.g. 10.0.0.5 in the package version 10.0.5, but is 10.0.0.0 in the other TFMs.
### Regression?
_No response_
### Known Workarounds
_No response_
### Configuration
Net 10 SDK. VS2026.
### Other information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.