Sorry in advance for the long question.
We have inherited a large ASP.NET application written in ASP.NET that is highly localized in several languages. At different points in our application, we have server-side code (in VB.NET) that compares two lines that are potentially in Unicode.
We noticed a number of differences between the application, which works fine in our test and development environments, but causes problems in our production environment. All environments are .NET 4.0 SP1 and SQL 2008 R2. The environment is different from the OS (works in Win 2008 Svr, IIS 7, but not in Win 2003 Svr, IIS 6). We compared .NET versions and service packs in these environments, confirmed that our SQL servers were identical, and all the matching parameters matched at the server and database levels, checked all the detailed code matches between our environments, and did everything possible to determine otherwise why we notice the difference below. We also checked that both sites work under the same version of the .NET platform and the basic settings of AppPool.
Some of the differences are:
This legacy application uses the CType VB.NET method in a number of places to convert what is ultimately a string to an integer. For example, CType (strData, Integer). In all test environments, this works fine, but during production we get exceptions in this line and methodically convert them to Int32.Parse (strData, Integer). We are confused about why there is a difference in environments with this line of code. If this does not cause an exception on any development machine or in our test environment, what can we look for, does this strengthen this limitation in production? The exception thrown is the “Invalid Cast from” from “3” to Integer, which makes sense, but we don’t understand what might cause some environments to allow this throw and others to throw the exception.
Unicode. , , . , , . ( ) , . ( "=", " /InvariantCulture " ..) . , , . ASP.NET , cboDropdown.SelectedValue , . .
, , - - , , - , ? ?