403-禁止访问:成功进行Web部署后,访问被拒绝 [英] 403 - Forbidden: Access is denied after successful web deployment

查看:679
本文介绍了403-禁止访问:成功进行Web部署后,访问被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将MVC 5应用程序部署到使用WebDeploy 3在Windows 2012 R2上运行的IIS上,一切都很好,除了有时成功部署后,我得到 403-禁止访问被拒绝从浏览器访问网站时出现错误.回收池可解决此问题,但不适合使用此选项.我希望IIS在WebDeploy完成文件更新后会自动回收池.

I deploy MVC 5 application to IIS running on Windows 2012 R2 with WebDeploy 3. Everything is fine except sometimes after successful deployment I get 403 - Forbidden: Access is denied error when accessing the site from a browser. Recycling the pool fixes the issue but it's not suitable option. I expect IIS to automatically recycle the pool once WebDeploy finishes updating the files

..........
Info: Updating file (blabla\Web.config).
Info: Adding ACL's for path (blabla.com)
Info: Adding ACL's for path (blabla.com)
Total changes: 22 (0 added, 0 deleted, 22 updated, 0 parameters changed, 1314018 bytes copied)

为什么?如何解决该问题?

Why? How do I troubleshoot the issue?

Windows事件日志(应用程序,安全性,WebDeploy或IIS)中没有警告或错误.该站点使用InProc会话,目标是.NET 4.5,应用程序池具有默认设置(在ApplicationPoolIdentity下运行). IIS身份验证启用匿名和仅表单模块.

There are no warnings or errors in Windows Event log (Application, Security, WebDeploy or IIS). The site uses InProc session, targets .NET 4.5, the app pool has default settings (runs under ApplicationPoolIdentity). IIS authentication enables anonymous and forms modules only.

推荐答案

今天这只是发生在我身上……花了几个小时摸索着尝试SO上提供的各种解决方案.

This just happened to me today... spent several hours scratching my head trying various solutions offered on SO.

我正在使用Visual Studio 2017社区...,并且正在部署到Windows Server 2012 R2和Windows Server 2016.

I am using Visual Studio 2017 Community... and I am deploying to Windows Server 2012 R2 and also to Windows Server 2016.

唯一适用于我的解决方案是取消选中Precompile during publishing设置.

The only solution that works for me is to uncheck the Precompile during publishing setting.

为什么这与众不同?

这篇关于403-禁止访问:成功进行Web部署后,访问被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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