I'm having a problem where a collection of objects isn't being accessed correctly when run on a thread from a service. I can run my unit tests fine in VS2008 but when I attach the debugger to the service i can clearly see that it's not starting at the 1 based index but instead at the 0 based index. I've tried everything that I can think of to isolate this and the only difference is that it's in a service and not running as a command line app for example.
When I debug the function I also get a "property evaluation failed" message which I do not when I run it on my unit test.
Please advise.
[EDIT]
I know that arrays normally start from 0. I've always assumed this but today I found this bug and have determined that even though I thought that it started from 0, the debugger shows that it's starts at 1. When I iiterate through the collection it gets the right value in VS but not in the service.
[EDIT]
I'm using Microsoft.VisualBasic.Collection because I can put a key against it. A dictionary object could have also been used but it's now been setup this way and that's how my BLL Base classes and other numerous functions read it so it's not preferable to change it.
[SOLUTION]
I refactored my code using a dicitonary and Generic.KeyValuePair(Of String, Object) so that I wouldn't have to rewrite the code that accesses the keys. Should work fine now as it doens't handle collections int he same way as the collecitons object does.