error code 3005: Input string was not in a correct formatRSS

3 replies

Last post Jul 03, 2019 02:17 PM by peter.haude

  • error code 3005: Input string was not in a correct format

    Dec 14, 2018 07:56 PM|aross0155|LINK

    I have an application that is being migrated from server 2008 to server 2016.  The files including the web.config have been copied from one server to the other.  I have converted the application in IIS and set the authentication.  A test html page was added to the project to verify the connection.  IT WORKS! The other pages .aspx in the project don't work.  The event viewer has the following entry.

    Event code: 3005

    Event message: An unhandled exception has occurred.

    Event time: 12/14/2018 11:25:14 AM

    Event time (UTC): 12/14/2018 7:25:14 PM

    Event ID: 740c301e8c5648d881192a0d07e694f0

    Event sequence: 35

    Event occurrence: 1

    Event detail code: 0

    Exception information:

    Exception type: FormatException

    Exception message: Input string was not in a correct format.

    at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)

    at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)

    at System.String.System.IConvertible.ToInt32(IFormatProvider provider)

    at ASP.global_asax.Session_End(Object sender, EventArgs e)

    Thread information:

    Thread ID: 27

    Is impersonating: False

    Stack trace: at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)

    at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)

    at System.String.System.IConvertible.ToInt32(IFormatProvider provider)

    at ASP.global_asax.Session_End(Object sender, EventArgs e)

  • Re: error code 3005: Input string was not in a correct format

    Dec 14, 2018 10:58 PM|lextm|LINK

    aross0155

    Exception type: FormatException

    Exception message: Input string was not in a correct format.

    at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)

    at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)

    at System.String.System.IConvertible.ToInt32(IFormatProvider provider)

    at ASP.global_asax.Session_End(Object sender, EventArgs e)

    With so clear a call stack, it is time to debug your ASP.NET code.

    Lex Li
    Affordable IIS Consulting Services at https://support.lextudio.com/services/consulting.html
    ---------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: error code 3005: Input string was not in a correct format

    Dec 17, 2018 09:26 AM|Jalpa Panchal|LINK

    Hi aross0155,

    According to your error message, I guess you may use the wrong string(not number) to convert to number.

    I suggest you could try to use Int32.TryParse to convert string to number.

    More details about how to use it, you could refer to below article:

    https://docs.microsoft.com/en-us/dotnet/api/system.int32.tryparse?view=netframework-4.7.2

     

    Besides, since this error is related with asp.net, I suggest you could post this issue on the asp.net forum.

    Regards,

    Jalpa.

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
  • Re: error code 3005: Input string was not in a correct format

    Jul 03, 2019 02:17 PM|peter.haude|LINK

    We had this issue when converting a string to a decimal. Under Region and language Settings, go to Additional date time & regional settings and choose Region, click on Additional Settings... We changed the Decimal symbol, in our case to a dot and not comma. It still didn't work because you have to be signed in as Administrator. Being in the admin group is not enough in server 2016, the change has to be applied to all profiles by the Administrator. Alternatively, try adding the following line to force the globalization on a application level: <globalization uiCulture="en-US" culture="en-US"/>. I placed this in the <system.web> section.