Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The configuration file has been changed by another program

I am receiving the following error where the system believes the web.config file is being modified. The actual file shows no changes to the web.config file modified date since the site was last published. The issue shows up when being redirected to another page, though the pages where the issue occurs will change and the error will exist for any user who accesses the site. The issue can be temporarily alleviated by re-publish the application, but in about 24 hours the issue will return. Any ideas why it thinks the file is changing even though it is not?

Current User: NT AUTHORITY\NETWORK SERVICE Target Site: BaseConfigurationRecord.EvaluateOne Error: (System.Configuration.ConfigurationErrorsException) The configuration file has been changed by another program. (E:\PEC\web.config)

StackTrace: at System.Configuration.BaseConfigurationRecord.EvaluateOne(String[] keys, SectionInput input, Boolean isTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult)
at System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult, Boolean getLkg, Boolean getRuntimeObject, Object& result, Object& resultRuntimeObject) at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject) at System.Configuration.BaseConfigurationRecord.GetSection(String configKey) at System.Web.Configuration.RuntimeConfig.GetSectionObject(String sectionName) at System.Web.Configuration.RuntimeConfig.GetSection(String sectionName, Type type, ResultsIndex index) at System.Web.Configuration.RuntimeConfig.get_Authorization() at System.Web.Security.UrlAuthorizationModule.OnEnter(Object source, EventArgs eventArgs) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

like image 452
Drew Avatar asked Mar 23 '10 16:03

Drew


1 Answers

We found this problem was caused by two different applications in IIS being configured to point to the same directory - we had a www.mysite.com and preview.mysite.com; we'd set up preview by using msdeploy to clone the main site, and not realized that www.mysite.com/foo was a standalone IIS virtual application - so we ended up with www.mysite.com/foo and preview.mysite.com/foo both pointing to the same folder, and 'fighting' over which one of them owned the config file, etc.

Removing the second virtual app fixed the problem.

like image 50
Dylan Beattie Avatar answered Sep 24 '22 02:09

Dylan Beattie