After finishing the web application and publishing it online no matter I try I keep getting the following error, keep in mind that it runs locally as it should...
In case you encounter this during debugging on your Visual Studio running on a 64-bit operating system, and your application is a 32-bit, set your configuration manager to x86 (32 bit). This agrees to the previous answer to the set IIS to enable 32-bit application on 64-bit.
For me, I rebuild the individual projects and then rebuild the entire solution. That worked for me somehow. Simply building the solution may not work. I think when you "Clean" the solutions that will fix the issue.