Click here to Skip to main content
15,893,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ...

When I am communicating the IIS to add the binding to web site using fallowing c# code

C#
using (Microsoft.Web.Administration.ServerManager serverManager = new Microsoft.Web.Administration.ServerManager())
        {
            Microsoft.Web.Administration.Site site = serverManager.Sites[0];
            site.Bindings.Count();
            site.Bindings.Clear();

            if (site != null)
            {

                site.Bindings.Add("*:80:", "http");
            }
            serverManager.CommitChanges();

        }


when I am executing it throws the following error

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



Please Help to solve this exception.

thanks,
purna
Posted

1 solution

Refer the steps mentioned in the link which deals with similar issue

Error: Cannot read configuration file due to insufficient permissions[^]
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900