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

ChocolateyLibDirHelper.VersionChangeFinished Index OOR Exception #36

Closed
tarwn opened this issue Feb 14, 2013 · 7 comments
Closed

ChocolateyLibDirHelper.VersionChangeFinished Index OOR Exception #36

tarwn opened this issue Feb 14, 2013 · 7 comments
Labels
Bug Issues where something has happened which was not expected or intended
Milestone

Comments

@tarwn
Copy link
Contributor

tarwn commented Feb 14, 2013

Loaded the application (in debug) with no saved settings. Went to menu and configured my settings folder. Clicked the "Installed Applications" tab and the load bar start going at bottom. Received an IndexOutOfRangeException:

System.IndexOutOfRangeException was unhandled
  HResult=-2146233080
  Message=Index was outside the bounds of the array.
  Source=ChocolateyGUI
  StackTrace:
       at Chocolatey.Explorer.Services.ChocolateyLibDirHelper.VersionChangeFinished(String version) in c:\Users\Tarwn\Documents\Visual Studio 2010\Projects\chocolatey-Explorer\Chocolatey Explorer\Services\ChocolateyLibDirHelper.cs:line 63
       at Chocolatey.Explorer.Services.ChocolateyService.InvokeOutputChanged(String output) in c:\Users\Tarwn\Documents\Visual Studio 2010\Projects\chocolatey-Explorer\Chocolatey Explorer\Services\ChocolateyService\ChocolateyService.cs:line 53
       at Chocolatey.Explorer.Services.ChocolateyService.OutPutChangedHandler(String output) in c:\Users\Tarwn\Documents\Visual Studio 2010\Projects\chocolatey-Explorer\Chocolatey Explorer\Services\ChocolateyService\ChocolateyService.cs:line 58
       at Chocolatey.Explorer.Powershell.RunSync.Run(String command) in c:\Users\Tarwn\Documents\Visual Studio 2010\Projects\chocolatey-Explorer\Chocolatey Explorer\Powershell\RunSync.cs:line 20
       at Chocolatey.Explorer.Services.ChocolateyService.Help() in c:\Users\Tarwn\Documents\Visual Studio 2010\Projects\chocolatey-Explorer\Chocolatey Explorer\Services\ChocolateyService\ChocolateyService.cs:line 41
       at Chocolatey.Explorer.Services.ChocolateyLibDirHelper.ReloadFromDir() in c:\Users\Tarwn\Documents\Visual Studio 2010\Projects\chocolatey-Explorer\Chocolatey Explorer\Services\ChocolateyLibDirHelper.cs:line 53
       at Chocolatey.Explorer.Services.ODataPackagesService.ListOfInstalledPackagsThread() in c:\Users\Tarwn\Documents\Visual Studio 2010\Projects\chocolatey-Explorer\Chocolatey Explorer\Services\PackagesService\ODataPackagesService.cs:line 119
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 
@tarwn
Copy link
Contributor Author

tarwn commented Feb 14, 2013

Ok, maybe this happens independant of me setting that file. The application now starts with the Installed Packages tab selected and immediately gets that exception.

@ghost ghost assigned tarwn Feb 14, 2013
tarwn added a commit that referenced this issue Feb 14, 2013
Added some basic tests around building the list of installed packages and put some logic and a custom exception in for the version parsing from chocolately /? output, then switched to a regex match
@tarwn
Copy link
Contributor Author

tarwn commented Feb 15, 2013

Since the application couldn't find chocolatey, it was getting unexpected output from powershell. I changed the logic to explicitly throw a ChocolateyVersionUnknownException in this situation, but I'm not sure how we want to handle the logic higher up in the interface. Thoughts?

@chrissie1
Copy link
Contributor

Show a messagebox that say "Chocolatey can not be found do you wan tot install it?" On Yes install it with the little powershell script. On No just quit the application. But this should be rare since chocolateygui is supposed to be installed from chocolatey.

@tarwn
Copy link
Contributor Author

tarwn commented Feb 15, 2013

Awesome, no idea how to do that. I'm unfamiliar with the way the application is interacting (using events for continuation) and I haven't done a windows app in years, so I may need someone to step in and do that last bit :)

tarwn added a commit that referenced this issue Feb 16, 2013
Switched frmo thread starts to TPL tasks with fault processing that passes the event back to the top. If it's a version exception we tell the user nicely and then exit
@tarwn
Copy link
Contributor Author

tarwn commented Feb 16, 2013

Code review? I added delegates for the Failed run, but switched from a Thread to using TPL (Task.Factory.StartNew) and lambdas to start and then handle faulted calls. I'm still trying to discover the root issue, which is why my chocolatey install isn't returning the expected version output :)

@chrissie1
Copy link
Contributor

can I close this?

@tarwn
Copy link
Contributor Author

tarwn commented Feb 23, 2013

No, because I did, so there :)

@tarwn tarwn closed this as completed Feb 23, 2013
@gep13 gep13 modified the milestones: 0.11.1, 0.11 Mar 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues where something has happened which was not expected or intended
Projects
None yet
Development

No branches or pull requests

3 participants