Click here to Skip to main content
12,300,379 members (53,601 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# C#4.0 .NET4
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
Posted 17-Mar-12 1:57am
Comments
sam.198979 14-May-13 6:01am
   
Hi,

I got same error:
Filename: redirection.config
Error: Cannot read configuration file due to insufficient permissions

But am working on Windows 8.

I did't find this steps in Windows 8.

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.Enter the object name to select(example) Textbox will display for you type IIS_IUSRS and click check user button. as well IUSR then OK, it will be added in user list. Or Click Advanced then Click Find Now Button it shows all the users to you select the users from the users list.
7.Click OK. And and give permission for the users IIS_IUSRS and IUSR
8.Click to select the Read check box, and then click OK.
10.In the Web.config Properties dialog box, click OK.


can any one help me.

Thanks Regards
sam.198979
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Comments
dkgawriya21 17-Mar-12 8:22am
   
Add user IIS_IUSRR and give the permissions with full control to web.config and restarted the solution but still same error...
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

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!
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

I beleive that you need to use isolatedstorage. Look at Isolated Storage in .NET to store application data[^]
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 7

I had trouble adding IIS_IUSRS. I kept getting a dialog box with this message in it:

An object named "IIS_IUSRS" cannot be found. Check the selected object types and location for accuracy and ensure that you typed the object name correctly, or remove this object from the selection.

This may be due to security choices at our company. Eventually when I was trying to add IIS_IUSRS I noticed that there was an option for Location: When I chose my computer instead of any of the corporate entities, I was able to add IIS_IUSRS to have read access to the directory that I made my web site in. After restarting IIS, and my web site, and making certain that the Application Pool was running under IIS_IUSRS, everything worked fine.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 5

Apply the following Changes 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.Enter the object name to select(example) Textbox will display for you type IIS_IUSRS and click check user button. as well IUSR then OK, it will be added in user list. Or Click Advanced then Click Find Now Button it shows all the users to you select the users from the users list.
7.Click OK. And and give permission for the users IIS_IUSRS and IUSR
8.Click to select the Read check box, and then click OK.
10.In the Web.config Properties dialog box, click OK.

Note: You must give permission for these two users(IIS_IUSRS and IUSR) do very carefully
With Friendly
David
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160525.2 | Last Updated 20 Mar 2015
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100