Errors after installing .NET Framework 4.5


Description

Sitecore CMS 6.5 Update-4 and earlier CMS versions do not support .NET Framework 4.5.

When you install .NET Framework 4.5, it overwrites .NET Framework 4.0. This means that you cannot run these two versions of the .NET Framework at the same time.

The following exception will be raised while trying to log in to the Sitecore CMS application that has .NET Framework 4.0 selected in the application pool configuration settings, and when having .NET Framework 4.5 installed on the server:

[ArgumentException]: Object of type 'System.Int32' cannot be converted to type 'System.Web.Security.Cryptography.Purpose'.
   System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast)
   System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   Sitecore.SecurityModel.Cryptography.MachineKeyEncryption.CookieProtectionHelperWrapper.Encode(CookieProtection cookieProtection, Byte[] buf, Int32 count)
   ...

Solution

Solution 1:
Uninstall .NET Framework 4.5.
Solution 2:
Use .NET Framework 2.0 in Sitecore application pool configuration.
Solution 3:
Set the value of the “Login.RememberLastLoggedInUserName” setting in your web.config file to “false”.
After applying this solution, the same exception may however be raised when subscribing to Sitecore RSS feeds using the client interface.