Note that there are some explanatory texts on larger screens.

plurals
  1. POApplication Settings for Multiple C# Libraries in Mono (Linux)
    primarykey
    data
    text
    <p>I have a project being ported to work on Linux under Mono. The project includes multiple C# libraries, which have their own user-scoped, Application Settings (generated automatically via VS2008). In the end, the project will run on .NET in Windows and Mono in Ubuntu 10.04.</p> <p>When operating in Windows, Application Settings are stored in a single user.config file with separate Configuration Sections for each library:</p> <pre><code>&lt;configuration&gt; &lt;configSections&gt; &lt;sectionGroup name="userSettings" type="UserSettingsGroup ...&gt; &lt;section name="LibFoo.Properties.Settings" type="ClientSettingsSection ... /&gt; &lt;section name="LibBar.Properties.Settings" type="ClientSettingsSection ... /&gt; &lt;/sectionGroup&gt; &lt;/configSections&gt; &lt;userSettings&gt; &lt;LibFoo.Properties.Settings&gt; &lt;setting name="strFoo" serializeAs="String"&gt; &lt;value&gt;An example string value.&lt;/value&gt; &lt;/setting&gt; &lt;/LibFoo.Properties.Settings&gt; &lt;LibBar.Properties.Settings&gt; &lt;setting name="strBar" serializeAs="String"&gt; &lt;value&gt;An example string value.&lt;/value&gt; &lt;/setting&gt; &lt;/LibBar.Properties.Settings&gt; &lt;/userSettings&gt; &lt;/configuration&gt; </code></pre> <p>In Ubuntu, a single user.config is created, however, I find that only one section is created for whichever library first calls Properties.Settings.Save(), and all libraries use that same section:</p> <pre><code>&lt;configuration&gt; &lt;configSections&gt; &lt;sectionGroup name="userSettings" type="UserSettingsGroup ... &gt; &lt;section name="LibFoo.Properties.Settings" type="ClientSettingsSection ... /&gt; &lt;/sectionGroup&gt; &lt;/configSections&gt; &lt;userSettings&gt; &lt;LibFoo.Properties.Settings&gt; &lt;setting name="strFoo" serializeAs="String"&gt; &lt;value&gt;An example string value.&lt;/value&gt; &lt;/setting&gt; &lt;setting name="strBar" serializeAs="String"&gt; &lt;value&gt;An example string value.&lt;/value&gt; &lt;/setting&gt; &lt;/LibFoo.Properties.Settings&gt; &lt;/userSettings&gt; &lt;/configuration&gt; </code></pre> <p>This becomes particularly troubling when settings among the libraries have the same name. </p> <p>Is this a bug in Mono, or do I need to change something for Mono to generate separate sections for my library's settings?</p> <ul> <li>Ubuntu v10.04</li> <li>mono-runtime v2.10.8</li> <li>Visual Studio 2008 Professional</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload