简体   繁体   English

部署到IIS后出现404错误

[英]404 error after deploying to IIS

Before deploying my ASP.net software to the production site (Windows server 2012 R2), I first test the software on a test server. 在将ASP.net软件部署到生产站点(Windows Server 2012 R2)之前,我首先在测试服务器上测试该软件。 If that is succesful, I deploy (copy) the exact same software to the production site. 如果成功,则将完全相同的软件部署(复制)到生产站点。

On the production site, I got the following error when clicking on a link: 在生产站点上,单击链接时出现以下错误:

Warning, an 404 error has been detected: System.Web.HttpException (0x80004005): The file '/Account/Login.aspx' does not exist. 警告,已检测到404错误:System.Web.HttpException(0x80004005):文件'/Account/Login.aspx'不存在。 at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal... 在System.Web.Compilation.BuildManager.GetVPathBuildResultInternal ...

Note that the path '/Account/Login.aspx' was a part of the previous version of the deployed software. 请注意,路径“ /Account/Login.aspx”是已部署软件的早期版本的一部分。 The path no longer exists in the current version. 该路径在当前版本中不再存在。

I have tried to make a "clean-ip" by deleting the content in: 我试图通过删除以下内容来创建“ clean-ip”:

C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\Temporary ASP.NET Files\\root C:\\ Windows \\ Microsoft.NET \\ Framework64 \\ v4.0.30319 \\ ASP.NET临时文件\\根

but that did not help. 但这没有帮助。

  1. How do I find the root cause for the 404 error? 如何找到404错误的根本原因?

  2. How do I prevent old stuff from previous versions of the deployed software from making trouble in the latest deployed version? 如何防止以前版本的已部署软件中的旧内容在最新的部署版本中造成麻烦?

Thank you for trying to help me by adding comments to my question. 感谢您尝试通过在问题中添加评论来帮助我。

I have found that adding the following lines to 'web.config' file removes the error. 我发现将以下行添加到“ web.config”文件中可消除该错误。 I dont know why but the main thing is that it now works: 我不知道为什么,但是最主要的是它现在可以工作了:

<appSettings>
....
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None"/>
<add key="UserLockoutEnabledByDefault" value="true"/>
<add key="DefaultAccountLockoutTimeSpan" value="10"/>
<add key="MaxFailedAccessAttemptsBeforeLockout" value="3"/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM