Saturday 20 May 2017

User.config file path without .NET Framework

We're upgrading a old Windows app which used .NET Framework to a new app which does not (an Electron app). We need to migrate settings from the old app into the new version. The settings are stored in a User.config file using the System.Configuration package in .NET Framework.

How can we reliably get the path of the User.config file created by the prior version of the app from our new app? The path has a long hash or GUID in it (and I assume the path and hash vary in each install and version of windows).

This method works from .NET, but our new app doesn't have .NET: ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoaming).FilePath



via delrox

No comments:

Post a Comment