Skip to content
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 when refreshing the Blueprints tab #194

Open
danrayson opened this issue Dec 13, 2024 · 1 comment
Open

Exception when refreshing the Blueprints tab #194

danrayson opened this issue Dec 13, 2024 · 1 comment

Comments

@danrayson
Copy link

I'm running EVEIPH on linux using wine and wine-mono (installed using winetricks), idk if that's going to cause this error though...

I select a BP from the drop down:
image

And then I get this error:

An Unhandled Exception has occured and EVE Isk per Hour will now close.
This error occured in EVE IPH Version: 5.0.9083.38011

Please fill out the following information so I can reproduce the bug

What is your Operating System? 
What tab or screen did the error occur? 
What are the steps to reproduce the Error? 
Web link to a screenshot of your error: 
In addition to a screenshot, copy the data below and send to developer.

Source: Microsoft.VisualBasic
Message:  Cast to type 'Currency' is not valid.
Raw Error Text: System.InvalidCastException:  Cast to type 'Currency' is not valid.
  at Microsoft.VisualBasic.Strings.FormatPercent (System.Object Expression, System.Int32 NumDigitsAfterDecimal, Microsoft.VisualBasic.TriState IncludeLeadingDigit, Microsoft.VisualBasic.TriState UseParensForNegativeNumbers, Microsoft.VisualBasic.TriState GroupDigits) [0x00094] in <b21fad58e89c4cc1a87c0cfaa6a3aa5f>:0 
  at EVE_Isk_per_Hour.ManufacturingFacility.CostIndexUpdateText () [0x0013e] in <bf2bb7163634488d96dcf698f2d238ed>:0 
  at EVE_Isk_per_Hour.ManufacturingFacility.DisplayFacilityBonus (EVE_Isk_per_Hour.ProductionType BuildType, System.Int32 ItemGroupID, System.Int32 ItemCategoryID, System.String Activity, EVE_Isk_per_Hour.FacilityTypes FacilityType, System.String FacilityName) [0x00e6e] in <bf2bb7163634488d96dcf698f2d238ed>:0 
  at EVE_Isk_per_Hour.ManufacturingFacility.LoadFacilities (System.Boolean NewFacility, System.String& FacilityActivity, System.Boolean& AutoLoadFacility, System.String OverrideFacilityName) [0x005ac] in <bf2bb7163634488d96dcf698f2d238ed>:0 
  at EVE_Isk_per_Hour.ManufacturingFacility.LoadFacility (System.Int32 ItemBPID, System.Int32 ItemGroupID, System.Int32 ItemCategoryID, System.Int32 BlueprintTech, System.Boolean LoadDefault, System.Boolean ActivityComboSelect, System.Boolean RefreshBP, EVE_Isk_per_Hour.BuildMatType BuildT2T3Type) [0x001a4] in <bf2bb7163634488d96dcf698f2d238ed>:0 
  at (wrapper remoting-invoke-with-check) EVE_Isk_per_Hour.ManufacturingFacility.LoadFacility(int,int,int,int,bool,bool,bool,EVE_Isk_per_Hour.BuildMatType)
  at EVE_Isk_per_Hour.frmMain.SelectBlueprint (System.Boolean NewBP, EVE_Isk_per_Hour.Public_Variables+SentFromLocation SentFrom, System.Boolean FromEvent) [0x0024b] in <bf2bb7163634488d96dcf698f2d238ed>:0 
  at EVE_Isk_per_Hour.frmMain.LoadBPFromCombo () [0x00045] in <bf2bb7163634488d96dcf698f2d238ed>:0 
  at EVE_Isk_per_Hour.frmMain.cmbBPBlueprintSelection_SelectionChangeCommitted (System.Object sender, System.EventArgs e) [0x0002c] in <bf2bb7163634488d96dcf698f2d238ed>:0 
  at System.Windows.Forms.ComboBox.OnSelectionChangeCommitted (System.EventArgs e) [0x0001f] in <37b868e51d474edaba9f0a5c46fd4d0d>:0 
  at System.Windows.Forms.ComboBox.OnSelectionChangeCommittedInternal (System.EventArgs e) [0x00014] in <37b868e51d474edaba9f0a5c46fd4d0d>:0 
  at System.Windows.Forms.ComboBox.WmReflectCommand (System.Windows.Forms.Message& m) [0x000ec] in <37b868e51d474edaba9f0a5c46fd4d0d>:0 
  at System.Windows.Forms.ComboBox.WndProc (System.Windows.Forms.Message& m) [0x00202] in <37b868e51d474edaba9f0a5c46fd4d0d>:0 
  at System.Windows.Forms.Control+ControlNativeWindow.OnMessage (System.Windows.Forms.Message& m) [0x00001] in <37b868e51d474edaba9f0a5c46fd4d0d>:0 
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x000b3] in <37b868e51d474edaba9f0a5c46fd4d0d>:0 
  at System.Windows.Forms.NativeWindow.Callback (System.Windows.Forms.Message& m) [0x00025] in <37b868e51d474edaba9f0a5c46fd4d0d>:0 

The version I was using was:
image

@danrayson
Copy link
Author

danrayson commented Dec 13, 2024

I've looked this up, and apparently it CAN be caused by different runtimes, so that'd explain it. In the code it's using a string that's passed to FormatPercent. This might work using dotnet, but when using mono it's failing.

It's probably caused (with my very limited understanding) by passing a string into the format method here:
image

I hope this is an easy fix to pass in an actual number, maybe pre-cast it to a float/decimal before passing to FormatPercent? Double.TryParse perhaps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant