An error occurred during the compilation of a resource required to service this request

It means you tried opening a web page and when asp.net tried to compile on the fly as it does it couldn't build the solution. You have a build error or you need to rebuild the solution. Open the solution in Visual Studio and try to build it. If it has compile errors fix them until you can build it then try to browse to it again.


I faced the same error, it got resolved by below steps:

1) Remove ASP.Net Temporary files (C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files)

2)Clean and rebuild the solution. Make sure you set the StartUp Project in your project in solution explorer.


In my case, I just restart application pool (stop and start). And it works!

Tags:

C#