Server Error in '/' Application.

Access to the path 'C:\Website\WebSiteSH\EN\Uploads\XMLs\Setting.xml' 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:\Website\WebSiteSH\EN\Uploads\XMLs\Setting.xml' is denied.

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in File Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

Source Error:


Line 29:         Application.Lock();
Line 30:         Application["OnlineUsers"] = (int)Application["OnlineUsers"] + 1;
Line 31:         YTW.API.Data.User.User_Helper.hitCountInsc();
Line 32:         Application.UnLock();
Line 33:     }

Source File: c:\Website\WebSiteSH\EN\global.asax    Line: 31

Stack Trace:


[UnauthorizedAccessException: Access to the path 'C:\Website\WebSiteSH\EN\Uploads\XMLs\Setting.xml' is denied.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +419
   System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +886
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) +144
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync) +110
   System.Xml.XmlWriterSettings.CreateWriter(String outputFileName) +287
   System.Xml.Linq.XDocument.Save(String fileName, SaveOptions options) +114
   YTW.API.Data.User.User_Helper.hitCountInsc() in e:\Tuyen\EN\ytw.api\YTW.API\Data\User\User_Helper.cs:207
   ASP.global_asax.Session_Start(Object sender, EventArgs e) in c:\Website\WebSiteSH\EN\global.asax:31
   System.Web.SessionState.SessionStateModule.CompleteAcquireState() +382
   System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) +1220
   System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +634
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +157


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.81.0