I honestly don't think the problem is caused by the code.My application running on another server is not running on this server either.Another error that popped up:
An Exception has occured in application:
Access is denied
I gave full permission for IUSR and IIS_IUSRS users to the folder where the application is located. as if the server is not allowing the application to create sessions.Environment Windows 2016 Server and. IIS 10.0 . What setting change should be made that could cause this error.