成功发布ASP.NET(4.0)Web应用程序后的编译错误 [英] Compilation Error after Successful Publish of ASP.NET(4.0) Web Application

查看:180
本文介绍了成功发布ASP.NET(4.0)Web应用程序后的编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Web应用程序成功构建和发布,将文件复制到Web服务器后出现问题,当我尝试浏览多个页面时出现编译错误,但其他页面继续正常运行。

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.

Web服务器上失败的页面之前已经起作用了在Web服务器上没有针对此发布进行更改,并继续在Visual Studio 2010 Debug中正常工作。

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.

错误日志中的错误是:

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)

编辑:我复制了源aspx和cs文件其中一个失败的页面(重命名该类)并重新发布它的解决方案。新页面与其失败的对应物并排工作。

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.

IIS应用程序,physcial目录和受影响文件的第一次检查权限是正确的。

1st check permissions on the IIS app, physcial directory and the affected file are correct.

如果是不是权限,只在Web服务器上将自定义错误设置为RemoteOnly并重新发布。在.net 4中,使用以下选项发布应用程序,允许预编译的站点可更新和使用固定的命名约定和单页程序集

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!

这篇关于成功发布ASP.NET(4.0)Web应用程序后的编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆