I`m using IIS6.0. How can I correct the following error:
I am having the error:
Access to the path ‘c:\inetpub\wwwroot\global.asax’ 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\global.asax’ 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 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:\inetpub\wwwroot\global.asax’ is denied.]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
+9726046 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) +1142
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share) +83
System.Web.Hosting.MapPathBasedVirtualFile.Open() +75
System.Web.Hosting.VirtualPathProvider.OpenFile(String virtualPath)
+31 System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath) +133
System.Web.UI.TemplateParser.ParseInternal() +86
System.Web.UI.TemplateParser.Parse() +160
System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType()
+110 System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider
buildProvider) +65
System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders()
+218 System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +40 System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean
isPrecompiledApp) +8973974
System.Web.Compilation.BuildManager.CompileGlobalAsax() +50
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +265[HttpException (0x80004005): Access to the path
‘c:\inetpub\wwwroot\global.asax’ is denied.]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException()
+62 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +421
System.Web.Compilation.BuildManager.CallAppInitializeMethod() +31
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager
appManager, IApplicationHost appHost, IConfigMapPathFactory
configMapPathFactory, HostingEnvironmentParameters hostingParameters,
PolicyLevel policyLevel, Exception appDomainCreationException) +605[HttpException (0x80004005): Access to the path
‘c:\inetpub\wwwroot\global.asax’ is denied.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8946484
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
+258——————————————————————————– Version Information: Microsoft .NET Framework Version:4.0.30319;
ASP.NET Version:4.0.30319.1
From the command propmt you could try
You can also do it the UI way … but you might allready know how to do that. But you better use the user that actually runs the IIS server.