Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: ASP.NET/IIS applications may fail to load when web.config file of the application is overridden by using Configuration.Save(…) or Configuration.SaveAs(…) methods in the .NET Framework 4.7

View products that this article applies to.


When developers use Configuration.Save(..)/Configuration.SaveAs(..) methods in Microsoft .NET Framework 4.7 to save/override web.config file of an ASP.NET/IIS (Internet Information Server) application, they may notice that a new empty Windows Forms application specific section <System.Windows.Forms.ApplicationConfigurationSection> is being added to web.config file and their application may fail to reload.

↑ Back to the top


While adding HDPI ( High Dots Per Inch) support for Windows Forms applications in the Microsoft .NET Framework 4.7, Windows Forms team has introduced a new configuration section <System.Windows.Forms.ApplicationConfigurationSection> in the application configuration (app.config) file through which developers can customize applications for HDPI specific features.

This new section is currently used only for Windows Forms applications and to customize HDPI features that are only added in Microsoft .NET Framework 4.7. Therefore, declaration of this new section happens at runtime and in Windows Forms applications only (as opposed to a general practice of declaring it in machine.config file). When developers use Configuration.Save(..)/Configuration.SaveAs(..) methods, they see an empty definition of this runtime declared section being added to the configuration file that's being Saved/Created/Overridden. When a non-Windows Forms application (ASP.NET/IIS) is reloaded with this newly Saved/Created/Overridden config file, the application may fail to reload because of missing declaration of the section.

↑ Back to the top


Developers/Users can safely remove this empty section <System.Windows.Forms.ApplicationConfigurationSection> definition from web.config file (it is not consumed by any other applications other than Windows Forms User Interface) and try reloading their application. Removal of this empty section from the file has no effect on functional behavior of the application.

↑ Back to the top


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section and Microsoft is working on solution in the upcoming versions of the product.

↑ Back to the top

Keywords: kbqfe, kbfix, kbsurveynew, kbexpertiseadvanced, kb

↑ Back to the top

Article Info
Article ID : 4035167
Revision : 12
Created on : 7/19/2017
Published on : 7/19/2017
Exists online : False
Views : 273