This error comes up when the web application is using different version of framework than IIS
To fix this problem first check which framework your application is using, by right click on the project and click on properties
After than open up IIS and Double click on Application Pools
On the right panel double on your website and select the appropriate framwork version
That's it and now your website should work
I hope it was informative for you and I would like to Thank you for reading