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
When I read the settings like this
Which way will it be read?
- Read from disc into the memory at application startup, so that it will be read from memory every time.
- The first call reads it into memory, so the first read is from disc, and after that read from memory
- 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.