I intermitently get an error at the same line of code in a ASP.NET core web application, it is calling a function in a class library. It works the vast majority of the time but sometimes gives the error below.
The exact same code has been used from a ASP.NET 4.6 web app for a long time and never had this problem with that.