I joined a project where .NET Windows Forms application is using Settings mechanism (Project > Properties > Settings) to preserve both user settings and application settings. I have created command-line tool which uses LoadAssembly(<main application EXE file>)
to perform some functionalities of main app. Upon invoking of main app's methods everything works fine except when comes to Settings – of course, because they were not loaded – settings loader was skipped.
But the application heavily relies on settings so I need to call that settings loader explicitly. But I can't find it: I have analyzed all files of blank .NET project with Settings added and loading routine is nowhere to find.
I think at worst I can workaround the problem and implement
- locating settings file
- explicit loading of its content
but I do not like re-inventing the wheel and especially I don't like non-transparent handling of loading of settings on .NET platform.
Is there any way to invoke built-in code used by .NET framework to load My.Settings
on application start-up?
Note: Application is written in VB.NET but I think for C# the thing is the same, so do not hesitate to present C# way of thinking, if you want to.