Summary:
This article troubleshoots an error that occurs when launching the Web Portal for the first time after installation due to a mismatched location.
Symptoms:
When a user launches the Web Portal first time after installation, they receive the following error message:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Access to the path 'C:\Program Files\OneStop Reporting\Portal\Services.config' 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:\Program Files\OneStop Reporting\Portal\Services.config' 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 , 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:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[UnauthorizedAccessException: Access to the path 'C:\Program Files\OneStop Reporting\Portal\Services.config' is denied.]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +216
System.IO.File.InternalDelete(String path, Boolean checkHost) +14245386
OneStop.Portal.Web.MvcApplication.Application_Start() +1003
[HttpException (0x80004005): Access to the path 'C:\Program Files\OneStop Reporting\Portal\Services.config' is denied.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +12601933
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +175
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475
[HttpException (0x80004005): Access to the path 'C:\Program Files\OneStop Reporting\Portal\Services.config' is denied.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12618980
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12458597
-------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34274
Cause:
This is caused by installer installing it in Program Files (x86) but the Website is pointing to Program Files causing mismatch return an error message.
Resolution:
Since moving the Onestop Reporting Folder from Program Files (x86) to Program files does not bring over the user permission, it will need to be changed from the IIS manager. In order to change the location on IIS Manager, follow the steps below.
- Open IIS Manager where Portal is installed.
- Under sites, click on OSR Portal
- On the right side pane, click on Advanced settings
- Change the physical path to replace program files to Program Files (x86).
- Restart portal and it should get to the login screen. If it does not then close the browser and do IISReset.
Properties:
OSR Portal 4.x and later