0

I need to separate data from user settings into several files because some settings are too large and already are in XML (e.g. AvalonDock layout).

But I am not able to find suitable solutions. If I use SettingsSingleFileGenerator, I can't separate settings. But also I can't get the path of the file user.config - the property UserAppDataPath exists only in WinForms application class but I use WPF. Environment folders don't match the settings path, the nearest one is LocalApplicationData but subdirectories in fact don't match any of entry assembly attribute (it isn't always CompanyName\ProductName\ProductVersion, but often with some random hash).

What is the best way to save raw XML settings in a separate file in the same directory?

The SettingsSingleFileGenerator source is like this code:

xmlns="schemas.microsoft.com/VisualStudio/2004/01/settings"; 
CurrentProfile="(Default)" GeneratedClassNamespace="STOProcedures.Warehouse.Properties"
GeneratedClassName="Settings"> 
<Profiles /> 
 <Settings> 
   <Setting Name="MultipleActionMode" Type="System.String" Scope="User"> 
       <Value Profile="(Default)">Fade</Value> 
    </Setting>
6
  • Welcome to stack overflow.. First of all have u tried anything??? Mar 10, 2014 at 3:15
  • I think I've described what i've tried - i've not succeded to find some SettingsSingleFileGenerator configuration that can separate settings into several files. Next I've not succeded to get the settings path directly (it was, as I've noted, with a random hash). I have no more ideas myself and I've not found proper information over the Web...
    – Ilya81
    Mar 11, 2014 at 5:45
  • Please put code whatever u have tried so far.. Mar 11, 2014 at 5:58
  • The SettingsSingleFileGenerator source is like this code SettingsFile xmlns="schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="STOProcedures.Warehouse.Properties" GeneratedClassName="Settings"> <Profiles /> <Settings> <Setting Name="MultipleActionMode" Type="System.String" Scope="User"> <Value Profile="(Default)">Fade</Value> </Setting> code The code I've tried to get the settings path is
    – Ilya81
    Mar 13, 2014 at 4:12
  • That code is codestring settingsPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);code The line I could find over the Web that is codestring settingsPath = Application.UserAppDataPath; code will not compile 'cause it isn't WinForms.
    – Ilya81
    Mar 13, 2014 at 4:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.