jbevain / cecil

Cecil is a library to inspect, modify and create .NET programs and libraries.
MIT License
2.77k stars 630 forks source link

AssembyResolver improvements #790

Open Droppers opened 3 years ago

Droppers commented 3 years ago

.NET Assembly.Load resolves System.IO.Compression 4.2.0.0 to version 4.0.0.0 in the GAC using some magic, the assembly resolver of Cecil does not do this.

Explanation from Microsoft as to why:

There were some out of band packages for System.IO.Compression released with a higher versions reference assemblies. When supported netstandard 2.0 we had to support such reference versions and that is why VS ship with such higher version number in the ref assemblies. The .NET assembly loader internally handle such higher reference assembly version and map it to the implementation assembly 4.0.0.0.

I don't know if this mapping is publicly known, I haven't been able to find it and assume it is done in Fusion, which is not open source afaik.

https://developercommunity.visualstudio.com/t/systemiocompression-in-net-48-version-number-diffe/995459