实例化MD5CryptoServiceProvider报错:此实现不是 Windows 平台 FIPS 验证的加密算法的一部分

System.InvalidOperationException: This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms.

捕捉到 System.InvalidOperationException
IsTransient=false
Message=此实现不是 Windows 平台 FIPS 验证的加密算法的一部分。
Source=mscorlib
StackTrace:
在 System.Security.Cryptography.MD5CryptoServiceProvider..ctor()

虽然不明白原因,经过查找一番,网上有人给出解决办法是:

修改注册表:HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlLsaFipsAlgorithmPolicy  的 enable=0 

我是在本地IIS调试网站时遇到的,修改注册表后并不是立即生效,需要回收网站的应用程序池,然后才生效。

查找资料:  

http://blogs.msdn.com/b/shawnfa/archive/2005/05/16/417975.aspx

http://blogs.msdn.com/b/brijs/archive/2010/08/10/issue-getting-this-implementation-is-not-part-of-the-windows-platform-fips-validated-cryptographic-algorithms-exception-while-building-outlook-vsto-add-in-in-vs-2010.aspx

原文地址:https://www.cnblogs.com/songxingzheng/p/5138477.html