So we recently migrated an application from .NET 1.1 to .NET 4.0.
And with that, there was a bunch of compatibility issues which we had to fix.
One of them is that a block of code is throwing the InvalidOperationException
.
Public Function MyFunction(ByVal Params As myParams, ByVal ParamArray someNumber As Integer()) As myData
...
If someNumber.BinarySearch(options, MyEnum.Something) >= 0 Then
...
EndIf
...
EndFunction
Before we migrated to .NET4 this was working correctly in .NET1. Now based on some threads i've been reading, there has been reports about this problem which was fixed in .NET4.5. And that to fix this in my current version, I have to implement the IComparable interface on all elements of the array.
How do I go about to fixing this? I would appreciate any help and pointer. Thanks!
EDIT: Adding the link to the BinarySearch method we are using in the code. https://msdn.microsoft.com/en-us/library/y15ef976.aspx