-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception thrown: 'System.OverflowException' in mscorlib.dl #12
Comments
Cleaned up my comments. - Thanks again... |
Hi Cubico, I believe I have located the problem. You application uses the default language en-US. My application uses en-US and other language threads. Here is a console application that shows the issue for your edification. I will leave the Issue open. You can close when you want. I will managed this on my side by localizing. Nice job on you application. Thanks, // (c) 2016-2017 Rocklin Software - Information for Cubico using Cubico; using System; namespace Ii.Ecommerce.WhiteBox
} |
Sorry for my delayed response. I'll take a look. Thanks for finding this issue. |
@RocklinSoftware I was able to replicate your issue thanks to your detailed repro steps! The problem was in how I read the xml/json data from the file. String -> Decimal conversion. I'm now using CultureInfo.InvariantCulture to parse the decimal. I took your example as a unit test and it works as expected. I've checked in the code. I have yet to create a new nuget package. But feel free to recompile the repo until I can get another nuget package out there. Thanks! |
Hi Cubico,
You did a nice job on your application.
I am getting an error in a Web-Application project using v1.1.0.
A) In the Web-Application Cubico ATTEMPT 1 works and Cubico ATTEMPT 2 fails.
B) If I rollback your software to 1.0.1 Cubico ATTEMPT 1 works and Cubico ATTEMPT 2 works.
Any help is appreciated.
Thank you,
Dave
RocklinSoftware.com, Susanville, CA
SEE LAST POST.
This was in the Cubico code. Looked interesting. (? Cubico/Src/Cubico/UnitConverter.cs)
//TODO: Fix this; was Previously NaN
const double _failsafeValue = 0;
public Dictionary<string, Unit> _SymbolDictionary;
Dictionary<string, Symbol> _IndividualSymbolDictionary;
Dictionary<string, Unit> _UnitDictionary;
Dictionary<string, UnitType> _UnitTypeDictionary;
// Constructor, sets up the unit converter.
----- Web-Application Code
protected void Session_Start(object sender, EventArgs e) // WEBSITE
{
try
{
double value = Convert.ToDouble(2.2);
string c1 = "in";
string t1 = "cm";
EXCEPTION THROWN: Exception thrown: 'System.OverflowException' in mscorlib.dll
BAD MESSAGE: "Value was either too large or too small for a Decimal."
BAD STACK TRACE: " at System.Number.ParseDecimal(String value, NumberStyles options, NumberFormatInfo numfmt)\r\n at System.Convert.ToDecimal(String value)\r\n at Cubico.UnitProvider.ProcessUnitConverterData2(RootObject RootObject) in c:\Users\Ivan\Source\Repos\Cubico\Src\Cubico\UnitProvider.cs:line 125\r\n at Cubico.UnitProvider.LoadJsonDataFile() in c:\Users\Ivan\Source\Repos\Cubico\Src\Cubico\UnitProvider.cs:line 115\r\n at Cubico.UnitConverter..ctor() in c:\Users\Ivan\Source\Repos\Cubico\Src\Cubico\UnitConverter.cs:line 27\r\n at Ii.Website.MvcApplication.Session_Start(Object sender, EventArgs e) in C:\Users\euser\Desktop\CODEBASE\Solution\Ii.Website\Global.asax.cs:line 64"
The text was updated successfully, but these errors were encountered: