错误:由于权限不足,无法读取配置文件 [英] Error: Cannot read configuration file due to insufficient permissions

查看:248
本文介绍了错误:由于权限不足,无法读取配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好



我用MVC 2创建一个项目

我用过这段代码

 ServerManager smanager = new ServerManager(); 
网站site = smanager.Site [0];





我已经更改了我的IIS 7设置所以

这在IIS7中正确运​​行

但是在VS 2010中有一个错误



文件名:重定向.config 
错误:由于权限不足而无法读取配置文件



我不知道如何解决这个问题



谢谢

解决方案

在IIS7中应用以下cnhages。



1 。在Windows资源管理器中,找到与网站关联的web.config文件。

2.右键单击web.config文件

3.单击属性。

4.单击安全选项卡,然后单击编辑。

5.单击添加。

6.在输入要选择的对象名称框中,键入computername \IIS_IUSRS,单击检查名称,然后单击确定。

注意Computername是计算机名称的占位符。

7.单击以选中读取复选框,然后单击确定。

8.在Web.config属性对话框中,单击确定。


但是,它不起作用,然后进行更正以保护Web的安全性服务器和系统



您应该避免将This,The User作为一般通用权限授予,而不是授予IUSR,IIS_USERS(ACLS)权限),服务器读取,执行,列表的权限有限。



只有当您拥有代码时,才应添加网络,网络服务帐户需要较旧的模型,数据库访问模式。



对于这种CRM情况,您应该只对每个目录级别应用权限。



CRM解决方案的Admin目录部分应该具有最少数量的通用权限(ACLS),服务器以防止暴力攻击潜在的黑客! 管理员部分的更好权限是管理员,根,经过身份验证的用户仅限!


我相信您需要使用lonelystorage。查看 .NET中的隔离存储来存储应用程序数据 [ ^ ]

Hello

I create an project with MVC 2
I used this code

ServerManager smanager = new ServerManager();
Site site=smanager.Site[0];



I have changed my IIS 7 setting so
This is running correctly in IIS7
but in VS 2010 there is an error

Filename: redirection.config
Error: Cannot read configuration file due to insufficient permissions


and I don't know how to solve this

thank you

解决方案

Apply the following cnhages in IIS7.

1.In Windows Explorer, locate the web.config file that is associated with the Web site.
2.Right-click the web.config file
3.Click Properties.
4.Click the Security tab, and then click Edit.
5.Click Add.
6.In the Enter the object names to select box, type computername\IIS_IUSRS, click Check Names, and then click OK.
Note Computername is a placeholder for the computer name.
7.Click to select the Read check box, and then click OK.
8.In the Web.config Properties dialog box, click OK.


Still, it doesn't work, then a correction to preserve security for the Web Server & System

You should avoid granting "This,The User" as general,generic permissions instead you grant rights to the "IUSR","IIS_USERS" at (ACLS),Server a limited level of rights of Read,Execute,List.

The "Network","Network Service" accounts should br added only if you have code that requires the older model,mode of database access.

For this CRM situation you should only apply permissions on a per directory level.

The "Admin" directories section of a CRM solution should have the least number of generic permissions granted at tthe (ACLS),server to prevent a brute force attack by a potential "Hacker"! The better permissions for the "Admin" section is the "Administrator","Root","Authenticated User" acounts only!


I beleive that you need to use isolatedstorage. Look at Isolated Storage in .NET to store application data[^]


这篇关于错误:由于权限不足,无法读取配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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