title: Completely disable AppSettings in WPF app?
body: <p>Consider any <code>WPF</code> app, targeting any <code>.NET</code> version (including <code>.NET 5</code>). On application load, nearly <strong>half a second</strong> is wasted in reading/parsing of <code>AppSettings</code>.</p>
  <p><strong>Q:</strong> Is it possible to completely disable the <code>AppSettings</code> system in a <code>WPF</code> app?</p>
  <p>As can be seen in <a href="https://referencesource.microsoft.com/#windowsbase/Base/System/Windows/BaseCompatibilityPreferences.cs,23" rel="nofollow noreferrer">BaseCompatibilityPreferences.cs</a> the <code>AppSettings</code> object is hit immediately upon type initialization (static constructor). This is where a performance hit can be observed:</p>
  <p><a href="https://i.stack.imgur.com/uDHd8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uDHd8.png" alt="Performance hit on startup" /></a></p>
  <p>I can imagine that an antivirus scanner could be involved here, since this involves reading from disk. Anyway, I'm wondering if we can completely get rid of this cost. Ideas?</p>