The good server had .net framework 4.8 installed while the naughty server had only 4.7.1. All projects in the solution are 4.7.1. I don't know why 4.8 fixed it, but it is working now.