I encountered the same error, and this was resolved with the following steps:
1) Delete the temporary ASP.Net files (C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Temporary ASP.NET files)
2) Clean and rebuild the solution. Make sure you install the StartUp project in your project in Solution Explorer.
source share