简体   繁体   中英

Unrecognized configuration section startup

I'm trying to run an older c# winforms application that basically tries to read an xml file but when it calls XmlReader.Create to read the stream as an xml, it throws a "Configuration system failed to initialize" exception. The inner exception is "Unrecognized configuration section startup." in the 3rd line of the exe.config file. The app.config file:

<?xml version="1.0"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>

I've tried a couple of things to solve this issue (like reinstalling the .netframework and visual studio) but the only thing that worked was to remove the startup section from the configuration file.

Does anyone know what caused this exception or how to truly fix it since every other computer we tried to run the application on didn't have this issue.

I just had to set the Visual Studio settings.

  1. Navigate to C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\Common7\\IDE

  2. Open terminal and hence do

devenv /resetsettings General

Reference:

Visual Studio Reset Settings

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM