MVC4风格捆绑给403 [英] MVC4 style bundle giving 403

查看:166
本文介绍了MVC4风格捆绑给403的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在捆绑/缩小时启用,我的一些捆绑似乎有一个无效的URL在浏览器中(与结尾/)和IIS提供了一个403 Forbidden错误,好像试图列出文件夹中的内容。

When bundling/minification is enabled, some of my bundles seem to have an invalid URL in the browser (ending with a /), and IIS gives a 403 forbidden error, as if trying to list a folder's contents.

有一个在我的管束设置方式没有什么区别 - 它们不是.min.css,访问权限是否正确等。

There's no difference in the way my bundles are set up - they are not .min.css, access permissions are correct etc.

推荐答案

我的包被登记为它对应的是实际的文件夹的解决方案的路径,例如: 〜/内容/论坛

My bundles were registered as paths which corresponded to an actual folder on the solution, e.g. ~/Content/forum.

这时候捆绑关闭工作正常(包已正确包含!),但不是在启用捆绑。

This works fine when bundling is turned off (the bundle is included correctly!), but not when bundling is enabled.

的解决方案是改变束的注册名称不相同,任何存在于文件系统

The solution is to change the registered name of the bundle to not be the same as anything that exists in the file system.

这篇关于MVC4风格捆绑给403的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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