I tried to delete last element in inpInnov using inpInnov.RemoveAt(inpInnov.Count - 1);. However I was getting an error “ArgumentOutOfRangeException”, then I wrote%
Your code and your description has some conflicting information. This makes it really difficult to tell what you’re actually doing. You said you want to remove the last element but the code you have shown removes the first while printing the index of the last one. We don’t know if the two log messages do actually correspond to those two lines, have you checked the stacktrace?
Where / when is this code executed? Does the error happen consistently / can be repeated consistently? Is there any funky multi-threading going on?
We can not debug your code for you, especially when we don’t have the code nor the context. List.RemoveAt certainly does not have a bug.