【发布时间】:2016-01-04 19:39:51
【问题描述】:
我的 Azure Web 角色突然停止工作并出现以下错误。
“访问路径 'F:\sitesroot\0\Web.config' 被拒绝。”
最近没有发布任何更改或配置,直到昨天它都可以正常工作!我检查了 Web.config 的权限,我看到所有用户都有读取/执行权限。这是堆栈跟踪:
[UnauthorizedAccessException: Access to the path 'F:\sitesroot\0\Web.config' is denied.]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +216
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) +1430
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) +205
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +87
System.IdentityModel.Tokens.UpdateValidatingIssuerNameRegistry.FlushDocument(String originalXml, String location) +218
System.IdentityModel.Tokens.UpdateValidatingIssuerNameRegistry.UpdateIssuerNameRegistryElement(String pathToConfig, String fedMetadataAddress, String serviceName) +493
Manager.MvcApplication.RefreshValidationSettings() in c:\GitHub\mfs_backoffice\2013_2.2\KCI.MFS.Manager\ManagerMFS\Global.asax.cs:37
Manager.MvcApplication.Application_Start() in c:\GitHub\mfs_backoffice\2013_2.2\KCI.MFS.Manager\ManagerMFS\Global.asax.cs:30
[HttpException (0x80004005): Access to the path 'F:\sitesroot\0\Web.config' is denied.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +12601629
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 'F:\sitesroot\0\Web.config' is denied.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12618676
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12458293
更新:
在遇到问题后,我还重新启动、重新映像并重新部署了实例,但都没有成功。我还尝试将我的文件复制到实例上的不同位置(在 D 驱动器中)并将其作为另一个站点添加到 IIS,但是当我尝试浏览它时它仍然给我同样的错误
【问题讨论】:
-
您是否对您的 Web 角色实例进行了 RDP,以确认驱动器号仍然是 f: 并且没有更改为 e: ?
-
是的,仍然是 f:@DavidMakogon
标签: c# asp.net azure iis azure-web-roles