Hi,
I have the same problem and got the same report: framework version v4.0.30319 (Lockheed Martin P3Dv5.1 Horfix 1).
The problem appears in relation to GSX, especially at pushback and refueling, so I suggest it is a GSX-problem.
The framework version on my computer is higher than v4.0, because I run the actual WINDOWS-updates (the last one includes framework 4.8).
So it could also be a problem related to P3D.
I am no programmer and can't fix the problem.
If somebody has a solution, I would be very happy.