发布ASP.NET MVC应用程序:读取配置文件权限

发布ASP.NET MVC应用程序:读取配置文件权限

问题描述:

将MVC应用程序发布到服务器甚至我的个人计算机时遇到了麻烦.

I am having some trouble when publishing an MVC application to a server, and even to my personal computer.

服务器已安装了MVC框架,所以这不是问题,而且我也已安装了它.

The server has the MVC framework installed so that is not the problem, and I also have it installed obviously.

本地计算机上的问题显然是权限问题,但我不确定需要什么权限...我尝试将IUSR添加到应用程序本身.

The problem on my local machine is obviously a permissions thing but im not sure what permissions are needed... I tried adding IUSR to the application itself.

iis错误消息是: IIS Web核心模块 通知BeginRequest 处理程序尚未确定 错误代码0x80070005 配置错误由于权限不足而无法读取配置文件 配置文件〜\ Visual Studio 2008 \ Project \ MVCApp \ web.config

The iis error message is: Module IIS Web Core Notification BeginRequest Handler Not yet determined Error Code 0x80070005 Config Error Cannot read configuration file due to insufficient permissions Config File ~\Visual Studio 2008\Project\MVCApp\web.config

并且在尝试查看应用程序中的任何内容时在服务器上显示找不到页面".

and on the server im getting "The page cannot be found" when trying to view anything in the app.

这也是一个表单身份验证应用程序,它拒绝经过身份验证的用户以外的所有内容

also this is a forms auth app that denys everything but authenticated users

您需要打开通配符映射,以便它可以解析路由.

You need to have wildcard mappings turned on so that it can resolve the routes.

看看选项1: http://blog .codeville.net/2008/07/04/options-for-deploying-aspnet-mvc-to-iis-6/

基本上,IIS试图在给定的URL上定位文件,但由于它们是MVC路由,因此该文件不存在.您需要告诉IIS将请求移交给ASP.Net路由处理程序,而不必担心检查文件在文件系统上是否存在. (永远不会存在)

Basically, IIS is trying to locate a file at the given URL, but it doesn't exist because they are MVC Routes. You need to tell IIS to hand off the request to the ASP.Net route handler, and not to worry about checking if the file exists on the file system. (it will never exist)