应用程序抛出异常 web.config 被修改但它不是 [英] App throws exception that web.config was modified but it's not

查看:26
本文介绍了应用程序抛出异常 web.config 被修改但它不是的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 asp.net Web 表单站点在 azure 应用程序服务上遇到了奇怪的问题.

I'm facing strange problem on azure app service with my asp.net web forms site.

出现异常:

ConfigurationErrorsExceptionSystem.Configuration.BaseConfigurationRecord in EvaluateOne

The configuration file has been changed by another program. (D:homesitewwwrootweb.config)

ConfigurationErrorsException: The configuration file has been changed by another program. (D:homesitewwwrootweb.config)
  Module "System.Configuration.BaseConfigurationRecord", line 72, col 0, in EvaluateOne
System.Object EvaluateOne(System.String[], System.Configuration.SectionInput, Boolean, System.Configuration.FactoryRecord, System.Configuration.SectionRecord, System.Object)
  Module "System.Configuration.BaseConfigurationRecord", line 515, col 0, in Evaluate
Boolean Evaluate(System.Configuration.FactoryRecord, System.Configuration.SectionRecord, System.Object, Boolean, Boolean, System.Object ByRef, System.Object ByRef)
  Module "System.Configuration.BaseConfigurationRecord", line 666, col 0, in GetSectionRecursive
Void GetSectionRecursive(System.String, Boolean, Boolean, Boolean, Boolean, System.Object ByRef, System.Object ByRef)
  Module "System.Configuration.BaseConfigurationRecord", line 0, col 0, in GetSection
System.Object GetSection(System.String)
  Module "System.Web.Configuration.RuntimeConfig", line 0, col 0, in GetSectionObject
System.Object GetSectionObject(System.String)
  Module "System.Web.Configuration.RuntimeConfig", line 19, col 0, in GetSection
System.Object GetSection(System.String, System.Type, ResultsIndex)
  Module "System.Web.Configuration.RuntimeConfig", line 0, col 0, in get_Authorization
System.Web.Configuration.AuthorizationSection get_Authorization()
  Module "System.Web.Security.UrlAuthorizationModule", line 153, col 0, in OnEnter
Void OnEnter(System.Object, System.EventArgs)
  Module "System.Web.HttpApplication+SyncEventExecutionStep", line 65, col 0, in System.Web.HttpApplication.IExecutionStep.Execute
Void System.Web.HttpApplication.IExecutionStep.Execute()
  Module "System.Web.HttpApplication", line 21, col 0, in ExecuteStep
System.Exception ExecuteStep(IExecutionStep, Boolean ByRef)

应用程序部署 10-15 分钟后抛出带有异常的 YSOD.应用程序没有重新启动它只是显示 YSOD.

YSOD with Exception is throw after 10-15minutes application deploy.App is not restarting it's just showing YSOD.

但没有人编辑 web.config.修改日期没有改变,内容也没有改变 - 与 win 合并相比,文件是相同的(部署后直接一个,一个抛出异常).

But no one edited web.config. Date modified didn't change and nor did the content - compared with win merge and files are identical (one straight after deploy with one that throws exception).

在手动保存 web.config(没有任何更改)文件或重新部署应用程序后,问题在接下来的 10-15 分钟内得到解决.

After manually saving web.config (without any changes) file or re deploying app problem is resolved for next 10-15 minutes.

@Edit1

也尝试过:

  • 将其部署为另一个应用服务 - 不工作
  • 不在本地运行azure(工作正常,所以它似乎与 azure 应用服务有关主机).

@Edit2

我们在 2017 年 6 月 6 日的日志中遇到了第一个错误,它不时发生(我说是每周一次.但它是流量非常低的测试环境),直到两天前 (27.06.2017).然后它就爆炸了,一直在发生.

We got first error in logs from 6.6.2017 and it occured from time to time (i'd say once a week. But it's test environment with very low traffic) till two days ago (27.06.2017). Then It just exploded and happens all the time.

@Edit3

我从符号服务器下载了源文件并调试了它.

I Downloaded source files from symbol server and debugged it.

从方法 GetStreamVersion 返回的当前版本很奇怪.上次写入时间是创建时间前 10 分钟.(也许它在应用程序崩溃之前以某种方式与 10-15 相关联?)

Current version returned from method GetStreamVersion is strange. Last write time is 10 minutes before creation time. (maybe it's somehow connected with 10-15 before app crashes?)

上一版本与当前版本对比正常的地方.在上次写入之前创建.

Where Last version which is compared with current version is normal. Created before last write.

不知道为什么修改了创建时间.我用 powershell 在 kudu 上仔细检查了它,一切似乎都没问题(值与 lastVersion 中的相同).

No idea why creation time is modified. I double checked it on kudu with powershell and everything seems to be ok (values are the same as in lastVersion).

当前版本:

  • 创建时间:{6/29/2017 10:28:30 AM}
  • 上次写入时间:{6/29/2017 10:17:18 AM}

最新版本:

  • 创建时间:{6/28/2017 8:50:11 AM}
  • 上次写入时间:{6/29/2017 10:17:18 AM}

使用 kudu for web.config 的时间:

Times taken with kudu for web.config:

  • 创作时间:2017 年 6 月 28 日上午 8:50:11
  • 上次写入时间:2017 年 6 月 29 日上午 10:17:18
  • 上次访问时间:2017 年 6 月 28 日上午 8:50:11

https://github.com/Microsoft/referencesource/blob/master/System.Configuration/System/Configuration/BaseConfigurationRecord.cs#L3988

推荐答案

收到 Azure 团队的回复:

Received response from the Azure team:

设置 WEBSITE_DYNAMIC_CACHE_FCN_MODE = 1 先尝试一下,根据问题行为,它应该解决问题.如果这个设置没有修复,我们需要去 WEBSITE_DYNAMIC_CACHE = 0

Setting WEBSITE_DYNAMIC_CACHE_FCN_MODE = 1 try it first, as per issue behavior it should address the issue. If this setting does not heal we need to go for WEBSITE_DYNAMIC_CACHE = 0

附注:

设置 WEBSITE_DYNAMIC_CACHE_FCN_MODE = 1 不应导致性能影响.设置 WEBSITE_DYNAMIC_CACHE = 0 可能会稍微如果网站内容大小是在初始加载期间影响性能巨大的.

Setting WEBSITE_DYNAMIC_CACHE_FCN_MODE = 1 should not lead to performance impact. Setting WEBSITE_DYNAMIC_CACHE = 0 may slightly impact the performance during initial loads if website content size is huge.

他们仍在调查为什么会突然出现这个问题.

They are still investigating why this problem occurred all the sudden.

这篇关于应用程序抛出异常 web.config 被修改但它不是的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆