1. Can anyone clarify me about this error?

    6:53 AM [Error] ArgumentNullException while calling LoadDefaultConfig: (ArgumentNullException: Argument cannot be null.
    Parameter name: path)
    6:53 AM [Debug] at System.IO.Path.InsecureGetFullPath (System.String path) [0x00000] in <filename unknown>:0
    at System.IO.Path.GetFullPath (System.String path) [0x00000] in <filename unknown>:0
    at Oxide.Core.Configuration.DynamicConfigFile.CheckPath (System.String filename) [0x00000] in <filename unknown>:0
    at Oxide.Core.Configuration.DynamicConfigFile.Save (System.String filename) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.BlackMarket.CreateDefaultConfig () [0x00000] in <filename unknown>:0
    at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
    at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
     
  2. LoadDefaultConfig isn't getting a path for some reason, what does your code look like?
     
  3. Even with that error, the Config File is created exactly with the structure that I issued to, and how the file is in the correct Config folder, I don't get why the error shows up... but also, that only happens on the first plugin start when it generates the config file, besides that, the next loads are done without errors.

    Code:
    //Microsoft NameSpaces
    using System;
    using System.IO;
    using System.Collections.Generic;
    using System.Linq;
    using System.Reflection;// Rust Unity Namespaces
    using Rust;
    using UnityEngine;//Oxide NameSpaces
    using Oxide.Core;
    using Oxide.Core.Logging;
    using Oxide.Core.Plugins;//External NameSpaces
    using Newtonsoft.Json;
    using Newtonsoft.Json.Converters;namespace Oxide.Plugins
    {
        [Info("BlackMarket", "TheRotAG", "1.0.0")]
        public class BlackMarket : RustPlugin
        {        #region Building Config
            public class settingsObj
            {
                public string ChatName { set; get; }
                public string MsgColor { set; get; }
                public string ChatNameColor { set; get; }
                public string SellerNameColor { set; get; }
                public string BuyerNameColor { set; get; }
                public bool    OfflineAlerts;
            }        public class messagesObj
            {
                public string OnlineAlert { set; get; }
                public string OfflineAlert { set; get; }
                public string BuySingle { set; get; }
                public string BuyMulti { set; get; }
                public string InvalidItem { set; get; }
                public string FoundItem { set; get; }
                public string ItemList { set; get; }
            }
           
            public class commandsObj
            {
                public string Sell { set; get; }
                public string Buy { set; get; }
            }
            #endregion
           
            public settingsObj settings;
            public messagesObj messages;
            public commandsObj commands;
            private string configPath;
            private bool loaded = false;
           
            #region hook methods
            void SetupConfig()
            {
                if (this.loaded)
                {
                    return;
                }            LoadConfig();
                this.configPath = Manager.ConfigPath + string.Format("\\{0}.json", Name);
                this.settings = JsonConvert.DeserializeObject<settingsObj>((string)JsonConvert.SerializeObject(Config["Settings"]).ToString());
                this.messages = JsonConvert.DeserializeObject<messagesObj>((string)JsonConvert.SerializeObject(Config["Messages"]).ToString());
                this.commands = JsonConvert.DeserializeObject<commandsObj>((string)JsonConvert.SerializeObject(Config["Commands"]).ToString());
                this.loaded = true;
            }        void Loaded()
            {
                Puts("Black Market by The Realm of the Addicted Gamers successfully started.");
                this.SetupConfig();
            }        [HookMethod("OnServerInitialized")]
            void OnServerInitialized()
            {
                this.SetupConfig();
            }        [HookMethod("LoadDefaultConfig")]
            void CreateDefaultConfig()
            {
                #region Settings
                settingsObj localSettings = new settingsObj();            localSettings.ChatName = "BlackMarket";
                localSettings.MsgColor = "#DFF79E";
                localSettings.ChatNameColor = "#26FF00";
                localSettings.SellerNameColor = "#FF7373";
                localSettings.BuyerNameColor = "#428C9C";
                localSettings.OfflineAlerts = true;
                #endregion
               
                #region Messages
                messagesObj localMessages = new messagesObj();
               
                localMessages.OnlineAlert = "Your {item} has been sold in Black Market";
                localMessages.OfflineAlert = "Hi there {seller}! Since your last visit, your {items} were sold in the Black Market";
                localMessages.BuySingle = "Here is your {item}. Please, come again!";
                localMessages.BuyMulti = "Here are your {quant} {item}s. Please, come again!";
                localMessages.InvalidItem = "We don't have any {invalid}s here...";
                localMessages.FoundItem = "We have {item}s with the following prices:";
                localMessages.ItemList = "Seller ID: {id}   --   Price: ${price}";
                #endregion            #region Commands
                commandsObj localCommands = new commandsObj();
               
                localCommands.Sell = "sell";
                localCommands.Buy = "buy";           
                #endregion            this.settings = localSettings;
                Config["Settings"] = this.settings;
                this.messages = localMessages;
                Config["Messages"] = this.messages;
                this.commands = localCommands;
                Config["Commands"] = this.commands;
               
                Config.Save(this.configPath);
                this.SetupConfig();
            }
            #endregion
        }
    } 
    
     
  4. hmm, I've been playing around with config files but I've been using a different approach, here's my test file:
    Code:
    // Reference: Oxide.Ext.Rustusing Oxide.Core;
    using Oxide.Core.Configuration;using System;
    using System.Collections.Generic;
    using System.Data;
    using System.Reflection;
    using System.Net;using UnityEngine;namespace Oxide.Plugins {    [Info("Test", "Mughisi", "2.0.0")]
        class Test : RustPlugin {        private class PlayerInfo
            {
                private string myText;
                private int myNumber;
                public string MyText {
                    get {
                        return myText;
                    }
                }
                public int MyNumber
                {
                    get
                    {
                        return myNumber;
                    }
                }
                public PlayerInfo(string t, int n)
                {
                    myText = t;
                    myNumber = n;
                }
            }        private DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0);
            private bool changed = false;        private Dictionary<String, object> gConfig;        private DynamicConfigFile gods;        private Dictionary<BasePlayer, long> AntiNoDamageSpam;        void Init ()
            {
                LoadPluginConfig();
                LoadPluginData();
            }        void LoadPluginConfig()
            {
                string test = Convert.ToString(GetConfigValue("Settings", "Chatname", "Test"));            Dictionary<string, object> myTest = new Dictionary<string, object>();
                Dictionary<string, object> myTestB = new Dictionary<string, object>();
                Dictionary<string, object> myTestC = new Dictionary<string, object>();            List<string> testList = new List<string>();
                Config.Clear();            Config["key"] = "value";
                myTest.Add("123", "abc");
                myTest.Add("456", "def");
                myTest.Add("abc", 1);
                Config["MultipleValues"] = myTest;
                myTestB.Add("abcd", myTest);
                myTestB.Add("def", 0);
                testList.Add("abc");
                testList.Add("def");
                testList.Add("ghi");
                myTestB.Add("msg", testList);
                myTestB.Add("msg2", "a");
                myTest.Add("msg", "test");
                myTestC.Add("a", myTestB);
                myTestC.Add("789", new PlayerInfo("abc", 123));
                myTestC.Add("456", new PlayerInfo("abc", 123));
                myTestC.Add("123", new PlayerInfo("abc", 123));
                Config["SubSubValues"] = myTestB;
                Config["SubSubSubValues"] = myTestC;            SaveConfig();            try
                {
                    var data = Config["SubSubSubValues"] as Dictionary<string, object>;
                    object val;
                    if (data.TryGetValue("123", out val))
                    {
                        PlayerInfo infoTest = val as PlayerInfo;
                        Puts(infoTest.ToString());
                        string testb = infoTest.MyText;
                        Puts(testb);
                    }
                }
                catch (Exception ex) { Puts("Exception!");  }        }        void LoadPluginData()
            {
                gods = Interface.GetMod().DataFileSystem.GetDatafile("Gods");
            }        void LoadDefaultConfig()
            {
                Puts("Test : Creating a new config file.");
                Config.Clear();
                LoadPluginConfig();
            }        object GetConfigValue(string category, string setting, object defaultValue)
            {
                var data = Config[category] as Dictionary<string, object>;            if (data == null)
                {
                    data = new Dictionary<string, object>();
                    Config[category] = data;
                    changed = true;
                }
               
                object value;            if (!data.TryGetValue(setting, out value))
                {
                    value = defaultValue;
                    data[setting] = value;
                    changed = true;
                }            return value;
            }        long GetTimestamp()
            {
                long unixTimestamp = System.Convert.ToInt64((System.DateTime.UtcNow.Subtract(epoch)).TotalSeconds);            return unixTimestamp;
            }    }}
     
  5. Seems good to go too! Reneb also do the same as you.
    I've another C# plugin that I starter using the same aproach and I don't have "path" errors. This new method that I tried is used by @ColonelAngus in his plugins.