Metodo String.GetHashCode e architettura a 64 Bit

In questo periodo tra le varie cose sto eseguendo dei test per l’esecuzione in ambiente Remote Desktop Services di Windows 2008 R2 di applicazioni .NET che erano state scritte e compilate su piattaforma a 32 Bit e tali rimarranno perche dovranno ancora essere eseguite su client a 32 bit.

Oggi sono incappato in malfunzionamento dell’applicazione dovuto al fatto che nel codice veniva utilizzato il metodo che restituisdce risultati diversi a seconda che l’architettura sia a 32 bit o a 64 bit.

Dal seguente String.GetHashCode Method:

Notes to Callers:
The value returned by GetHashCode is platform-dependent. The value returned by the GetHashCode method for a particular string value differs on the 32-bit and 64-bit versions of the .NET Framework.
 

Una cosa sicuramente da tenere in conto in un momento di trasizione architetturale come se si devono scrivere applicazione che potranno essere eseguiti in entrambe le piattaforme.