How to fix ASP.NET error "The file 'nnn.aspx' has not been pre-compiled, and cannot be requested."?

I've not had that error, but after a little Googling I came across this link, I'm not sure if you've seen it yet: http://forums.asp.net/t/956297.aspx

Edit (adding the key text):

This error will come when a reference is specified in web.config and deployment folder/site does not contain these dlls installed in the system or bin folder does not contain them(if they are private assemblies). For Example: (add assembly="Namespace1.NameSpace2, Version=x.x.x.x, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/) if your web.config contains any assemblies like this and deployed server doesnot contain these assembiles in bin or GAC, then this error will occur.

People were reporting that missing assemblies on the destination server ended up being the root cause, in their cases, but they had the same error as you. Weird.

Maybe that's the problem?


I got this error when I upgraded a site from 2.0 to 4.0. The error was caused by a file PrecompiledApp.config in the site's root directory. Once I deleted that file, the site started working.


Just as a footnote to all of the above answers that resolved the issue via republishing to replace a missing assembly... While i have solved this issue previously with that same solution, i have just encountered another reason for it's occurrence which may assist others.

The AppPool that my site was running under had it's "Enable 32-bit applications" setting set to false. By changing this to true via the "Advanced Settings" dialog of the app pool i resolved my issue.

Hope that helps some other poor sucker.