vb.net - System.IO.FileLoadException thrown for no reason -


when switching between tabs, whenever enter tabcurves control @ point after initial entry, system.io.fileloadexception thrown @ line lstcurves_selectedindexchanged(nothing, eventargs.empty). baffling me, have sub (tabnurbs_enter(...)) has identical code, not throw exceptions.

what going on here?

code:

 private sub tabcurves_enter(byval sender object, byval e system.eventargs) handles tabcurves.enter     ' see if tab enter event marked supressed...     if tabmain.tag tabmain _         exit sub      lstcurves.items         ' remove old entries.         .clear()          ' add new curves.         integer = 0 m_nis.curves.count - 1             .add(m_nis.curves(i).name)         next     end      ' update selection.     lstcurves_selectedindexchanged(nothing, eventargs.empty) end sub  private sub lstcurves_selectedindexchanged(byval sender object, byval e system.eventargs) handles lstcurves.selectedindexchanged     if lstcurves.selectedindex = -1         ' since no curve selected, disable ui controls except add button.         ' ### code snipped ###          ' reset fields.         ' ### code snipped ###     else         ' since curve selected, enable ui controls.         ' ### code snipped ###          ' update fields.         ' ### code snipped ###          ' force update of slider.         sldcurvkeyframes_valuechanged(nothing, eventargs.empty)     end if end sub  private sub sldcurvkeyframes_valuechanged(byval sender object, byval e system.eventargs) handles sldcurvkeyframes.valuechanged     ' enable\disable controls depending upon whether slider enabled or not.     ' ### code snipped ### end sub  private sub tabnurbs_enter(byval sender object, byval e system.eventargs) handles tabnurbs.enter     ' see if tab enter event marked supressed...     if tabmain.tag tabmain _         exit sub      lstnurbs.items         ' remove old entries.         .clear()          ' add new curves.         integer = 0 m_nis.bsplines.count - 1             .add(m_nis.bsplines(i).name)         next     end      ' update selection.     lstnurbs_selectedindexchanged(nothing, eventargs.empty) end sub  private sub lstnurbs_selectedindexchanged(byval sender system.object, byval e system.eventargs) handles lstnurbs.selectedindexchanged     if lstnurbs.selectedindex = -1         ' since no curve selected, disable ui controls except add button.         ' ### code snipped ###          ' reset fields.         ' ### code snipped ###     else         ' since curve selected, enable ui controls.         ' ### code snipped ###          ' update fields.         ' ### code snipped ###          ' force update of sliders.         sldnurbsctlpoints_valuechanged(nothing, eventargs.empty)         sldnurbsknots_valuechanged(nothing, eventargs.empty)     end if end sub  private sub sldnurbsctlpoints_valuechanged(byval sender object, byval e system.eventargs) handles sldnurbsctlpoints.valuechanged     ' enable\disable controls depending upon whether slider enabled or not.     ' ### code snipped ###      ' update fields.     ' ### code snipped ### end sub  private sub sldnurbsknots_valuechanged(byval sender object, byval e system.eventargs) handles sldnurbsknots.valuechanged     ' enable\disable controls depending upon whether slider enabled or not.     ' ### code snipped ###      ' update fields.     ' ### code snipped ### end sub 

based on adrian's comment below, decided go snooping in lstcurves_selectedindexchanged , commented out code , slowing uncommented each line until found problem (in bold below).

 private sub lstcurves_selectedindexchanged(byval sender object, byval e system.eventargs) handles lstcurves.selectedindexchanged     if lstcurves.selectedindex = -1         ' since no curve selected, disable ui controls except add button.         btncurvremove.enabled = false         btncurvrename.enabled = false          ' reset fields.         txtcurvpreinfinity.text = ""         txtcurvpostinfinity.text = ""          sldcurvkeyframes.enabled = false         sldcurvkeyframes.value = 0         sldcurvkeyframes.maximum = 0     else         ' since curve selected, enable ui controls.         btncurvremove.enabled = true         btncurvrename.enabled = true          ' update fields.         m_nis.curves(lstcurves.selectedindex)             txtcurvpreinfinity.text = .preinfinity             txtcurvpostinfinity.text = .postinfinity             sldcurvkeyframes.enabled = true             sldcurvkeyframes.maximum = .keyframes.count - 1             sldcurvkeyframes.value = 0         end          ' force update of slider.         sldcurvkeyframes_valuechanged(nothing, eventargs.empty)     end if end sub 

keyframes of type ilist(of keyframe) property returns cast of internal list of type eventlist(of t) implements ilist(of t) type ilist(of keyframe). eventlist(of t) wrapper throws events when item added, inserted, removed, removed, modified, or list cleared or cleared.

would causing problems i'm experiencing?


here's relevant files define m_nis , animation curve objects. download

followed advised fix of using app.config files recommended xml code added:

<startup uselegacyv2runtimeactivationpolicy="true">   <supportedruntime version="v4.0" /> </startup> 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -