If you have already tried all the other logical solutions on this page, then double check this. In my app.config I had a reference to an old framework.
<startup>
<supportedRuntime version="v2.0.50727"/>
</startup>
should have been
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
The project tab correctly showed v4.0 but the app.config was not committed to our repo with that change. To fix it, I changed the framework to something else and back to 4.0 again, which updated my app.config file.