Hi Experts,
i have created a web application which has an option to edit the web config file from the web page. when i create an installer for this project using web setup project in VS2008 and install it, the codes are copied to the virtual directory under Inetpub. when i try to edit the web.config file it throws an exception access is denied to web.config file.
but the same project works fine if i copy the file to some other location and manually configure them to the IIS.
so i have modified my code to add the ASPNET user to the virtual directory with full rights using System.Manageme nt class. this also works fine if the code is outside the Inetpub folder. if i create an installer for this this throws the below error.
"System.Managem ent.ManagementE xception: Access denied at System.Manageme nt.ManagementEx ception.ThrowWi thExtendedInfo( ManagementStatu s errorCode) at System.Manageme nt.ManagementSc ope.InitializeG uts(Object o) at System.Manageme nt.ManagementSc ope.Initialize( ) at System.Manageme nt.ManagementOb jectSearcher.In itialize() at System.Manageme nt.ManagementOb jectSearcher.Ge t() at DataBaseConnect ions.setRights( ) in c:\Inetpub\wwwr oot\AurasavGUI\ DataBaseConnect ions.aspx.cs:li ne 50 "
requesting you for some ideas to overcome this issue.
Thanks and regards
karthi
i have created a web application which has an option to edit the web config file from the web page. when i create an installer for this project using web setup project in VS2008 and install it, the codes are copied to the virtual directory under Inetpub. when i try to edit the web.config file it throws an exception access is denied to web.config file.
but the same project works fine if i copy the file to some other location and manually configure them to the IIS.
so i have modified my code to add the ASPNET user to the virtual directory with full rights using System.Manageme nt class. this also works fine if the code is outside the Inetpub folder. if i create an installer for this this throws the below error.
"System.Managem ent.ManagementE xception: Access denied at System.Manageme nt.ManagementEx ception.ThrowWi thExtendedInfo( ManagementStatu s errorCode) at System.Manageme nt.ManagementSc ope.InitializeG uts(Object o) at System.Manageme nt.ManagementSc ope.Initialize( ) at System.Manageme nt.ManagementOb jectSearcher.In itialize() at System.Manageme nt.ManagementOb jectSearcher.Ge t() at DataBaseConnect ions.setRights( ) in c:\Inetpub\wwwr oot\AurasavGUI\ DataBaseConnect ions.aspx.cs:li ne 50 "
requesting you for some ideas to overcome this issue.
Thanks and regards
karthi
Comment