Home > Net >  Is Settings.Default being read from memory or disc
Is Settings.Default being read from memory or disc

Time:11-20

I have an application where I want to read as little information from the disc as possible. I have a WPF application in .net core 3.1 where I have created a settings file with user settings like this

enter image description here

When I read the settings like this

enter image description here

Which way will it be read?

  1. Read from disc into the memory at application startup, so that it will be read from memory every time.
  2. The first call reads it into memory, so the first read is from disc, and after that read from memory
  3. Always read from disc

CodePudding user response:

The value is read from an assembly that is stored on disk and loaded in the CLR on demand once so I guess the second option is the most correct one.

You cannot really control how the runtime loads the assemblies from disk though so this shouldn't be much of an issue.

Or maybe you should consider simply creating a class with static properties in the executable assembly.

  • Related