It's an odd question to ask, but I'll try.
I started my project using the target framework as 4.5.2, and the requirement was to sign a XML file using the SHA1 algorithm. I used the example in this MSDN page, and it worked fine:
SignedXml.CheckSignature Method (X509Certificate2, Boolean) -> Examples section
https://msdn.microsoft.com/en-us/library/ms148731(v=vs.110).aspx#Anchor_3
After that, the requirement changed to SHA256 algorithm. I used the code in those pages to adapt that original code, and it worked fine, I was using 4.6 as the target framework by that time:
Using SHA256 with the SignedXml Class
https://blogs.msdn.microsoft.com/winsdk/2015/11/14/using-sha256-with-the-signedxml-class/.net Framework 4.6.2 adds support to sign XML Documents using RSA-SHA256
https://www.stum.de/2016/05/19/net-framework-4-6-2-adds-support-to-sign-xml-documents-using-rsa-sha256/
Then I discovered that the version 4.6.2 of the framework added full support for SHA256, and that the CryptoConfig.AddAlgorithm() call was not necessary any more. I changed the project to version 4.6.2, made the changes needed, commented the CryptoConfig.AddAlgorithm() call and it worked just fine.
But now we have another requirement change: We want our software to work under Windows XP (yes, we do have users still using it), and the last framework version to work with XP (SP3) is v4.0. So, I needed to test if signing a XML file with SHA256 would work in framework 4.0.
I changed the target framework to v4.0 then and started the changes. The RSAPKCS1SHA256SignatureDescription class that I used in the CryptoConfig.AddAlgorithm() call is only available since framework 4.5, so I would have to write my own version of it, as I saw in some webpages.
But, now the strange thing. I kept the CryptoConfig.AddAlgorithm() call commented to see what would happen, so I could write the custom class, but, it just worked!
I thought that CryptoConfig.AddAlgorithm() had registered the algorithm somewhere in the project, or my machine. I researched about that but found nothing. So I tried in another machine, and it worked too, but that machine probably had executed the previous code before, so it could had the algorithm registered also. I tried another machine, that one I was not sure, but worked there too.
So, I went to a machine that have never even seen the project, and that time I compiled it and deployed the executable (I was executing the VS project on the other machines). I removed all the .NET frameworks after 4.0 on that machine and tried to run the application. And... it still works! It signs the XML using SHA256, and works fine. All those machines are running Windows 10.
Someone have any idea what is going on?