dnlib
dnlib copied to clipboard
Should IsGreaterAssemblyRefVersion ignore 65535.65535.65535.65535?
I don't know why, but sometimes there's a reference mscorlib, 65535.65535.65535.65535
, should IsGreaterAssemblyRefVersion ignore it? And what's the meaning of this version?
It's a valid value in metadata. C# (and probably VB.NET) don't allow any of the fields to have the max value (65535), possibly because of a Windows OS limitation. Those values are copied to other parts of the PE file which Windows checks.
Partition II 22.2 page 130 "3. MajorVersion, MinorVersion, BuildNumber, and RevisionNumber can each have any value"
So to answer your question, I don't see a reason to update the code.
If you can show that CLR and/or CoreCLR have special checks for that version then the code will be updated though.
If there're references of mscorlib 2.0.0.0 4.0.0.0 and 65535.65535.65535.65535 in an assembly.
When someome call GetAssemblyRef("mscorlib"), I think he want to pick mscorlib 4.0.0.0 rather than 65535.65535.65535.65535
And I find this in ILSpy:
https://github.com/0xd4d/dnlib/blob/5a3927395c4ea7452d1844e74e7f4702dca8775e/src/DotNet/TypeDef.cs#L582
Don't include abstract since value types can be abstract without throwing at runtime
Don't include or don't check?