I have been building and rebuilding an ASP.NET program.
I made the horrible mistake, I think, of recently copying the published content back to the folder I was deve
If you haven't got the option of "Clean Solution" (maybe Express verions, or pre-2010 don't have this?) then, to fix this error, simply go to the /bin folder of your solution and delete all items, then Build again.
This will recompile all the DLL files.
In my case, the error is come from some cshtml
files that are under project folder but not included in project
. So if you search the error in entire solution, it couldn't be found. You can use show all files
to show the not included files, and try to open them to find the possible files that cause the error.
This problem I faced sometimes back while compiling. Go to this folder
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
and delete all the files and folder under it. When you build an application which is not hosted under IIS, temporary debug files and folder get created under this folder.
It may happen that you get an access denied error while deleting them. Close your Visual Studio solution and delete everything under this folder. It will resolve the compilation error.
For those using Visual Studio 2015 in Windows 8 or Windows 10, the solution is to remove all temp files from the following location:
%AppData%\Local\Temp\Temporary ASP.NET Files
and then rebuild your Solution.