My Web Application builds and publishes successfully, the problem arises after copying the files to the web server, where I get a compilation error when I try to browse to several pages, other pages however continue to function correctly.
My first thought that was some of the files may not have been successfully copied so I republished and tested the page and all seemed well until I checked a different page that had been working with the previous publish that was now exhibiting the same problem subsequent publishing have seen similar effect with the pages affected altering each time.
The pages that are failing on the web server have previously been functional on the web server have not been altered for this publish and continue to work fine in Visual Studio 2010 Debug.
I have recycled the application pool restarted the website and rebooted the server.
The error from our error logs is:
GAE:: System.Web.HttpException (0x80004005): The file /XXXX.aspx has not been pre-compiled, and cannot be requested. at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
EDIT: I have copied the source aspx and cs files for one of the failing pages (renaming the class) and re published it the solution. The new page works side by side with its failing counterpart.
This error can be a red herring and usually masks the real error.
1st check permissions on the IIS app, physcial directory and the affected file are correct.
If it's not permissions, set custom errors to RemoteOnly on the webserver only and re-publish. In the .net 4, publish the app with the following options ticked, "allow pre compiled site to be updateable" and "use fixed naming conventions and single page assemblies"
When deployed to the webserver you should find the correct issue reported now, which will be a missing custom or 3rd party assembly, this may be recently added and removed, or a blast from the past which has reared its head again for no apparent reason (this was our issue, assembly not used in any forms, but was defined in the config file and hence took several forms down)
Hope this helps you to solve your issue - good luck!
I ran into the same problem with VS2017 and an application that was already running for a long time.
The application used to be deployed thru XCOPY deployment without publishing. After switching to the publishing method the error showed up. After some reasearch we found that in the production there was still an entry for profiles in the web.config while it had already been removed in developement since there was no need vor it anymore.
After uncommenting the node profiles in web.config the application was up and running.
While deploying we had also remove all files except APP_DATA and web.config.
I had the same issue.
Some of the pages throw error when trying to open after publishing them.
One solution which worked for me was .. When I checked the aspx files of those showing errors, had CodeFile and not CodeBehind...
I changed from CodeFile to CodeBehind and it worked fine. (Dont know if its a reason that CodeBehind alone available in the bin directory.. Am a newbie and may be this reason is not right. Please correct me if I was wrong)
But problem is, on localhost certain files throw error when they are left as CodeBehind.
I think this thread may be related:
As indicated there, our solution was to delete all the files under:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root
User contributions licensed under CC BY-SA 3.0