I got exception: The type initializer for 'mws.Options_DB' threw an exception. what does it mean?
<p>What could be the problem ? The exception happen each time the same exception.
This is the line that throw the exception when i click a button and call it:</p>

<pre><code>public void Save()
        {
            Options_DB.Set_Points_Coordinates_List(Point_X);
        }
</code></pre>

<p>The Point_X is a List of type Float </p>

<p>Cant figure out how ot fix the problem.</p>

<p>I have in Form1 a button click event where i call there the function above in another class: Save()</p>

<p>I used a breakpoint on it when its doing the line in the Save() function its going ot the Options_DB class and doing in the top of it:</p>

<pre><code>static List&lt;float&gt; Points_Coordinates;
        static string settings_dir;
        static string settings_file;
        static OptionsFile setting_file;
        static string path_settings;
        static string path_exe;

        static Options_DB()
        {
            // ---  O P E N N I N G   S E T T I N G   F I L E   
            //t = voices_volume_trackbar.ToString();
            path_exe = Path.GetDirectoryName(Application.LocalUserAppDataPath);
            path_settings = Path.GetDirectoryName(Application.LocalUserAppDataPath);
            settings_file = "\\settings.txt";
            settings_dir = path_settings + @"\settings";
            setting_file = new OptionsFile(settings_dir + settings_file);
</code></pre>

<p>When its getting to the line: <code>setting_file = new OptionsFile(settings_dir + settings_file);</code> its getting to the OptionsFile class and there its trying to create the directory and file in the exception:</p>

<pre><code>string path_exe;
        string temp_settings_file;
        string temp_settings_dir;
        string Options_File;
        StreamWriter sw;
        StreamReader sr;

/*----------------------------------------------------------
 * Function     : OptionsFile
 * Description  : Constructor
 * Parameters   : file_name is the name of the file to use
 * Return       : none
 * --------------------------------------------------------*/
    public OptionsFile(string settings)
    {

        if (File.Exists(settings))
        {

        }
        else
        {
        FileStream fs=File.Create(settings);
</code></pre>

<p>But once the breakpoint is on the line File.Create(settings); and i see that settings containing the path and file name instead of creating them its jumping back to the Save() function to the line inside there and then throw the exception.</p>

<p>Why its jumping to the Save() and not creating the path and file ?</p>
