Estimados programadores, tengo un problema.A través de CreateDirectory de C#
estoy creando un directorio para alojar páginas que se generan con mi
aplicación Web, pero me da el siguiente error:
Access to the path "C:\Inetpub\wwwroot" is denied.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.UnauthorizedAccessException: Access to the path
"C:\Inetpub\wwwroot" is denied.
The ASP.NET process is not authorized to access the requested resource. For
security reasons the default ASP.NET process identity is
'{machinename}\ASPNET', which has limited privileges. Consider granting
access rights to the resource to the ASP.NET process identity.
To grant ASP.NET write access to a file, right-click the file in Explorer,
choose "Properties" and select the Security tab. Click "Add" to add the
"{machinename}\ASPNET" user. Highlight the ASP.NET account, and check the
Write box in the Allow column.
Source Error:
Line 181: string Materia = NombreAsignatura;
Line 182: Asignatura=NombreAsignatura;
Line 183:
Directory.CreateDirectory("..\\..\\Inetpub\\wwwroot\\Udossenger\\Asignaturas
\\Sinoptico\\" + NombreAsignatura);
Line 184: Ruta "..\\..\\Inetpub\\wwwroot\\Udossenger\\Asignaturas\\Sinoptico\\" +
NombreAsignatura + "\\" + NombreArchivo + ".html";
Line 185: NombreArc=NombreArchivo;
Source File: c:\inetpub\wwwroot\SIDEC\Archivos.cs Line: 183
Ahora bien, estoy seguro que funciona porque en otro servidor corre
perfectamente, pero aqui en mi máquina no lo hace. Por favor si alguien me
puede orientar se lo agradezco de antemano
Leer las respuestas